diff --git a/bower.json b/bower.json index 010575744..15a66ae45 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "tabulator", "main": "dist/js/tabulator.js", - "version": "5.3.0", + "version": "5.3.1", "description": "Interactive table generation JavaScript library", "keywords": [ "table", diff --git a/dist/js/tabulator.js b/dist/js/tabulator.js index a03c08386..c70ae224a 100644 --- a/dist/js/tabulator.js +++ b/dist/js/tabulator.js @@ -1,4 +1,4 @@ -/* Tabulator v5.3.0 (c) Oliver Folkerd 2022 */ +/* Tabulator v5.3.1 (c) Oliver Folkerd 2022 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -1624,8 +1624,19 @@ }, { key: "getColumns", - value: function getColumns() { - return this.columns; + value: function getColumns(traverse) { + var columns = []; + + if (traverse) { + this.columns.forEach(function (column) { + columns.push(column); + columns = columns.concat(column.getColumns(true)); + }); + } else { + columns = this.columns; + } + + return columns; } //return all columns in a group }, { @@ -1855,6 +1866,11 @@ }, { key: "setMinWidth", value: function setMinWidth(minWidth) { + if (this.maxWidth && minWidth > this.maxWidth) { + minWidth = this.maxWidth; + console.warn("the minWidth (" + minWidth + "px) for column '" + this.field + "' cannot be bigger that its maxWidth (" + this.maxWidthStyled + ")"); + } + this.minWidth = minWidth; this.minWidthStyled = minWidth ? minWidth + "px" : ""; this.element.style.minWidth = this.minWidthStyled; @@ -1865,6 +1881,11 @@ }, { key: "setMaxWidth", value: function setMaxWidth(maxWidth) { + if (this.minWidth && maxWidth < this.minWidth) { + maxWidth = this.minWidth; + console.warn("the maxWidth (" + maxWidth + "px) for column '" + this.field + "' cannot be smaller that its minWidth (" + this.minWidthStyled + ")"); + } + this.maxWidth = maxWidth; this.maxWidthStyled = maxWidth ? maxWidth + "px" : ""; this.element.style.maxWidth = this.maxWidthStyled; @@ -3324,6 +3345,8 @@ }, { key: "findColumn", value: function findColumn(subject) { + var columns; + if (_typeof(subject) == "object") { if (subject instanceof Column) { //subject is column element @@ -3332,8 +3355,13 @@ //subject is public column component return subject._getSelf() || false; } else if (typeof HTMLElement !== "undefined" && subject instanceof HTMLElement) { - //subject is a HTML element of the column header - var match = this.columns.find(function (column) { + columns = []; + this.columns.forEach(function (column) { + columns.push(column); + columns = columns.concat(column.getColumns(true)); + }); //subject is a HTML element of the column header + + var match = columns.find(function (column) { return column.element === subject; }); return match || false; @@ -5920,6 +5948,7 @@ } if (renderClass) { + this.renderMode = this.table.options.renderVertical; this.renderer = new renderClass(this.table, this.element, this.tableElement); this.renderer.initialize(); @@ -6487,7 +6516,10 @@ try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { var target = _step3.value; - targets[this.componentMap[target]] = el; + + if (!targets[this.componentMap[target]]) { + targets[this.componentMap[target]] = el; + } } } catch (err) { _iterator3.e(err); @@ -7737,7 +7769,7 @@ //resize columns to fit function fitColumns (columns, forced) { - var totalWidth = this.table.element.clientWidth; //table element width + var totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width var fixedWidth = 0; //total width of columns with a defined width @@ -7820,8 +7852,7 @@ }); remainingSpace = freeSpace - oversizeSpace; nextColWidth = changeUnits ? Math.floor(remainingSpace / changeUnits) : remainingSpace; - gap = remainingSpace - nextColWidth * changeUnits; - gap += scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols); + gap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols); } else { gap = changeUnits ? freeSpace - Math.floor(freeSpace / changeUnits) * changeUnits : freeSpace; undersizeCols.forEach(function (column) { @@ -7876,7 +7907,7 @@ gapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false); //increase width of last column to account for rounding errors if (flexColumns.length && gapFill > 0) { - flexColumns[flexColumns.length - 1].width += +gapFill; + flexColumns[flexColumns.length - 1].width += gapFill; } //calculate space for columns to be shrunk into @@ -7890,7 +7921,7 @@ } //decrease width of last column to account for rounding errors - if (fixedShrinkColumns.length) { + if (gapFill && fixedShrinkColumns.length) { fixedShrinkColumns[fixedShrinkColumns.length - 1].width -= gapFill; } @@ -10490,7 +10521,7 @@ key: "rowsUpdated", value: function rowsUpdated(row) { if (this.table.options.groupBy) { - this.recalcRowGroup(this); + this.recalcRowGroup(row); } else { this.recalcActiveRows(); } @@ -11023,6 +11054,10 @@ this.field = options.dataTreeChildField; this.indent = options.dataTreeChildIndent; + if (this.options("movableRows")) { + console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"); + } + if (options.dataTreeBranchElement) { if (options.dataTreeBranchElement === true) { this.branchEl = document.createElement("div"); @@ -11419,7 +11454,7 @@ }, { key: "getTreeParentRoot", value: function getTreeParentRoot(row) { - return row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row; + return row.modules.dataTree && row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row; } }, { key: "getFilteredTreeChildren", @@ -13834,7 +13869,7 @@ if (!startVis) { setTimeout(function () { _this13.popup.hideOnBlur(_this13._resolveValue.bind(_this13, true)); - }); + }, 10); } } } @@ -16267,6 +16302,9 @@ getColumn: function getColumn() { return column.getComponent(); }, + getTable: function getTable() { + return _this3.table; + }, getRow: function getRow() { return { normalizeHeight: function normalizeHeight() {} @@ -18637,7 +18675,7 @@ value: function hide() { this.visible = false; - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { + if (this.groupManager.table.rowManager.getRenderMode() == "basic" && !this.groupManager.table.options.pagination) { this.element.classList.remove("tabulator-group-visible"); if (this.groupList.length) { @@ -18655,7 +18693,7 @@ } this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); + this.groupManager.checkBasicModeGroupHeaderWidth(); } else { this.groupManager.updateGroupRows(true); } @@ -18667,7 +18705,7 @@ value: function show() { this.visible = true; - if (this.groupManager.table.rowManager.getRenderMode() == "classic" && !this.groupManager.table.options.pagination) { + if (this.groupManager.table.rowManager.getRenderMode() == "basic" && !this.groupManager.table.options.pagination) { this.element.classList.add("tabulator-group-visible"); var prev = this.generateElement(); @@ -18691,7 +18729,7 @@ } this.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex()); - this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth(); + this.groupManager.checkBasicModeGroupHeaderWidth(); } else { this.groupManager.updateGroupRows(true); } @@ -19497,6 +19535,30 @@ } } } + }, { + key: "checkBasicModeGroupHeaderWidth", + value: function checkBasicModeGroupHeaderWidth() { + var _this6 = this; + + var element = this.table.rowManager.tableElement, + onlyGroupHeaders = true; + this.table.rowManager.getDisplayRows().forEach(function (row, index) { + _this6.table.rowManager.styleRow(row, index); + + element.appendChild(row.getElement()); + row.initialize(true); + + if (row.type !== "group") { + onlyGroupHeaders = false; + } + }); + + if (onlyGroupHeaders) { + element.style.minWidth = this.table.columnManager.getWidth() + "px"; + } else { + element.style.minWidth = ""; + } + } }]); return GroupRows; @@ -19613,7 +19675,7 @@ var index, rows; if (this.table.options.groupBy) { - rows = row.getComponent().getGroup().rows; + rows = row.getComponent().getGroup()._getSelf().rows; index = rows.indexOf(row); if (index) { @@ -20372,11 +20434,11 @@ if (document.selection) { // IE range = document.body.createTextRange(); - range.moveToElementText(this.element); + range.moveToElementText(cell.getElement()); range.select(); } else if (window.getSelection) { range = document.createRange(); - range.selectNode(this.element); + range.selectNode(cell.getElement()); window.getSelection().removeAllRanges(); window.getSelection().addRange(range); } @@ -25207,6 +25269,7 @@ this.subscribe("table-redrawing", this.tableRedraw.bind(this)); if (this.table.options.responsiveLayout === "collapse") { + 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)); } diff --git a/dist/js/tabulator.js.map b/dist/js/tabulator.js.map index 5b3495b02..31d2f9af1 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(){\r\n\t\treturn this.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\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\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\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\t\t\t\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\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\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = this.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\tthis.moveColumnActual(from, to, after);\r\n\t\t\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.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\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.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 = \"displayPipeline\";\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.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\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\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\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\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\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\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\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\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\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\t\t\t\t\t\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\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows);\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\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\t\r\n\t\treturn output;\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\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\t\trows = this.activeRows;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\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.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\r\n\t\t// clear empty table placeholder min\r\n\t\tthis.tableElement.style.minWidth = \"\";\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\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\ttargets[this.componentMap[target]] = el;\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\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = 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(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = targets[\"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\ttargets[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 targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\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\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\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\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\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\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\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\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\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.element.clientWidth; //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 = remainingSpace - (nextColWidth * changeUnits);\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(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){\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){\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(this);\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.displayIndex = 0;\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(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\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\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.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});\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\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() == \"classic\" && !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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\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() == \"classic\" && !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\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\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\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\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\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\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\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\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\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\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\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\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\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\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\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\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\r\n\t\t\tthis.groupIDLookups = [];\r\n\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\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\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\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\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\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\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\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\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\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\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\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\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\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\t\tthis.getGroupedData() : this.getData();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\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\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\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\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\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\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\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\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\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\r\n\t\treturn groupListData;\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\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\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\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\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\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\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\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\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\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\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\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}\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().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 === this){\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(this.element);\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(this.element);\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.displayIndex = 0; //index in display pipeline\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\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\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.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\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\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(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:function(){\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\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\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;","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\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}else{\r\n\t\t\t\t\tthis.table.rowManager.getRows(rows).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\r\n\t\t\t\tthis._rowSelectionChanged();\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\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\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(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}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(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","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","concat","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","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","destroyed","_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","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","traverse","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","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","getDisplayIndex","checkClassicModeGroupHeaderWidth","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","getColumns","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","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","generateCollapsedRowContent","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;EAC3B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,CAAvC;EACA;EACD;EACD;;;;IApSqB1xD;;EAuSvBowD,QAAQ,CAAC9sD,UAAT,GAAsB,UAAtB;;EAGA8sD,QAAQ,CAACoB,UAAT,GAAsBG,iBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MCzSMC;;;;;;;;;;;;IAAsB/zD;;;EAG5B,IAAIiI,YAAJ,CAAiB8rD,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\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\t\t\t\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\tthis.moveColumnActual(from, to, after);\r\n\t\t\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.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\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.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 = \"displayPipeline\";\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.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\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\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\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\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\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\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\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\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\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\t\t\t\t\t\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\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows);\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\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\t\r\n\t\treturn output;\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\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\t\trows = this.activeRows;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\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\r\n\t\t// clear empty table placeholder min\r\n\t\tthis.tableElement.style.minWidth = \"\";\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\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\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = 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(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = targets[\"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\ttargets[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 targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\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\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\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\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\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\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\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\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\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){\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){\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.displayIndex = 0;\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\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.checkBasicModeGroupHeaderWidth();\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\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.checkBasicModeGroupHeaderWidth();\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\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\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\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\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\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\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\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\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\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\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\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\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\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\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\r\n\t\t\tthis.groupIDLookups = [];\r\n\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\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\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\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\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\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\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\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\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\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\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\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\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\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\t\tthis.getGroupedData() : this.getData();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\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\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\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\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\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\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\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\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\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\r\n\t\treturn groupListData;\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\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\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\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\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\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\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\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\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\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\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\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\r\n\tcheckBasicModeGroupHeaderWidth(){\r\n\t\tvar element = this.table.rowManager.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\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\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\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 === this){\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.displayIndex = 0; //index in display pipeline\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\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\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.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\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\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(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:function(){\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\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}else{\r\n\t\t\t\t\tthis.table.rowManager.getRows(rows).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\r\n\t\t\t\tthis._rowSelectionChanged();\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\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\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(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}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(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","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","destroyed","_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","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","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","getDisplayIndex","checkBasicModeGroupHeaderWidth","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;EA2BO;EAErBC,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zDrnD,QAAAA,IAAI,CAACN,UAAL,GAAkBmF,SAAlB,CAA4BuL,MAA5B,CAAmC,2BAAnC;EACApQ,QAAAA,IAAI,CAAChD,OAAL,CAAamgF,QAAb,CAAsB91B,OAAtB,GAAgC,KAAhC;EAEAs2B,QAAAA,YAAY,GAAG,KAAKrB,YAAL,CAAkB9zE,OAAlB,CAA0BxI,IAA1B,CAAf;;EAEA,YAAG29E,YAAY,GAAG,CAAC,CAAnB,EAAqB;EACpB,eAAKrB,YAAL,CAAkB5wE,MAAlB,CAAyBiyE,YAAzB,EAAuC,CAAvC;EACA;EACD;EACD;;;;IApSqBxxD;;EAuSvBkwD,QAAQ,CAAC5sD,UAAT,GAAsB,UAAtB;;EAGA4sD,QAAQ,CAACoB,UAAT,GAAsBG,iBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MCzSMC;;;;;;;;;;;;IAAsB7zD;;;EAG5B,IAAIiI,YAAJ,CAAiB4rD,aAAjB,EAAgC7gF,OAAhC;;;;"} \ No newline at end of file diff --git a/dist/js/tabulator.min.js b/dist/js/tabulator.min.js index 07b6fdef1..8221da4b1 100644 --- a/dist/js/tabulator.min.js +++ b/dist/js/tabulator.min.js @@ -1,3 +1,3 @@ -/* Tabulator v5.3.0 (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.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.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach((function(e){e.setMaxWidth()}))}},{key:"delete",value:function(){var e=this;return new Promise((function(t,i){e.isGroup&&e.columns.forEach((function(e){e.delete()})),e.dispatch("column-delete",e);for(var n=e.cells.length,o=0;o-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.columns.forEach((function(e){e.clearVerticalAlign()})),this.columns.forEach((function(e){var i=e.getHeight();i>t&&(t=i)})),this.columns.forEach((function(i){i.verticalAlign(e.table.options.columnHeaderVertAlign,t)})),this.table.rowManager.adjustTableSize())}},{key:"findColumn",value:function(t){return"object"!=e(t)?this.columnsByField[t]||!1:t instanceof w?t:t instanceof g?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&this.columns.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){this.moveColumnActual(e,t,i),t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),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("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;this.redrawBlock?(!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]]=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=p(o);try{var l=function(){var e=i.value,o=void 0,r=t[e],l=n.previousTargets[e];if(l&&l.target===r)o=l.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()===r})),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(r));break;case"cell":a.components.includes("cell")&&(t.row instanceof L?o=t.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?"))}o&&(t[e]=o,s[e]={target:r,component:o})};for(r.s();!(i=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}return this.previousTargets=s,t}},{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:"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.element.clientWidth,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)),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.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.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:"setDisplayIndex",value:function(e){this.displayIndex=e}},{key:"getDisplayIndex",value:function(){return this.displayIndex}},{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.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))}))}}},{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()},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,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}},{key:"show",value:function(){if(this.visible=!0,"classic"!=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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}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){var i=this.getGroups(!1)[0];return t.push(i.getRows(!1)[0]),t}},{key:"virtualRenderFill",value:function(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();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){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){!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){e.modules.group&&e.modules.group.removeRow(e)}},{key:"rowsUpdated",value:function(e){this.updateGroupRows(!0)}},{key:"cellUpdated",value:function(e){this.reassignRowToGroup(e.row)}},{key:"setDisplayIndex",value:function(e){this.displayIndex=e}},{key:"getDisplayIndex",value:function(){return this.displayIndex}},{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.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){"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))}}]),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().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.displayIndex=0,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.table.rowManager.getDisplayRows(this.displayIndex-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;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e),n=t[e];i&&Object.defineProperty(t,e,{set:function(e){n=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:function(){return i.get&&i.get(),n}})})),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-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.table.rowManager.getRows(t).forEach((function(e){n._selectRow(e,!0,!0)})),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.length-1&&(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("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.1 (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.columns.forEach((function(e){e.clearVerticalAlign()})),this.columns.forEach((function(e){var i=e.getHeight();i>t&&(t=i)})),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){this.moveColumnActual(e,t,i),t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),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("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;this.redrawBlock?(!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=p(o);try{var l=function(){var e=i.value,o=void 0,r=t[e],l=n.previousTargets[e];if(l&&l.target===r)o=l.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()===r})),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(r));break;case"cell":a.components.includes("cell")&&(t.row instanceof L?o=t.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?"))}o&&(t[e]=o,s[e]={target:r,component:o})};for(r.s();!(i=r.n()).done;)l()}catch(e){r.e(e)}finally{r.f()}return this.previousTargets=s,t}},{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:"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.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.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:"setDisplayIndex",value:function(e){this.displayIndex=e}},{key:"getDisplayIndex",value:function(){return this.displayIndex}},{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.groupManager.updateGroupRows(!0):(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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.checkBasicModeGroupHeaderWidth()),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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.checkBasicModeGroupHeaderWidth()}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){var i=this.getGroups(!1)[0];return t.push(i.getRows(!1)[0]),t}},{key:"virtualRenderFill",value:function(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();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){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){!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){e.modules.group&&e.modules.group.removeRow(e)}},{key:"rowsUpdated",value:function(e){this.updateGroupRows(!0)}},{key:"cellUpdated",value:function(e){this.reassignRowToGroup(e.row)}},{key:"setDisplayIndex",value:function(e){this.displayIndex=e}},{key:"getDisplayIndex",value:function(){return this.displayIndex}},{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.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){"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.displayIndex=0,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.table.rowManager.getDisplayRows(this.displayIndex-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;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((function(e){var i=Object.getOwnPropertyDescriptor(t,e),n=t[e];i&&Object.defineProperty(t,e,{set:function(e){n=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:function(){return i.get&&i.get(),n}})})),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.table.rowManager.getRows(t).forEach((function(e){n._selectRow(e,!0,!0)})),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.length-1&&(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("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 bcb363665..63a13e961 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(){\r\n\t\treturn this.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\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\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\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\t\t\t\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\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\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = this.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\tthis.moveColumnActual(from, to, after);\r\n\t\t\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.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\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.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 = \"displayPipeline\";\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.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\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\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\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\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\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\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\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\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\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\t\t\t\t\t\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\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows);\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\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\t\r\n\t\treturn output;\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\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\t\trows = this.activeRows;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\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.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\r\n\t\t// clear empty table placeholder min\r\n\t\tthis.tableElement.style.minWidth = \"\";\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\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\ttargets[this.componentMap[target]] = el;\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\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = 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(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = targets[\"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\ttargets[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 targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\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\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\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\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\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\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\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\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\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.element.clientWidth; //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 = remainingSpace - (nextColWidth * changeUnits);\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(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){\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){\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(this);\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.displayIndex = 0;\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(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\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\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.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});\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\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() == \"classic\" && !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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\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() == \"classic\" && !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\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\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\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\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\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\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\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\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\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\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\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\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\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\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\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\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\r\n\t\t\tthis.groupIDLookups = [];\r\n\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\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\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\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\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\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\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\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\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\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\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\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\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\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\t\tthis.getGroupedData() : this.getData();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\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\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\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\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\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\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\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\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\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\r\n\t\treturn groupListData;\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\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\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\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\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\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\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\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\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\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\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\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}\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().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 === this){\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(this.element);\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(this.element);\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.displayIndex = 0; //index in display pipeline\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\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\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.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\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\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(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:function(){\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\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\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;","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\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}else{\r\n\t\t\t\t\tthis.table.rowManager.getRows(rows).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\r\n\t\t\t\tthis._rowSelectionChanged();\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\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\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(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}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(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","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","concat","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","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","destroyed","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","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","traverse","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","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","getDisplayIndex","checkClassicModeGroupHeaderWidth","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","getColumns","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","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","generateCollapsedRowContent","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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AAWl/E,SAAQ,SAACyP,GACfA,EAAK8e,KAAK5oB,KAAKi0C,EAAM35C,EAAKE,eAAgB3B,EAAOiR,EAAKuZ,SACzDm2D,EAAiBj/E,KAAK,CACrBf,KAAKsQ,EAAKtQ,KACVk+E,WAAW5tE,EAAKuZ,YAMhB/oB,EAAKhD,QAAQ2hF,WAChB3+E,EAAKhD,QAAQ2hF,SAAW,IAGrBO,EAAiBz+E,QAQpBT,EAAKhD,QAAQ2hF,SAAS30B,QAAUk1B,EAES,WAAtCtiF,KAAKJ,MAAM8B,QAAQ2gD,gBACrBj/C,EAAKN,aAAakF,UAAUC,IAAI,8BAGb,GAAjBs6E,QACGrB,aAAa79E,KAAKD,KAdxBA,EAAKhD,QAAQ2hF,SAAS30B,SAAU,EAChChqD,EAAKN,aAAakF,UAAUkM,OAAO,6BAEhCquE,GAAgB,QACbrB,aAAa9xE,OAAOmzE,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,SAAS30B,UAEjDhqD,EAAKN,aAAakF,UAAUkM,OAAO,6BACnC9Q,EAAKhD,QAAQ2hF,SAAS30B,SAAU,GAEhCm1B,EAAeviF,KAAKkhF,aAAan1E,QAAQ3I,KAEtB,QACb89E,aAAa9xE,OAAOmzE,EAAc,WAjSpBhxD,GAuSvB0vD,GAASpsD,WAAa,WAGtBosD,GAASoB,WAAaG,grBCzShBC,iGAAsBtzD,UAG5B,IAAIgI,EAAasrD,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\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\t\t\t\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\tthis.moveColumnActual(from, to, after);\r\n\t\t\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.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\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.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 = \"displayPipeline\";\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.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\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\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\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\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\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\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\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\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\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\t\t\t\t\t\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\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows);\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\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\t\r\n\t\treturn output;\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\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\t\trows = this.activeRows;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\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\r\n\t\t// clear empty table placeholder min\r\n\t\tthis.tableElement.style.minWidth = \"\";\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\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\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = 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(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = targets[\"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\ttargets[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 targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\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\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\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\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\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\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\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\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\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){\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){\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.displayIndex = 0;\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\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.checkBasicModeGroupHeaderWidth();\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\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.checkBasicModeGroupHeaderWidth();\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\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\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\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\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\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\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\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\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\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\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\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\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\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\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\r\n\t\t\tthis.groupIDLookups = [];\r\n\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\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\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\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\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\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\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\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\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\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\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\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\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\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\t\tthis.getGroupedData() : this.getData();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\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\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\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\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\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\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\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\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\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\r\n\t\treturn groupListData;\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\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\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\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\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\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\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\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\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\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\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\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\r\n\tcheckBasicModeGroupHeaderWidth(){\r\n\t\tvar element = this.table.rowManager.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\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\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\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 === this){\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.displayIndex = 0; //index in display pipeline\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\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\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.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\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\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(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:function(){\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\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}else{\r\n\t\t\t\t\tthis.table.rowManager.getRows(rows).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\r\n\t\t\t\tthis._rowSelectionChanged();\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\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\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(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}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(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","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","destroyed","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","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","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","getDisplayIndex","checkBasicModeGroupHeaderWidth","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,O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Bf,KAAKyQ,EAAKzQ,KACVk+E,WAAWztE,EAAKsZ,YAMhBjpB,EAAKhD,QAAQ2hF,WAChB3+E,EAAKhD,QAAQ2hF,SAAW,IAGrBO,EAAiBz+E,QAQpBT,EAAKhD,QAAQ2hF,SAAS10B,QAAUi1B,EAES,WAAtCtiF,KAAKJ,MAAM8B,QAAQ4gD,gBACrBl/C,EAAKN,aAAakF,UAAUC,IAAI,8BAGb,GAAjBs6E,QACGrB,aAAa79E,KAAKD,KAdxBA,EAAKhD,QAAQ2hF,SAAS10B,SAAU,EAChCjqD,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,SAAS10B,UAEjDjqD,EAAKN,aAAakF,UAAUqM,OAAO,6BACnCjR,EAAKhD,QAAQ2hF,SAAS10B,SAAU,GAEhCk1B,EAAeviF,KAAKkhF,aAAan1E,QAAQ3I,KAEtB,QACb89E,aAAa3xE,OAAOgzE,EAAc,WAjSpB9wD,GAuSvBwvD,GAASlsD,WAAa,WAGtBksD,GAASoB,WAAaG,grBCzShBC,iGAAsBpzD,UAG5B,IAAIgI,EAAaorD,GAAeriF"} \ No newline at end of file diff --git a/dist/js/tabulator_esm.js b/dist/js/tabulator_esm.js index ef4c295ec..c6fab714a 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.1 (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 bcc427238..120b28d5f 100644 --- a/dist/js/tabulator_esm.min.js +++ b/dist/js/tabulator_esm.min.js @@ -1,3 +1,3 @@ -/* Tabulator v5.3.0 (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}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-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.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}setMaxWidth(e){this.maxWidth=e,this.maxWidthStyled=e?e+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach((function(e){e.setMaxWidth()}))}delete(){return new Promise(((e,t)=>{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.displayIndex=0,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,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))}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}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.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))}))}}_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 D{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class S{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 S(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),s.push(new D("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 S(e.key,e.getComponent(),t.length,1));break;case"calc":case"row":t.forEach((e=>{n.push(new S(e._column.getFieldValue(o),e,1,1))})),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=e.modules.dataTree.index)}i.push(new D(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()},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 O 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)}))}}_.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,"classic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination?this.groupManager.updateGroupRows(!0):(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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"classic"!=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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth()}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){var i=this.getGroups(!1)[0];return t.push(i.getRows(!1)[0]),t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();t=t.filter((e=>"group"!==e.type)),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}rowAddingIndex(e,t,i){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){!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){e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.updateGroupRows(!0)}cellUpdated(e){this.reassignRowToGroup(e.row)}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}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.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){"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))}}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().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!==this){e.preventDefault();try{document.selection?((i=document.body.createTextRange()).moveToElementText(this.element),i.select()):window.getSelection&&((i=document.createRange()).selectNode(this.element),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.displayIndex=0,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")}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}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.table.rowManager.getDisplayRows(this.displayIndex-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:function(e){s=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:function(){return 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-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.table.rowManager.getRows(e).forEach((e=>{this._selectRow(e,!0,!0)})),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.length-1&&(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("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:O,FrozenRowsModule:_,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.columns.forEach((e=>{e.clearVerticalAlign()})),this.columns.forEach((t=>{var i=t.getHeight();i>e&&(e=i)})),this.columns.forEach((t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)})),this.table.rowManager.adjustTableSize())}findColumn(e){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 this.columns.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){this.moveColumnActual(e,t,i),t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),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("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;this.redrawBlock?(!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}getNextDisplayIndex(){return this.displayRows.length}setDisplayRows(e,t){var i=!0;return t&&void 0!==this.displayRows[t]?(this.displayRows[t]=e,i=!0):(this.displayRows.push(e),i=t=this.displayRows.length-1),t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length),i}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;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default: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.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.tableElement.style.minWidth="",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)}_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]]=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={};for(let e of i){let i,n=t[e],r=this.previousTargets[e];if(r&&r.target===n)i=r.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()===n)),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(n));break;case"cell":s.components.includes("cell")&&(t.row instanceof w?i=t.row.findCell(n):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&&(t[e]=i,o[e]={target:n,component:i})}return this.previousTargets=o,t}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 De{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 Se{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.element.clientWidth,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)),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 Oe 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(Oe.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)}))}}Oe.moduleName="localize",Oe.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 _e 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)}}_e.moduleName="comms";var Be=Object.freeze({__proto__:null,LayoutModule:Ae,LocalizeModule:Oe,CommsModule:_e});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 De(this,this.options,this.options.debugEventsExternal),this.eventBus=new Se(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.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.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,O as FrozenColumnsModule,_ 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.1 (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}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.displayIndex=0,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))}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}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 k={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 L extends s{constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.editors=L.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)}}L.moduleName="edit",L.editors=k;class D{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class S{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 S(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),s.push(new D("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 S(e.key,e.getComponent(),t.length,1));break;case"calc":case"row":t.forEach((e=>{n.push(new S(e._column.getFieldValue(o),e,1,1))})),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=e.modules.dataTree.index)}i.push(new D(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 O 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)}))}}_.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.groupManager.updateGroupRows(!0):(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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.checkBasicModeGroupHeaderWidth()),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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(),this.groupManager.getDisplayIndex()),this.groupManager.checkBasicModeGroupHeaderWidth()}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){var i=this.getGroups(!1)[0];return t.push(i.getRows(!1)[0]),t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();t=t.filter((e=>"group"!==e.type)),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}rowAddingIndex(e,t,i){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){!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){e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.updateGroupRows(!0)}cellUpdated(e){this.reassignRowToGroup(e.row)}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}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.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){"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!==this){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.displayIndex=0,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")}setDisplayIndex(e){this.displayIndex=e}getDisplayIndex(){return this.displayIndex}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.table.rowManager.getDisplayRows(this.displayIndex-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:function(e){s=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:function(){return 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.table.rowManager.getRows(e).forEach((e=>{this._selectRow(e,!0,!0)})),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.length-1&&(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("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:L,ExportModule:P,FilterModule:F,FormatModule:A,FrozenColumnsModule:O,FrozenRowsModule:_,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.columns.forEach((e=>{e.clearVerticalAlign()})),this.columns.forEach((t=>{var i=t.getHeight();i>e&&(e=i)})),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){this.moveColumnActual(e,t,i),t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),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("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;this.redrawBlock?(!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}getNextDisplayIndex(){return this.displayRows.length}setDisplayRows(e,t){var i=!0;return t&&void 0!==this.displayRows[t]?(this.displayRows[t]=e,i=!0):(this.displayRows.push(e),i=t=this.displayRows.length-1),t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length),i}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;switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default: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.tableElement.style.minWidth="",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)}_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={};for(let e of i){let i,n=t[e],r=this.previousTargets[e];if(r&&r.target===n)i=r.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()===n)),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(n));break;case"cell":s.components.includes("cell")&&(t.row instanceof w?i=t.row.findCell(n):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&&(t[e]=i,o[e]={target:n,component:i})}return this.previousTargets=o,t}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 ke{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 Le 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 De{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 Se{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 Oe 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(Oe.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)}))}}Oe.moduleName="localize",Oe.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 _e 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)}}_e.moduleName="comms";var Be=Object.freeze({__proto__:null,LayoutModule:Ae,LocalizeModule:Oe,CommsModule:_e});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 ke(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 Le(this),this.alertManager=new Ve(this),this.bindModules(),this.options=this.optionsList.generate(Ne.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new De(this,this.options,this.options.debugEventsExternal),this.eventBus=new Se(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.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.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,L as EditModule,P as ExportModule,F as FilterModule,A as FormatModule,O as FrozenColumnsModule,_ 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 5c03e788a..bc53852b9 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\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\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\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\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\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\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\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\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(){\r\n\t\treturn this.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\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\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(this);\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.displayIndex = 0;\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(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\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\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.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});\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\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() == \"classic\" && !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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\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() == \"classic\" && !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\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.checkClassicModeGroupHeaderWidth();\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\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\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\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\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\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\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\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\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\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\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\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\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\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\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\r\n\t\t\tthis.groupIDLookups = [];\r\n\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\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\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\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\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\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\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\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\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\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\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\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\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\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\t\tthis.getGroupedData() : this.getData();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\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\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\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\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\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\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\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\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\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\r\n\t\treturn groupListData;\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\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\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\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\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\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\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\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\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\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\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\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}\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().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 === this){\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(this.element);\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(this.element);\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.displayIndex = 0; //index in display pipeline\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\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\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.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\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\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(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:function(){\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\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\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;","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\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}else{\r\n\t\t\t\t\tthis.table.rowManager.getRows(rows).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\r\n\t\t\t\tthis._rowSelectionChanged();\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\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\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(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}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(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\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\t\t\t\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\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\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = this.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\tthis.moveColumnActual(from, to, after);\r\n\t\t\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.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\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.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 = \"displayPipeline\";\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.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\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\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\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\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\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\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\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\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\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\t\t\t\t\t\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\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows);\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\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\t\r\n\t\treturn output;\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\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\t\trows = this.activeRows;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\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.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\r\n\t\t// clear empty table placeholder min\r\n\t\tthis.tableElement.style.minWidth = \"\";\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\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\ttargets[this.componentMap[target]] = el;\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\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = 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(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = targets[\"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\ttargets[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 targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\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.element.clientWidth; //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 = remainingSpace - (nextColWidth * changeUnits);\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(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){\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){\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","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","length","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","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","index","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","getDisplayRows","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","activeRows","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","displayIndex","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","displayRows","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","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","setDisplayRows","getDisplayIndex","checkClassicModeGroupHeaderWidth","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","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","getColumns","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","layoutMode","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","responsive","order","generateCollapsedContent","generateCollapsedRowContent","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","adjust","scrollToColumnPosition","scrollToColumnIfVisible","generateCell","totalWidth","fixedWidth","resetScroll","BasicVertical","onlyGroupHeaders","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","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","_setDataActual","generateColumnsFromRowData","_wipeElements","allIndex","activeIndex","setActiveRows","displayRowIterator","regenerateRowPositions","findAddRowPos","_clearPlaceholder","addRowPos","chainResult","findRowIndex","rowOnly","skipStage","stage","cascadeOrder","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","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,OAAOE,KAAKD,MAAMQ,QAAQM,MAAMC,kBAAkBJ,WAGnDZ,YACC,OAAOE,KAAKD,MAAMQ,QAAQM,MAAME,QAAQL,WAOzCZ,aACC,OAAOE,KAAKD,MAAMQ,QAAQS,OAAOC,UAGlCnB,cAAcoB,GACb,OAAOlB,KAAKD,MAAMQ,QAAQS,OAAOA,OAAOE,GAQzCpB,YACC,OAAOE,KAAKD,MAAMoB,SAASC,aAAaV,WAGzCZ,cACC,OAAOE,KAAKD,MAAMoB,SAASE,eAAeX,WAG3CZ,WAAWwB,GACV,OAAOtB,KAAKD,MAAMoB,SAASI,WAAWD,GAGvCxB,qBACC,OAAOE,KAAKD,MAAMoB,SAASK,sBAAsBd,WAGlDZ,WACC,OAAOE,KAAKD,MAAMoB,SAASM,YAAYf,WAGxCZ,QACC,OAAOE,KAAKD,MAAMoB,SAASO,SAAShB,WA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OAEhC,OADApU,EAAG6C,UAAUC,IAAI,iBACV9C,EAGRzC,aACC,OAAOE,KAAKwE,QAGb1E,eACC,OAAO,EAGRA,UACC,MAAO,GAGRA,YACC,OAAOE,KAAKwE,QAAQsc,YAGrBhhB,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\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\r\n\t\tthis._handler = null;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\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\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\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\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\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\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\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\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\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.displayIndex = 0;\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\tsetDisplayIndex (index) {\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex () {\r\n\t\treturn this.displayIndex;\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.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.checkBasicModeGroupHeaderWidth();\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\t\t\t\r\n\t\t\tthis.groupManager.table.rowManager.setDisplayRows(this.groupManager.updateGroupRows(), this.groupManager.getDisplayIndex());\r\n\t\t\t\r\n\t\t\tthis.groupManager.checkBasicModeGroupHeaderWidth();\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\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\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\tthis.displayIndex = 0; //index in display pipeline\r\n\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\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\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\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\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\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\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\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\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\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\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\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\r\n\t\t\tthis.groupIDLookups = [];\r\n\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\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\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\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\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\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\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\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\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\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\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\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\r\n\trowSample(rows, prevValue){\r\n\t\tvar group = this.getGroups(false)[0];\r\n\r\n\t\tprevValue.push(group.getRows(false)[0]);\r\n\r\n\t\treturn prevValue;\r\n\t}\r\n\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\treturn row.type !== \"group\";\r\n\t\t});\r\n\r\n\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\r\n\t\t// if(this.table.options.groupBy){\r\n\t\t// \tif(this.layoutMode() != \"fitDataFill\" && rowsCount == this.table.modules.groupRows.countGroups()){\r\n\t\t// \t\tel.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\trowAddingIndex(row, index, top){\r\n\t\tthis.assignRowToGroup(row);\r\n\r\n\t\tvar groupRows = row.modules.group.rows;\r\n\r\n\t\tif(groupRows.length > 1){\r\n\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\tif(top){\r\n\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn index;\r\n\t}\r\n\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\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\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\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\t\tthis.getGroupedData() : this.getData();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\trowMoving(from, to, after){\r\n\t\tif(!after && to instanceof Group){\r\n\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t}\r\n\r\n\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\r\n\t\tif(toGroup === fromGroup){\r\n\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t}else{\r\n\t\t\tif(fromGroup){\r\n\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t}\r\n\r\n\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trowsUpdated(row){\r\n\t\tthis.updateGroupRows(true);\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.reassignRowToGroup(cell.row);\r\n\t}\r\n\r\n\r\n\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\r\n\t}\r\n\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\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\r\n\t\t\tthis.generateGroups(rows);\r\n\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\r\n\t\t\treturn this.updateGroupRows();\r\n\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\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\r\n\t\treturn groupComponents;\r\n\t}\r\n\r\n\twipe(){\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroup.wipe();\r\n\t\t});\r\n\t}\r\n\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\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\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\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\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\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\r\n\t\treturn groupListData;\r\n\t}\r\n\r\n\tgetGroupedData(){\r\n\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\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\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\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\r\n\t\toldGroups = oldGroups || [];\r\n\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\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\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\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\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\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\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\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\r\n\t\treturn groupPath;\r\n\t}\r\n\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t}\r\n\r\n\t\tleft = left + \"px\";\r\n\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tgroup.scrollHeader(left);\r\n\t\t});\r\n\t}\r\n\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\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\r\n\tcheckBasicModeGroupHeaderWidth(){\r\n\t\tvar element = this.table.rowManager.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\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\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\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 === this){\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.displayIndex = 0; //index in display pipeline\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\tsetDisplayIndex(index){\r\n\t\tthis.displayIndex = index;\r\n\t}\r\n\t\r\n\tgetDisplayIndex(){\r\n\t\treturn this.displayIndex;\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.table.rowManager.getDisplayRows(this.displayIndex - 1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\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\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: function(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:function(){\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\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}else{\r\n\t\t\t\t\tthis.table.rowManager.getRows(rows).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\r\n\t\t\t\tthis._rowSelectionChanged();\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\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\tif(match != sorters.length -1){\r\n\t\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\t\tsorters.push(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}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(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\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\t\t\t\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\tthis.moveColumnActual(from, to, after);\r\n\t\t\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.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\t\r\n\t\tif(typeof handler === \"function\"){\r\n\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === handler;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\r\n\t\t\t\tif(skipStage){\r\n\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.displayPipeline.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 = \"displayPipeline\";\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.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"end\";\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\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\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\tstage = handler || \"all\";\r\n\t\t\tindex = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.redrawBlock){\r\n\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\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\thandler: handler,\r\n\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\tstage:stage,\r\n\t\t\t\t\tindex:index,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}else{\r\n\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\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\t\r\n\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-refreshed\");\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\t\t\t\t\t\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\tgetNextDisplayIndex(){\r\n\t\treturn this.displayRows.length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\t\r\n\t\tvar output = true;\r\n\t\t\r\n\t\tif(index && typeof this.displayRows[index] != \"undefined\"){\r\n\t\t\tthis.displayRows[index] = displayRows;\r\n\t\t\toutput = true;\r\n\t\t}else{\r\n\t\t\tthis.displayRows.push(displayRows);\r\n\t\t\toutput = index = this.displayRows.length -1;\r\n\t\t}\r\n\t\t\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\t\r\n\t\treturn output;\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\t\t\r\n\t\tswitch(type){\r\n\t\t\tcase \"active\":\r\n\t\t\t\trows = this.activeRows;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"visible\":\r\n\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\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\r\n\t\t// clear empty table placeholder min\r\n\t\tthis.tableElement.style.minWidth = \"\";\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\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\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component;\r\n\t\t\tlet target = targets[key];\r\n\t\t\tlet previousTarget = 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(targets[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = targets[\"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\ttargets[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 targets;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\t\t\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){\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){\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","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","length","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","index","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","getDisplayRows","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","activeRows","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","displayIndex","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","displayRows","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","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","setDisplayRows","getDisplayIndex","checkBasicModeGroupHeaderWidth","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","adjust","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","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","_setDataActual","generateColumnsFromRowData","_wipeElements","allIndex","activeIndex","setActiveRows","displayRowIterator","regenerateRowPositions","findAddRowPos","_clearPlaceholder","addRowPos","chainResult","findRowIndex","rowOnly","skipStage","stage","cascadeOrder","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","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,OAAOE,KAAKD,MAAMQ,QAAQM,MAAMC,kBAAkBJ,WAGnDZ,YACC,OAAOE,KAAKD,MAAMQ,QAAQM,MAAME,QAAQL,WAOzCZ,aACC,OAAOE,KAAKD,MAAMQ,QAAQS,OAAOC,UAGlCnB,cAAcoB,GACb,OAAOlB,KAAKD,MAAMQ,QAAQS,OAAOA,OAAOE,GAQzCpB,YACC,OAAOE,KAAKD,MAAMoB,SAASC,aAAaV,WAGzCZ,cACC,OAAOE,KAAKD,MAAMoB,SAASE,eAAeX,WAG3CZ,WAAWwB,GACV,OAAOtB,KAAKD,MAAMoB,SAASI,WAAWD,GAGvCxB,qBACC,OAAOE,KAAKD,MAAMoB,SAASK,sBAAsBd,WAGlDZ,WACC,OAAOE,KAAKD,MAAMoB,SAASM,YAAYf,WAGxCZ,QACC,OAAOE,KAAKD,MAAMoB,SAASO,S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IAAI,iBACV9C,EAGRzC,aACC,OAAOE,KAAKwE,QAGb1E,eACC,OAAO,EAGRA,UACC,MAAO,GAGRA,YACC,OAAOE,KAAKwE,QAAQuc,YAGrBjhB,cAEAA,gBAEAA,mBAEAA,iBAEAA,sBAEAA,cAEAA,iBAEAA"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c5ac9e01f..e0ddb28bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tabulator-tables", - "version": "5.3.0", + "version": "5.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 92595d3b2..661a0ff89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tabulator-tables", - "version": "5.3.0", + "version": "5.3.1", "description": "Interactive table generation JavaScript library", "style": "dist/css/tabulator.css", "main": "dist/js/tabulator.js",