{"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{\n\n\tconstructor(table){\n\t\tthis.table = table;\n\t}\n\n\t//////////////////////////////////////////\n\t/////////////// DataLoad /////////////////\n\t//////////////////////////////////////////\n\n\treloadData(data, silent, columnsChanged){\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\n\t}\n\n\t//////////////////////////////////////////\n\t///////////// Localization ///////////////\n\t//////////////////////////////////////////\n\n\tlangText(){\n\t\treturn this.table.modules.localize.getText(...arguments);\n\t}\n\n\tlangBind(){\n\t\treturn this.table.modules.localize.bind(...arguments);\n\t}\n\n\tlangLocale(){\n\t\treturn this.table.modules.localize.getLocale(...arguments);\n\t}\n\n\n\t//////////////////////////////////////////\n\t////////// Inter Table Comms /////////////\n\t//////////////////////////////////////////\n\n\tcommsConnections(){\n\t\treturn this.table.modules.comms.getConnections(...arguments);\n\t}\n\n\tcommsSend(){\n\t\treturn this.table.modules.comms.send(...arguments);\n\t}\n\n\t//////////////////////////////////////////\n\t//////////////// Layout /////////////////\n\t//////////////////////////////////////////\n\n\tlayoutMode(){\n\t\treturn this.table.modules.layout.getMode();\n\t}\n\n\tlayoutRefresh(force){\n\t\treturn this.table.modules.layout.layout(force);\n\t}\n\n\n\t//////////////////////////////////////////\n\t/////////////// Event Bus ////////////////\n\t//////////////////////////////////////////\n\n\tsubscribe(){\n\t\treturn this.table.eventBus.subscribe(...arguments);\n\t}\n\n\tunsubscribe(){\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\n\t}\n\n\tsubscribed(key){\n\t\treturn this.table.eventBus.subscribed(key);\n\t}\n\n\tsubscriptionChange(){\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\n\t}\n\n\tdispatch(){\n\t\treturn this.table.eventBus.dispatch(...arguments);\n\t}\n\n\tchain(){\n\t\treturn this.table.eventBus.chain(...arguments);\n\t}\n\n\tconfirm(){\n\t\treturn this.table.eventBus.confirm(...arguments);\n\t}\n\n\tdispatchExternal(){\n\t\treturn this.table.externalEvents.dispatch(...arguments);\n\t}\n\n\tsubscribedExternal(key){\n\t\treturn this.table.externalEvents.subscribed(key);\n\t}\n\n\tsubscriptionChangeExternal(){\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\n\t}\n\n\t//////////////////////////////////////////\n\t//////////////// Options /////////////////\n\t//////////////////////////////////////////\n\n\toptions(key){\n\t\treturn this.table.options[key];\n\t}\n\n\tsetOption(key, value){\n\t\tif(typeof value !== \"undefined\"){\n\t\t\tthis.table.options[key] = value;\n\t\t}\n\n\t\treturn this.table.options[key];\n\t}\n\n\t//////////////////////////////////////////\n\t/////////// Deprecation Checks ///////////\n\t//////////////////////////////////////////\n\n\tdeprecationCheck(oldOption, newOption){\n\t\treturn this.table.deprecationAdvisor.check(oldOption, newOption);\n\t}\n\n\tdeprecationCheckMsg(oldOption, msg){\n\t\treturn this.table.deprecationAdvisor.checkMsg(oldOption, msg);\n\t}\n\n\tdeprecationMsg(msg){\n\t\treturn this.table.deprecationAdvisor.msg(msg);\n\t}\n\t//////////////////////////////////////////\n\t//////////////// Modules /////////////////\n\t//////////////////////////////////////////\n\n\tmodule(key){\n\t\treturn this.table.module(key);\n\t}\n}","import Column from './Column.js';\n\n//public column object\nexport default class ColumnComponent {\n\tconstructor (column){\n\t\tthis._column = column;\n\t\tthis.type = \"ColumnComponent\";\n\n\t\treturn new Proxy(this, {\n\t\t\tget: function(target, name, receiver) {\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\n\t\t\t\t\treturn target[name];\n\t\t\t\t}else{\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tgetElement(){\n\t\treturn this._column.getElement();\n\t}\n\n\tgetDefinition(){\n\t\treturn this._column.getDefinition();\n\t}\n\n\tgetField(){\n\t\treturn this._column.getField();\n\t}\n\n\tgetTitleDownload() {\n\t\treturn this._column.getTitleDownload();\n\t}\n\n\tgetCells(){\n\t\tvar cells = [];\n\n\t\tthis._column.cells.forEach(function(cell){\n\t\t\tcells.push(cell.getComponent());\n\t\t});\n\n\t\treturn cells;\n\t}\n\n\tisVisible(){\n\t\treturn this._column.visible;\n\t}\n\n\tshow(){\n\t\tif(this._column.isGroup){\n\t\t\tthis._column.columns.forEach(function(column){\n\t\t\t\tcolumn.show();\n\t\t\t});\n\t\t}else{\n\t\t\tthis._column.show();\n\t\t}\n\t}\n\n\thide(){\n\t\tif(this._column.isGroup){\n\t\t\tthis._column.columns.forEach(function(column){\n\t\t\t\tcolumn.hide();\n\t\t\t});\n\t\t}else{\n\t\t\tthis._column.hide();\n\t\t}\n\t}\n\n\ttoggle(){\n\t\tif(this._column.visible){\n\t\t\tthis.hide();\n\t\t}else{\n\t\t\tthis.show();\n\t\t}\n\t}\n\n\tdelete(){\n\t\treturn this._column.delete();\n\t}\n\n\tgetSubColumns(){\n\t\tvar output = [];\n\n\t\tif(this._column.columns.length){\n\t\t\tthis._column.columns.forEach(function(column){\n\t\t\t\toutput.push(column.getComponent());\n\t\t\t});\n\t\t}\n\n\t\treturn output;\n\t}\n\n\tgetParentColumn(){\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\n\t}\n\n\t_getSelf(){\n\t\treturn this._column;\n\t}\n\n\tscrollTo(){\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\n\t}\n\n\tgetTable(){\n\t\treturn this._column.table;\n\t}\n\n\tmove(to, after){\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\n\n\t\tif(toColumn){\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after);\n\t\t}else{\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\n\t\t}\n\t}\n\n\tgetNextColumn(){\n\t\tvar nextCol = this._column.nextColumn();\n\n\t\treturn nextCol ? nextCol.getComponent() : false;\n\t}\n\n\tgetPrevColumn(){\n\t\tvar prevCol = this._column.prevColumn();\n\n\t\treturn prevCol ? prevCol.getComponent() : false;\n\t}\n\n\tupdateDefinition(updates){\n\t\treturn this._column.updateDefinition(updates);\n\t}\n\n\tgetWidth(){\n\t\treturn this._column.getWidth();\n\t}\n\n\tsetWidth(width){\n\t\tvar result;\n\n\t\tif(width === true){\n\t\t\tresult = this._column.reinitializeWidth(true);\n\t\t}else{\n\t\t\tresult = this._column.setWidth(width);\n\t\t}\n\n\t\tthis._column.table.columnManager.rerenderColumns(true);\n\n\t\treturn result;\n\t}\n}","export default {\n\t\"title\": undefined,\n\t\"field\": undefined,\n\t\"columns\": undefined,\n\t\"visible\": undefined,\n\t\"hozAlign\": undefined,\n\t\"vertAlign\": undefined,\n\t\"width\": undefined,\n\t\"minWidth\": 40,\n\t\"maxWidth\": undefined,\n\t\"maxInitialWidth\": undefined,\n\t\"cssClass\": undefined,\n\t\"variableHeight\": undefined,\n\t\"headerVertical\": undefined,\n\t\"headerHozAlign\": undefined,\n\t\"headerWordWrap\": false,\n\t\"editableTitle\": undefined,\n};","//public cell object\nexport default class CellComponent {\n\n\tconstructor (cell){\n\t\tthis._cell = cell;\n\n\t\treturn new Proxy(this, {\n\t\t\tget: function(target, name, receiver) {\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\n\t\t\t\t\treturn target[name];\n\t\t\t\t}else{\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tgetValue(){\n\t\treturn this._cell.getValue();\n\t}\n\n\tgetOldValue(){\n\t\treturn this._cell.getOldValue();\n\t}\n\n\tgetInitialValue(){\n\t\treturn this._cell.initialValue;\n\t}\n\n\tgetElement(){\n\t\treturn this._cell.getElement();\n\t}\n\n\tgetRow(){\n\t\treturn this._cell.row.getComponent();\n\t}\n\n\tgetData(){\n\t\treturn this._cell.row.getData();\n\t}\n\n\tgetField(){\n\t\treturn this._cell.column.getField();\n\t}\n\n\tgetColumn(){\n\t\treturn this._cell.column.getComponent();\n\t}\n\n\tsetValue(value, mutate){\n\t\tif(typeof mutate == \"undefined\"){\n\t\t\tmutate = true;\n\t\t}\n\n\t\tthis._cell.setValue(value, mutate);\n\t}\n\n\trestoreOldValue(){\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\n\t}\n\n\trestoreInitialValue(){\n\t\tthis._cell.setValueActual(this._cell.initialValue);\n\t}\n\n\tcheckHeight(){\n\t\tthis._cell.checkHeight();\n\t}\n\n\tgetTable(){\n\t\treturn this._cell.table;\n\t}\n\n\t_getSelf(){\n\t\treturn this._cell;\n\t}\n}","import CoreFeature from '../CoreFeature.js';\nimport CellComponent from './CellComponent.js';\n\nexport default class Cell extends CoreFeature{\n\tconstructor(column, row){\n\t\tsuper(column.table);\n\n\t\tthis.table = column.table;\n\t\tthis.column = column;\n\t\tthis.row = row;\n\t\tthis.element = null;\n\t\tthis.value = null;\n\t\tthis.initialValue;\n\t\tthis.oldValue = null;\n\t\tthis.modules = {};\n\n\t\tthis.height = null;\n\t\tthis.width = null;\n\t\tthis.minWidth = null;\n\n\t\tthis.component = null;\n\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\n\n\t\tthis.build();\n\t}\n\n\t//////////////// Setup Functions /////////////////\n\t//generate element\n\tbuild(){\n\t\tthis.generateElement();\n\n\t\tthis.setWidth();\n\n\t\tthis._configureCell();\n\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\n\n\t\tthis.initialValue = this.value;\n\t}\n\n\tgenerateElement(){\n\t\tthis.element = document.createElement('div');\n\t\tthis.element.className = \"tabulator-cell\";\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\n\t}\n\n\t_configureCell(){\n\t\tvar element = this.element,\n\t\tfield = this.column.getField(),\n\t\tvertAligns = {\n\t\t\ttop:\"flex-start\",\n\t\t\tbottom:\"flex-end\",\n\t\t\tmiddle:\"center\",\n\t\t},\n\t\thozAligns = {\n\t\t\tleft:\"flex-start\",\n\t\t\tright:\"flex-end\",\n\t\t\tcenter:\"center\",\n\t\t};\n\n\t\t//set text alignment\n\t\telement.style.textAlign = this.column.hozAlign;\n\n\t\tif(this.column.vertAlign){\n\t\t\telement.style.display = \"inline-flex\";\n\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\n\n\t\t\tif(this.column.hozAlign){\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\n\t\t\t}\n\t\t}\n\n\t\tif(field){\n\t\t\telement.setAttribute(\"tabulator-field\", field);\n\t\t}\n\n\t\t//add class to cell if needed\n\t\tif(this.column.definition.cssClass){\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \");\n\t\t\tclassNames.forEach((className) => {\n\t\t\t\telement.classList.add(className);\n\t\t\t});\n\t\t}\n\n\t\tthis.dispatch(\"cell-init\", this);\n\n\t\t//hide cell if not visible\n\t\tif(!this.column.visible){\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\t//generate cell contents\n\t_generateContents(){\n\t\tvar val;\n\n\t\tval = this.chain(\"cell-format\", this, null, () => {\n\t\t\treturn this.element.innerHTML = this.value;\n\t\t});\n\n\t\tswitch(typeof val){\n\t\t\tcase \"object\":\n\t\t\t\tif(val instanceof Node){\n\n\t\t\t\t\t//clear previous cell contents\n\t\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\n\n\t\t\t\t\tthis.element.appendChild(val);\n\t\t\t\t}else{\n\t\t\t\t\tthis.element.innerHTML = \"\";\n\n\t\t\t\t\tif(val != null){\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);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"undefined\":\n\t\t\t\tthis.element.innerHTML = \"\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.element.innerHTML = val;\n\t\t}\n\t}\n\n\tcellRendered(){\n\t\tthis.dispatch(\"cell-rendered\", this);\n\t}\n\n\t//////////////////// Getters ////////////////////\n\tgetElement(containerOnly){\n\t\tif(!this.loaded){\n\t\t\tthis.loaded = true;\n\t\t\tif(!containerOnly){\n\t\t\t\tthis.layoutElement();\n\t\t\t}\n\t\t}\n\n\t\treturn this.element;\n\t}\n\n\tgetValue(){\n\t\treturn this.value;\n\t}\n\n\tgetOldValue(){\n\t\treturn this.oldValue;\n\t}\n\n\t//////////////////// Actions ////////////////////\n\tsetValue(value, mutate, force){\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\n\n\t\tif(changed){\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\n\n\t\t\tthis.cellRendered();\n\n\t\t\tif(this.column.definition.cellEdited){\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\n\t\t\t}\n\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\n\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\n\t\t\t}\n\t\t}\n\t}\n\n\tsetValueProcessData(value, mutate, force){\n\t\tvar changed = false;\n\n\t\tif(this.value !== value || force){\n\n\t\t\tchanged = true;\n\n\t\t\tif(mutate){\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\n\t\t\t}\n\t\t}\n\n\t\tthis.setValueActual(value);\n\n\t\tif(changed){\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\n\t\t}\n\n\t\treturn changed;\n\t}\n\n\tsetValueActual(value){\n\t\tthis.oldValue = this.value;\n\n\t\tthis.value = value;\n\n\t\tthis.dispatch(\"cell-value-save-before\", this);\n\n\t\tthis.column.setFieldValue(this.row.data, value);\n\n\t\tthis.dispatch(\"cell-value-save-after\", this);\n\n\t\tif(this.loaded){\n\t\t\tthis.layoutElement();\n\t\t}\n\t}\n\n\tlayoutElement(){\n\t\tthis._generateContents();\n\n\t\tthis.dispatch(\"cell-layout\", this);\n\t}\n\n\tsetWidth(){\n\t\tthis.width = this.column.width;\n\t\tthis.element.style.width = this.column.widthStyled;\n\t}\n\n\tclearWidth(){\n\t\tthis.width = \"\";\n\t\tthis.element.style.width = \"\";\n\t}\n\n\tgetWidth(){\n\t\treturn this.width || this.element.offsetWidth;\n\t}\n\n\tsetMinWidth(){\n\t\tthis.minWidth = this.column.minWidth;\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\n\t}\n\n\tsetMaxWidth(){\n\t\tthis.maxWidth = this.column.maxWidth;\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\n\t}\n\n\tcheckHeight(){\n\t\t// var height = this.element.css(\"height\");\n\t\tthis.row.reinitializeHeight();\n\t}\n\n\tclearHeight(){\n\t\tthis.element.style.height = \"\";\n\t\tthis.height = null;\n\n\t\tthis.dispatch(\"cell-height\", this, \"\");\n\t}\n\n\tsetHeight(){\n\t\tthis.height = this.row.height;\n\t\tthis.element.style.height = this.row.heightStyled;\n\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\n\t}\n\n\tgetHeight(){\n\t\treturn this.height || this.element.offsetHeight;\n\t}\n\n\tshow(){\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\n\t}\n\n\thide(){\n\t\tthis.element.style.display = \"none\";\n\t}\n\n\tdelete(){\n\t\tthis.dispatch(\"cell-delete\", this);\n\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\n\t\t\tthis.element.parentNode.removeChild(this.element);\n\t\t}\n\n\t\tthis.element = false;\n\t\tthis.column.deleteCell(this);\n\t\tthis.row.deleteCell(this);\n\t\tthis.calcs = {};\n\t}\n\n\tgetIndex(){\n\t\treturn this.row.getCellIndex(this);\n\t}\n\n\t//////////////// Object Generation /////////////////\n\tgetComponent(){\n\t\tif(!this.component){\n\t\t\tthis.component = new CellComponent(this);\n\t\t}\n\n\t\treturn this.component;\n\t}\n}\n","import CoreFeature from '../CoreFeature.js';\nimport ColumnComponent from './ColumnComponent.js';\nimport defaultOptions from './defaults/options.js';\n\nimport Cell from '../cell/Cell.js';\n\nclass Column extends CoreFeature{\n\n\tconstructor(def, parent){\n\t\tsuper(parent.table);\n\n\t\tthis.definition = def; //column definition\n\t\tthis.parent = parent; //hold parent object\n\t\tthis.type = \"column\"; //type of element\n\t\tthis.columns = []; //child columns\n\t\tthis.cells = []; //cells bound to this column\n\t\tthis.element = this.createElement(); //column header element\n\t\tthis.contentElement = false;\n\t\tthis.titleHolderElement = false;\n\t\tthis.titleElement = false;\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\n\t\tthis.isGroup = false;\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\n\t\tthis.vertAlign = \"\"; //vert text alignment\n\n\t\t//multi dimensional filed handling\n\t\tthis.field =\"\";\n\t\tthis.fieldStructure = \"\";\n\t\tthis.getFieldValue = \"\";\n\t\tthis.setFieldValue = \"\";\n\n\t\tthis.titleDownload = null;\n\t\tthis.titleFormatterRendered = false;\n\n\t\tthis.mapDefinitions();\n\n\t\tthis.setField(this.definition.field);\n\n\t\tthis.modules = {}; //hold module variables;\n\n\t\tthis.width = null; //column width\n\t\tthis.widthStyled = \"\"; //column width pre-styled to improve render efficiency\n\t\tthis.maxWidth = null; //column maximum width\n\t\tthis.maxWidthStyled = \"\"; //column maximum pre-styled to improve render efficiency\n\t\tthis.maxInitialWidth = null;\n\t\tthis.minWidth = null; //column minimum width\n\t\tthis.minWidthStyled = \"\"; //column minimum pre-styled to improve render efficiency\n\t\tthis.widthFixed = false; //user has specified a width for this column\n\n\t\tthis.visible = true; //default visible state\n\n\t\tthis.component = null;\n\n\t\t//initialize column\n\t\tif(this.definition.columns){\n\n\t\t\tthis.isGroup = true;\n\n\t\t\tthis.definition.columns.forEach((def, i) => {\n\t\t\t\tvar newCol = new Column(def, this);\n\t\t\t\tthis.attachColumn(newCol);\n\t\t\t});\n\n\t\t\tthis.checkColumnVisibility();\n\t\t}else{\n\t\t\tparent.registerColumnField(this);\n\t\t}\n\n\t\tthis._initialize();\n\t}\n\n\tcreateElement (){\n\t\tvar el = document.createElement(\"div\");\n\n\t\tel.classList.add(\"tabulator-col\");\n\t\tel.setAttribute(\"role\", \"columnheader\");\n\t\tel.setAttribute(\"aria-sort\", \"none\");\n\n\t\tswitch(this.table.options.columnHeaderVertAlign){\n\t\t\tcase \"middle\":\n\t\t\t\tel.style.justifyContent = \"center\";\n\t\t\t\tbreak;\n\t\t\tcase \"bottom\":\n\t\t\t\tel.style.justifyContent = \"flex-end\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn el;\n\t}\n\n\tcreateGroupElement (){\n\t\tvar el = document.createElement(\"div\");\n\n\t\tel.classList.add(\"tabulator-col-group-cols\");\n\n\t\treturn el;\n\t}\n\n\tmapDefinitions(){\n\t\tvar defaults = this.table.options.columnDefaults;\n\n\t\t//map columnDefaults onto column definitions\n\t\tif(defaults){\n\t\t\tfor(let key in defaults){\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\n\t\t\t\t\tthis.definition[key] = defaults[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition);\n\t}\n\n\tcheckDefinition(){\n\t\tObject.keys(this.definition).forEach((key) => {\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key);\n\t\t\t}\n\t\t});\n\t}\n\n\tsetField(field){\n\t\tthis.field = field;\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\n\t}\n\n\t//register column position with column manager\n\tregisterColumnPosition(column){\n\t\tthis.parent.registerColumnPosition(column);\n\t}\n\n\t//register column position with column manager\n\tregisterColumnField(column){\n\t\tthis.parent.registerColumnField(column);\n\t}\n\n\t//trigger position registration\n\treRegisterPosition(){\n\t\tif(this.isGroup){\n\t\t\tthis.columns.forEach(function(column){\n\t\t\t\tcolumn.reRegisterPosition();\n\t\t\t});\n\t\t}else{\n\t\t\tthis.registerColumnPosition(this);\n\t\t}\n\t}\n\n\t//build header element\n\t_initialize(){\n\t\tvar def = this.definition;\n\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\n\n\t\tif(def.headerVertical){\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\n\n\t\t\tif(def.headerVertical === \"flip\"){\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\n\t\t\t}\n\t\t}\n\n\t\tthis.contentElement = this._buildColumnHeaderContent();\n\n\t\tthis.element.appendChild(this.contentElement);\n\n\t\tif(this.isGroup){\n\t\t\tthis._buildGroupHeader();\n\t\t}else{\n\t\t\tthis._buildColumnHeader();\n\t\t}\n\n\t\tthis.dispatch(\"column-init\", this);\n\t}\n\n\t//build header element for header\n\t_buildColumnHeader(){\n\t\tvar def = this.definition;\n\n\t\tthis.dispatch(\"column-layout\", this);\n\n\t\t//set column visibility\n\t\tif(typeof def.visible != \"undefined\"){\n\t\t\tif(def.visible){\n\t\t\t\tthis.show(true);\n\t\t\t}else{\n\t\t\t\tthis.hide(true);\n\t\t\t}\n\t\t}\n\n\t\t//assign additional css classes to column header\n\t\tif(def.cssClass){\n\t\t\tvar classNames = def.cssClass.split(\" \");\n\t\t\tclassNames.forEach((className) => {\n\t\t\t\tthis.element.classList.add(className);\n\t\t\t});\n\t\t}\n\n\t\tif(def.field){\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\n\t\t}\n\n\t\t//set min width if present\n\t\tthis.setMinWidth(parseInt(def.minWidth));\n\n\t\tif (def.maxInitialWidth) {\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\n\t\t}\n\t\t\n\t\tif(def.maxWidth){\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\n\t\t}\n\n\t\tthis.reinitializeWidth();\n\n\t\t//set horizontal text alignment\n\t\tthis.hozAlign = this.definition.hozAlign;\n\t\tthis.vertAlign = this.definition.vertAlign;\n\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\n\t}\n\n\t_buildColumnHeaderContent(){\n\t\tvar contentElement = document.createElement(\"div\");\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\n\n\t\tthis.titleHolderElement = document.createElement(\"div\");\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\n\n\t\tcontentElement.appendChild(this.titleHolderElement);\n\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\n\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\n\n\t\treturn contentElement;\n\t}\n\n\t//build title element of column\n\t_buildColumnHeaderTitle(){\n\t\tvar def = this.definition;\n\n\t\tvar titleHolderElement = document.createElement(\"div\");\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\n\t\t\n\t\tif(def.headerWordWrap){\n\t\t\ttitleHolderElement.classList.add(\"tabulator-col-title-wrap\");\n\t\t}\n\n\t\tif(def.editableTitle){\n\t\t\tvar titleElement = document.createElement(\"input\");\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\n\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\n\t\t\t\te.stopPropagation();\n\t\t\t\ttitleElement.focus();\n\t\t\t});\n\n\t\t\ttitleElement.addEventListener(\"change\", () => {\n\t\t\t\tdef.title = titleElement.value;\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\n\t\t\t});\n\n\t\t\ttitleHolderElement.appendChild(titleElement);\n\n\t\t\tif(def.field){\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\ttitleElement.value = def.title || \" \";\n\t\t\t}\n\n\t\t}else{\n\t\t\tif(def.field){\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\n\t\t\t}\n\t\t}\n\n\t\treturn titleHolderElement;\n\t}\n\n\t_formatColumnHeaderTitle(el, title){\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\n\t\t\treturn title;\n\t\t});\n\n\t\tswitch(typeof contents){\n\t\t\tcase \"object\":\n\t\t\t\tif(contents instanceof Node){\n\t\t\t\t\tel.appendChild(contents);\n\t\t\t\t}else{\n\t\t\t\t\tel.innerHTML = \"\";\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);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"undefined\":\n\t\t\t\tel.innerHTML = \"\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tel.innerHTML = contents;\n\t\t}\n\t}\n\n\t//build header element for column group\n\t_buildGroupHeader(){\n\t\tthis.element.classList.add(\"tabulator-col-group\");\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\n\n\t\t//asign additional css classes to column header\n\t\tif(this.definition.cssClass){\n\t\t\tvar classNames = this.definition.cssClass.split(\" \");\n\t\t\tclassNames.forEach((className) => {\n\t\t\t\tthis.element.classList.add(className);\n\t\t\t});\n\t\t}\n\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\n\n\t\tthis.element.appendChild(this.groupElement);\n\t}\n\n\t//flat field lookup\n\t_getFlatData(data){\n\t\treturn data[this.field];\n\t}\n\n\t//nested field lookup\n\t_getNestedData(data){\n\t\tvar dataObj = data,\n\t\tstructure = this.fieldStructure,\n\t\tlength = structure.length,\n\t\toutput;\n\n\t\tfor(let i = 0; i < length; i++){\n\n\t\t\tdataObj = dataObj[structure[i]];\n\n\t\t\toutput = dataObj;\n\n\t\t\tif(!dataObj){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}\n\n\t//flat field set\n\t_setFlatData(data, value){\n\t\tif(this.field){\n\t\t\tdata[this.field] = value;\n\t\t}\n\t}\n\n\t//nested field set\n\t_setNestedData(data, value){\n\t\tvar dataObj = data,\n\t\tstructure = this.fieldStructure,\n\t\tlength = structure.length;\n\n\t\tfor(let i = 0; i < length; i++){\n\n\t\t\tif(i == length -1){\n\t\t\t\tdataObj[structure[i]] = value;\n\t\t\t}else{\n\t\t\t\tif(!dataObj[structure[i]]){\n\t\t\t\t\tif(typeof value !== \"undefined\"){\n\t\t\t\t\t\tdataObj[structure[i]] = {};\n\t\t\t\t\t}else{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdataObj = dataObj[structure[i]];\n\t\t\t}\n\t\t}\n\t}\n\n\t//attach column to this group\n\tattachColumn(column){\n\t\tif(this.groupElement){\n\t\t\tthis.columns.push(column);\n\t\t\tthis.groupElement.appendChild(column.getElement());\n\n\t\t\tcolumn.columnRendered();\n\t\t}else{\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\n\t\t}\n\t}\n\n\t//vertically align header in column\n\tverticalAlign(alignment, height){\n\n\t\t//calculate height of column header and group holder element\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\n\n\t\tthis.element.style.height = parentHeight + \"px\";\n\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\n\n\t\tif(this.isGroup){\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\n\t\t}\n\n\t\t//vertically align cell contents\n\t\t// if(!this.isGroup && alignment !== \"top\"){\n\t\t// \tif(alignment === \"bottom\"){\n\t\t// \t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\n\t\t// \t}else{\n\t\t// \t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\n\t\t// \t}\n\t\t// }\n\n\t\tthis.columns.forEach(function(column){\n\t\t\tcolumn.verticalAlign(alignment);\n\t\t});\n\t}\n\n\t//clear vertical alignment\n\tclearVerticalAlign(){\n\t\tthis.element.style.paddingTop = \"\";\n\t\tthis.element.style.height = \"\";\n\t\tthis.element.style.minHeight = \"\";\n\t\tthis.groupElement.style.minHeight = \"\";\n\n\t\tthis.columns.forEach(function(column){\n\t\t\tcolumn.clearVerticalAlign();\n\t\t});\n\n\t\tthis.dispatch(\"column-height\", this, \"\");\n\t}\n\n\t//// Retrieve Column Information ////\n\t//return column header element\n\tgetElement(){\n\t\treturn this.element;\n\t}\n\n\t//return column group element\n\tgetGroupElement(){\n\t\treturn this.groupElement;\n\t}\n\n\t//return field name\n\tgetField(){\n\t\treturn this.field;\n\t}\n\n\tgetTitleDownload() {\n\t\treturn this.titleDownload;\n\t}\n\n\t//return the first column in a group\n\tgetFirstColumn(){\n\t\tif(!this.isGroup){\n\t\t\treturn this;\n\t\t}else{\n\t\t\tif(this.columns.length){\n\t\t\t\treturn this.columns[0].getFirstColumn();\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\t//return the last column in a group\n\tgetLastColumn(){\n\t\tif(!this.isGroup){\n\t\t\treturn this;\n\t\t}else{\n\t\t\tif(this.columns.length){\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\t//return all columns in a group\n\tgetColumns(traverse){\n\t\tvar columns = [];\n\n\t\tif(traverse){\n\t\t\tthis.columns.forEach((column) => {\n\t\t\t\tcolumns.push(column);\n\t\t\t\t\t\n\t\t\t\tcolumns = columns.concat(column.getColumns(true));\n\t\t\t});\n\t\t}else{\n\t\t\tcolumns = this.columns;\n\t\t}\n\t\t\n\t\treturn columns;\n\t}\n\n\t//return all columns in a group\n\tgetCells(){\n\t\treturn this.cells;\n\t}\n\n\t//retrieve the top column in a group of columns\n\tgetTopColumn(){\n\t\tif(this.parent.isGroup){\n\t\t\treturn this.parent.getTopColumn();\n\t\t}else{\n\t\t\treturn this;\n\t\t}\n\t}\n\n\t//return column definition object\n\tgetDefinition(updateBranches){\n\t\tvar colDefs = [];\n\n\t\tif(this.isGroup && updateBranches){\n\t\t\tthis.columns.forEach(function(column){\n\t\t\t\tcolDefs.push(column.getDefinition(true));\n\t\t\t});\n\n\t\t\tthis.definition.columns = colDefs;\n\t\t}\n\n\t\treturn this.definition;\n\t}\n\n\t//////////////////// Actions ////////////////////\n\tcheckColumnVisibility(){\n\t\tvar visible = false;\n\n\t\tthis.columns.forEach(function(column){\n\t\t\tif(column.visible){\n\t\t\t\tvisible = true;\n\t\t\t}\n\t\t});\n\n\t\tif(visible){\n\t\t\tthis.show();\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\n\t\t}else{\n\t\t\tthis.hide();\n\t\t}\n\t}\n\n\t//show column\n\tshow(silent, responsiveToggle){\n\t\tif(!this.visible){\n\t\t\tthis.visible = true;\n\n\t\t\tthis.element.style.display = \"\";\n\n\t\t\tif(this.parent.isGroup){\n\t\t\t\tthis.parent.checkColumnVisibility();\n\t\t\t}\n\n\t\t\tthis.cells.forEach(function(cell){\n\t\t\t\tcell.show();\n\t\t\t});\n\n\t\t\tif(!this.isGroup && this.width === null){\n\t\t\t\tthis.reinitializeWidth();\n\t\t\t}\n\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\n\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\n\n\t\t\tif(!silent){\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\n\t\t\t}\n\n\t\t\tif(this.parent.isGroup){\n\t\t\t\tthis.parent.matchChildWidths();\n\t\t\t}\n\n\t\t\tif(!this.silent){\n\t\t\t\tthis.table.columnManager.rerenderColumns();\n\t\t\t}\n\t\t}\n\t}\n\n\t//hide column\n\thide(silent, responsiveToggle){\n\t\tif(this.visible){\n\t\t\tthis.visible = false;\n\n\t\t\tthis.element.style.display = \"none\";\n\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\n\n\t\t\tif(this.parent.isGroup){\n\t\t\t\tthis.parent.checkColumnVisibility();\n\t\t\t}\n\n\t\t\tthis.cells.forEach(function(cell){\n\t\t\t\tcell.hide();\n\t\t\t});\n\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\n\n\t\t\tif(!silent){\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\n\t\t\t}\n\n\t\t\tif(this.parent.isGroup){\n\t\t\t\tthis.parent.matchChildWidths();\n\t\t\t}\n\n\t\t\tif(!this.silent){\n\t\t\t\tthis.table.columnManager.rerenderColumns();\n\t\t\t}\n\t\t}\n\t}\n\n\tmatchChildWidths(){\n\t\tvar childWidth = 0;\n\n\t\tif(this.contentElement && this.columns.length){\n\t\t\tthis.columns.forEach(function(column){\n\t\t\t\tif(column.visible){\n\t\t\t\t\tchildWidth += column.getWidth();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\n\n\t\t\tif(this.parent.isGroup){\n\t\t\t\tthis.parent.matchChildWidths();\n\t\t\t}\n\t\t}\n\t}\n\n\tremoveChild(child){\n\t\tvar index = this.columns.indexOf(child);\n\n\t\tif(index > -1){\n\t\t\tthis.columns.splice(index, 1);\n\t\t}\n\n\t\tif(!this.columns.length){\n\t\t\tthis.delete();\n\t\t}\n\t}\n\n\tsetWidth(width){\n\t\tthis.widthFixed = true;\n\t\tthis.setWidthActual(width);\n\t}\n\n\tsetWidthActual(width){\n\t\tif(isNaN(width)){\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\n\t\t}\n\n\t\twidth = Math.max(this.minWidth, width);\n\n\t\tif(this.maxWidth){\n\t\t\twidth = Math.min(this.maxWidth, width);\n\t\t}\n\n\t\tthis.width = width;\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\n\n\t\tthis.element.style.width = this.widthStyled;\n\n\t\tif(!this.isGroup){\n\t\t\tthis.cells.forEach(function(cell){\n\t\t\t\tcell.setWidth();\n\t\t\t});\n\t\t}\n\n\t\tif(this.parent.isGroup){\n\t\t\tthis.parent.matchChildWidths();\n\t\t}\n\n\t\tthis.dispatch(\"column-width\", this);\n\t}\n\n\tcheckCellHeights(){\n\t\tvar rows = [];\n\n\t\tthis.cells.forEach(function(cell){\n\t\t\tif(cell.row.heightInitialized){\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\n\t\t\t\t\trows.push(cell.row);\n\t\t\t\t\tcell.row.clearCellHeight();\n\t\t\t\t}else{\n\t\t\t\t\tcell.row.heightInitialized = false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\trows.forEach(function(row){\n\t\t\trow.calcHeight();\n\t\t});\n\n\t\trows.forEach(function(row){\n\t\t\trow.setCellHeight();\n\t\t});\n\t}\n\n\tgetWidth(){\n\t\tvar width = 0;\n\n\t\tif(this.isGroup){\n\t\t\tthis.columns.forEach(function(column){\n\t\t\t\tif(column.visible){\n\t\t\t\t\twidth += column.getWidth();\n\t\t\t\t}\n\t\t\t});\n\t\t}else{\n\t\t\twidth = this.width;\n\t\t}\n\n\t\treturn width;\n\t}\n\n\tgetLeftOffset(){\n\t\tvar offset = this.element.offsetLeft;\n\n\t\tif(this.parent.isGroup){\n\t\t\toffset += this.parent.getLeftOffset();\n\t\t}\n\n\t\treturn offset;\n\t}\n\n\tgetHeight(){\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\n\t}\n\n\tsetMinWidth(minWidth){\n\t\tif(this.maxWidth && minWidth > this.maxWidth){\n\t\t\tminWidth = this.maxWidth;\n\n\t\t\tconsole.warn(\"the minWidth (\"+ minWidth + \"px) for column '\" + this.field + \"' cannot be bigger that its maxWidth (\"+ this.maxWidthStyled + \")\");\n\t\t}\n\n\t\tthis.minWidth = minWidth;\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\n\n\t\tthis.element.style.minWidth = this.minWidthStyled;\n\n\t\tthis.cells.forEach(function(cell){\n\t\t\tcell.setMinWidth();\n\t\t});\n\t}\n\n\tsetMaxWidth(maxWidth){\n\t\tif(this.minWidth && maxWidth < this.minWidth){\n\t\t\tmaxWidth = this.minWidth;\n\n\t\t\tconsole.warn(\"the maxWidth (\"+ maxWidth + \"px) for column '\" + this.field + \"' cannot be smaller that its minWidth (\"+ this.minWidthStyled + \")\");\n\t\t}\n\n\t\tthis.maxWidth = maxWidth;\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\n\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\n\n\t\tthis.cells.forEach(function(cell){\n\t\t\tcell.setMaxWidth();\n\t\t});\n\t}\n\n\tdelete(){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(this.isGroup){\n\t\t\t\tthis.columns.forEach(function(column){\n\t\t\t\t\tcolumn.delete();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.dispatch(\"column-delete\", this);\n\n\t\t\tvar cellCount = this.cells.length;\n\n\t\t\tfor(let i = 0; i < cellCount; i++){\n\t\t\t\tthis.cells[0].delete();\n\t\t\t}\n\n\t\t\tif(this.element.parentNode){\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\n\t\t\t}\n\n\t\t\tthis.element = false;\n\t\t\tthis.contentElement = false;\n\t\t\tthis.titleElement = false;\n\t\t\tthis.groupElement = false;\n\n\t\t\tif(this.parent.isGroup){\n\t\t\t\tthis.parent.removeChild(this);\n\t\t\t}\n\n\t\t\tthis.table.columnManager.deregisterColumn(this);\n\n\t\t\tthis.table.columnManager.rerenderColumns(true);\n\n\t\t\tresolve();\n\t\t});\n\t}\n\n\tcolumnRendered(){\n\t\tif(this.titleFormatterRendered){\n\t\t\tthis.titleFormatterRendered();\n\t\t}\n\n\t\tthis.dispatch(\"column-rendered\", this);\n\t}\n\n\t//////////////// Cell Management /////////////////\n\t//generate cell for this column\n\tgenerateCell(row){\n\t\tvar cell = new Cell(this, row);\n\n\t\tthis.cells.push(cell);\n\n\t\treturn cell;\n\t}\n\n\tnextColumn(){\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\n\t}\n\n\t_nextVisibleColumn(index){\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\n\t}\n\n\tprevColumn(){\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\n\t}\n\n\t_prevVisibleColumn(index){\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\n\t}\n\n\treinitializeWidth(force){\n\t\tthis.widthFixed = false;\n\n\t\t//set width if present\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\n\t\t\t// maxInitialWidth ignored here as width specified\n\t\t\tthis.setWidth(this.definition.width);\n\t\t}\n\n\t\tthis.dispatch(\"column-width-fit-before\", this);\n\n\t\tthis.fitToData(force);\n\n\t\tthis.dispatch(\"column-width-fit-after\", this);\n\t}\n\n\t//set column width to maximum cell width for non group columns\n\tfitToData(force){\n\t\tif(this.isGroup){\n\t\t\treturn;\n\t\t}\n\n\t\tif(!this.widthFixed){\n\t\t\tthis.element.style.width = \"\";\n\n\t\t\tthis.cells.forEach((cell) => {\n\t\t\t\tcell.clearWidth();\n\t\t\t});\n\t\t}\n\n\t\tvar maxWidth = this.element.offsetWidth;\n\n\t\tif(!this.width || !this.widthFixed){\n\t\t\tthis.cells.forEach((cell) => {\n\t\t\t\tvar width = cell.getWidth();\n\n\t\t\t\tif(width > maxWidth){\n\t\t\t\t\tmaxWidth = width;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif(maxWidth){\n\t\t\t\tvar setTo = maxWidth + 1;\n\t\t\t\tif (this.maxInitialWidth && !force) {\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\n\t\t\t\t}\n\t\t\t\tthis.setWidthActual(setTo);\n\t\t\t}\n\t\t}\n\t}\n\n\tupdateDefinition(updates){\n\t\tvar definition;\n\n\t\tif(!this.isGroup){\n\t\t\tif(!this.parent.isGroup){\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\n\t\t\t\tdefinition = Object.assign(definition, updates);\n\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\n\t\t\t\t\t.then((column) => {\n\n\t\t\t\t\t\tif(definition.field == this.field){\n\t\t\t\t\t\t\tthis.field = false; //clear field name to prevent deletion of duplicate column from arrays\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn this.delete()\n\t\t\t\t\t\t\t.then(() => {\n\t\t\t\t\t\t\t\treturn column.getComponent();\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\n\t\t\t}\n\t\t}else{\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\n\t\t}\n\t}\n\n\tdeleteCell(cell){\n\t\tvar index = this.cells.indexOf(cell);\n\n\t\tif(index > -1){\n\t\t\tthis.cells.splice(index, 1);\n\t\t}\n\t}\n\n\t//////////////// Object Generation /////////////////\n\tgetComponent(){\n\t\tif(!this.component){\n\t\t\tthis.component = new ColumnComponent(this);\n\t\t}\n\n\t\treturn this.component;\n\t}\n}\n\nColumn.defaultOptionList = defaultOptions;\n\nexport default Column;\n","export default class Helpers{\n\n\tstatic elVisible(el){\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\n\t}\n\n\tstatic elOffset(el){\n\t\tvar box = el.getBoundingClientRect();\n\n\t\treturn {\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\n\t\t};\n\t}\n\n\tstatic deepClone(obj, clone, list = []){\n\t\tvar objectProto = {}.__proto__,\n\t\tarrayProto = [].__proto__;\n\n\t\tif (!clone){\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\n\t\t}\n\n\t\tfor(var i in obj) {\n\t\t\tlet subject = obj[i],\n\t\t\tmatch, copy;\n\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\n\t\t\t\tmatch = list.findIndex((item) => {\n\t\t\t\t\treturn item.subject === subject;\n\t\t\t\t});\n\n\t\t\t\tif(match > -1){\n\t\t\t\t\tclone[i] = list[match].copy;\n\t\t\t\t}else{\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\n\n\t\t\t\t\tlist.unshift({subject, copy});\n\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn clone;\n\t}\n}","export default class OptionsList {\n\tconstructor(table, msgType, defaults = {}){\n\t\tthis.table = table;\n\t\tthis.msgType = msgType;\n\t\tthis.registeredDefaults = Object.assign({}, defaults);\n\t}\n\t\n\tregister(option, value){\n\t\tthis.registeredDefaults[option] = value;\n\t}\n\t\n\tgenerate(defaultOptions, userOptions = {}){\n\t\tvar output = Object.assign({}, this.registeredDefaults),\n\t\twarn = this.table.options.debugInvalidOptions || userOptions.debugInvalidOptions === true;\n\t\t\n\t\tObject.assign(output, defaultOptions);\n\t\t\n\t\tfor (let key in userOptions){\n\t\t\tif(!output.hasOwnProperty(key)){\n\t\t\t\tif(warn){\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key);\n\t\t\t\t}\n\n\t\t\t\toutput[key] = userOptions.key;\n\t\t\t}\n\t\t}\n\t\n\t\t\n\t\tfor (let key in output){\n\t\t\tif(key in userOptions){\n\t\t\t\toutput[key] = userOptions[key];\n\t\t\t}else{\n\t\t\t\tif(Array.isArray(output[key])){\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\n\t\t\t\t\tdelete output[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn output;\n\t}\n}","import CoreFeature from '../CoreFeature.js';\nimport Helpers from '../tools/Helpers.js';\n\nexport default class Renderer extends CoreFeature{\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.elementVertical = table.rowManager.element;\n\t\tthis.elementHorizontal = table.columnManager.element;\n\t\tthis.tableElement = table.rowManager.tableElement;\n\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)\n\t}\n\n\n\t///////////////////////////////////\n\t/////// Internal Bindings /////////\n\t///////////////////////////////////\n\n\tinitialize(){\n\t\t//initialize core functionality\n\t}\n\n\tclearRows(){\n\t\t//clear down existing rows layout\n\t}\n\n\tclearColumns(){\n\t\t//clear down existing columns layout\n\t}\n\n\n\treinitializeColumnWidths(columns){\n\t\t//resize columns to fit data\n\t}\n\n\n\trenderRows(){\n\t\t//render rows from a clean slate\n\t}\n\n\trenderColumns(){\n\t\t//render columns from a clean slate\n\t}\n\n\trerenderRows(callback){\n\t\t// rerender rows and keep position\n\t\tif(callback){\n\t\t\tcallback();\n\t\t}\n\t}\n\n\trerenderColumns(update, blockRedraw){\n\t\t//rerender columns\n\t}\n\n\trenderRowCells(row){\n\t\t//render the cells in a row\n\t}\n\n\trerenderRowCells(row, force){\n\t\t//rerender the cells in a row\n\t}\n\n\tscrollColumns(left, dir){\n\t\t//handle horizontal scrolling\n\t}\n\n\tscrollRows(top, dir){\n\t\t//handle vertical scrolling\n\t}\n\n\tresize(){\n\t\t//container has resized, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\n\t}\n\n\tscrollToRow(row){\n\t\t//scroll to a specific row\n\t}\n\n\tscrollToRowNearestTop(row){\n\t\t//determine weather the row is nearest the top or bottom of the table, return true for top or false for bottom\n\t}\n\n\tvisibleRows(includingBuffer){\n\t\t//return the visible rows\n\t\treturn [];\n\t}\n\n\t///////////////////////////////////\n\t//////// Helper Functions /////////\n\t///////////////////////////////////\n\n\trows(){\n\t\treturn this.table.rowManager.getDisplayRows();\n\t}\n\n\tstyleRow(row, index){\n\t\tvar rowEl = row.getElement();\n\n\t\tif(index % 2){\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\n\t\t}else{\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\n\t\t}\n\t}\n\n\t///////////////////////////////////\n\t/////// External Triggers /////////\n\t/////// (DO NOT OVERRIDE) /////////\n\t///////////////////////////////////\n\n\tclear(){\n\t\t//clear down existing layout\n\t\tthis.clearRows();\n\t\tthis.clearColumns();\n\t}\n\n\trender(){\n\t\t//render from a clean slate\n\t\tthis.renderRows();\n\t\tthis.renderColumns();\n\t}\n\n\trerender(callback){\n\t\t// rerender and keep position\n\t\tthis.rerenderRows();\n\t\tthis.rerenderColumns();\n\t}\n\n\tscrollToRowPosition(row, position, ifVisible){\n\t\tvar rowIndex = this.rows().indexOf(row),\n\t\trowEl = row.getElement(),\n\t\toffset = 0;\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif(rowIndex > -1){\n\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\n\t\t\t\t}\n\n\t\t\t\t//check row visibility\n\t\t\t\tif(!ifVisible){\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(typeof position === \"undefined\"){\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\n\t\t\t\t}\n\n\t\t\t\tif(position === \"nearest\"){\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\";\n\t\t\t\t}\n\n\t\t\t\t//scroll to row\n\t\t\t\tthis.scrollToRow(row);\n\n\t\t\t\t//align to correct position\n\t\t\t\tswitch(position){\n\t\t\t\t\tcase \"middle\":\n\t\t\t\t\tcase \"center\":\n\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"bottom\":\n\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"top\":\n\t\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tresolve();\n\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\n\t\t\t\treject(\"Scroll Error - Row not visible\");\n\t\t\t}\n\t\t});\n\t}\n}","import Renderer from '../Renderer.js';\n\nexport default class BasicHorizontal extends Renderer{\n\tconstructor(table){\n\t\tsuper(table);\n\t}\n\n\trenderRowCells(row){\n\t\trow.cells.forEach((cell) => {\n\t\t\trow.element.appendChild(cell.getElement());\n\t\t\tcell.cellRendered();\n\t\t});\n\t}\n\n\treinitializeColumnWidths(columns){\n\t\tcolumns.forEach(function(column){\n\t\t\tcolumn.reinitializeWidth();\n\t\t});\n\t}\n}","import Renderer from '../Renderer.js';\n\nexport default class VirtualDomHorizontal extends Renderer{\n\tconstructor(table){\n\t\tsuper(table);\n\t\t\n\t\tthis.leftCol = 0;\n\t\tthis.rightCol = 0;\n\t\tthis.scrollLeft = 0;\n\t\t\n\t\tthis.vDomScrollPosLeft = 0;\n\t\tthis.vDomScrollPosRight = 0;\n\t\t\n\t\tthis.vDomPadLeft = 0;\n\t\tthis.vDomPadRight = 0;\n\t\t\n\t\tthis.fitDataColAvg = 0;\n\t\t\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\n\t\t\n\t\tthis.visibleRows = null;\n\t\t\n\t\tthis.initialized = false;\n\t\tthis.isFitData = false;\n\t\t\n\t\tthis.columns = [];\n\t}\n\t\n\tinitialize(){\n\t\tthis.compatibilityCheck();\n\t\tthis.layoutCheck();\n\t\tthis.vertScrollListen();\n\t}\n\t\n\tcompatibilityCheck(){\t\t\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\n\t\t}\n\t\t\n\t\tif(this.options(\"responsiveLayout\")){\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\n\t\t}\n\t\t\n\t\tif(this.options(\"rtl\")){\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\n\t\t}\n\t}\n\t\n\tlayoutCheck(){\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\n\t}\n\t\n\tvertScrollListen(){\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\n\t}\n\t\n\tclearVisRowCache(){\n\t\tthis.visibleRows = null;\n\t}\n\t\n\t//////////////////////////////////////\n\t///////// Public Functions ///////////\n\t//////////////////////////////////////\n\t\n\trenderColumns(row, force){\n\t\tthis.dataChange();\n\t}\n\t\n\t\n\tscrollColumns(left, dir){\n\t\tif(this.scrollLeft != left){\n\t\t\tthis.scrollLeft = left;\n\t\t\t\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\n\t\t}\n\t}\n\t\n\tcalcWindowBuffer(){\n\t\tvar buffer = this.elementVertical.clientWidth;\n\t\t\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\n\t\t\tif(column.visible){\n\t\t\t\tvar width = column.getWidth();\n\t\t\t\t\n\t\t\t\tif(width > buffer){\n\t\t\t\t\tbuffer = width;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tthis.windowBuffer = buffer * 2;\n\t}\n\t\n\trerenderColumns(update, blockRedraw){\t\t\n\t\tvar old = {\n\t\t\tcols:this.columns,\n\t\t\tleftCol:this.leftCol,\n\t\t\trightCol:this.rightCol,\n\t\t},\n\t\tcolPos = 0;\n\t\t\n\t\tif(update && !this.initialized){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis.clear();\n\t\t\n\t\tthis.calcWindowBuffer();\n\t\t\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\n\t\t\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\n\t\t\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\n\t\t\tvar config = {},\n\t\t\twidth;\n\t\t\t\n\t\t\tif(column.visible){\n\t\t\t\tif(!column.modules.frozen){\t\t\t\n\t\t\t\t\twidth = column.getWidth();\n\n\t\t\t\t\tconfig.leftPos = colPos;\n\t\t\t\t\tconfig.rightPos = colPos + width;\n\t\t\t\t\t\n\t\t\t\t\tconfig.width = width;\n\t\t\t\t\t\n\t\t\t\t\tif (this.isFitData) {\n\t\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\n\t\t\t\t\t\t//column is visible\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(this.leftCol == -1){\n\t\t\t\t\t\t\tthis.leftCol = this.columns.length;\n\t\t\t\t\t\t\tthis.vDomPadLeft = colPos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.rightCol = this.columns.length;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// column is hidden\n\t\t\t\t\t\tif(this.leftCol !== -1){\n\t\t\t\t\t\t\tthis.vDomPadRight += width;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tthis.columns.push(column);\n\t\t\t\t\t\n\t\t\t\t\tcolumn.modules.vdomHoz = config;\n\t\t\t\t\t\n\t\t\t\t\tcolPos += width;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\n\t\t\n\t\tthis.initialized = true;\n\t\t\n\t\tif(!blockRedraw){\n\t\t\tif(!update || this.reinitChanged(old)){\n\t\t\t\tthis.reinitializeRows();\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\n\t}\n\t\n\trenderRowCells(row){\n\t\tif(this.initialized){\n\t\t\tthis.initializeRow(row);\n\t\t}else{\n\t\t\trow.cells.forEach((cell) => {\n\t\t\t\trow.element.appendChild(cell.getElement());\n\t\t\t\tcell.cellRendered();\n\t\t\t});\n\t\t}\n\t}\n\t\n\trerenderRowCells(row, force){\n\t\tthis.reinitializeRow(row, force);\n\t}\n\t\n\treinitializeColumnWidths(columns){\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\n\t\t\tthis.columns[i].reinitializeWidth();\n\t\t}\n\t}\n\t\n\t//////////////////////////////////////\n\t//////// Internal Rendering //////////\n\t//////////////////////////////////////\n\t\n\tdeinitialize(){\n\t\tthis.initialized = false;\n\t}\n\t\n\tclear(){\n\t\tthis.columns = [];\n\t\t\n\t\tthis.leftCol = -1;\n\t\tthis.rightCol = 0;\n\t\t\n\t\tthis.vDomScrollPosLeft = 0;\n\t\tthis.vDomScrollPosRight = 0;\n\t\tthis.vDomPadLeft = 0;\n\t\tthis.vDomPadRight = 0;\n\t}\n\t\n\tdataChange(){\n\t\tvar change = false,\n\t\trow, rowEl;\n\t\t\n\t\tif(this.isFitData){\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\n\t\t\t\tif(!column.definition.width && column.visible){\n\t\t\t\t\tchange = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\n\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\n\t\t\t\t\n\t\t\t\trow = this.chain(\"rows-sample\", [1], [], () => {\n\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\n\t\t\t\t})[0];\n\t\t\t\t\n\t\t\t\tif(row){\n\t\t\t\t\trowEl = row.getElement();\n\t\t\t\t\t\n\t\t\t\t\trow.generateCells();\n\t\t\t\t\t\n\t\t\t\t\tthis.tableElement.appendChild(rowEl);\n\t\t\t\t\t\n\t\t\t\t\tfor(let colEnd = 0; colEnd < row.cells.length; colEnd++){\n\t\t\t\t\t\tlet cell = row.cells[colEnd];\n\t\t\t\t\t\trowEl.appendChild(cell.getElement());\n\t\t\t\t\t\t\n\t\t\t\t\t\tcell.column.reinitializeWidth();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\n\t\t\t\t\t\n\t\t\t\t\tthis.rerenderColumns(false, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\n\t\t\t\tthis.layoutRefresh();\n\t\t\t\tthis.rerenderColumns(false, true);\n\t\t\t}\n\t\t}\n\t}\n\t\n\treinitChanged(old){\n\t\tvar match = true;\n\t\t\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\told.cols.forEach((col, i) => {\n\t\t\tif(col !== this.columns[i]){\n\t\t\t\tmatch = false;\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn !match;\n\t}\n\t\n\treinitializeRows(){\n\t\tvar visibleRows = this.getVisibleRows(),\n\t\totherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\n\n\t\tvisibleRows.forEach((row) => {\n\t\t\tthis.reinitializeRow(row, true);\n\t\t});\n\n\t\totherRows.forEach((row) =>{\n\t\t\trow.deinitialize();\n\t\t});\n\t}\n\t\n\tgetVisibleRows(){\n\t\tif (!this.visibleRows){\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\n\t\t}\n\t\t\n\t\treturn this.visibleRows;\t\n\t}\n\t\n\tscroll(diff){\n\t\tthis.vDomScrollPosLeft += diff;\n\t\tthis.vDomScrollPosRight += diff;\n\t\t\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\n\t\t\tthis.rerenderColumns();\n\t\t}else{\n\t\t\tif(diff > 0){\n\t\t\t\t//scroll right\n\t\t\t\tthis.addColRight();\n\t\t\t\tthis.removeColLeft();\n\t\t\t}else{\n\t\t\t\t//scroll left\n\t\t\t\tthis.addColLeft();\n\t\t\t\tthis.removeColRight();\n\t\t\t}\n\t\t}\n\t}\n\t\n\tcolPositionAdjust (start, end, diff){\n\t\tfor(let i = start; i < end; i++){\n\t\t\tlet column = this.columns[i];\n\t\t\t\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\n\t\t}\n\t}\n\t\n\taddColRight(){\n\t\tvar changes = false,\n\t\tworking = true;\n\t\t\n\t\twhile(working){\n\n\t\t\tlet column = this.columns[this.rightCol + 1];\n\t\t\t\n\t\t\tif(column){\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\n\t\t\t\t\tchanges = true;\n\t\t\t\t\t\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\n\t\t\t\t\t\tif(row.type !== \"group\"){\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\n\t\t\t\t\t\t\trow.getElement().insertBefore(cell.getElement(), row.getCell(this.columns[this.rightCol]).getElement().nextSibling);\n\t\t\t\t\t\t\tcell.cellRendered();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\n\t\t\t\t\t\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\n\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\n\t\t\t\t\t\tif(row.type !== \"group\"){\n\t\t\t\t\t\t\trow.modules.vdomHoz.rightCol = this.rightCol;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\n\t\t\t\t\t\tthis.vDomPadRight = 0;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\n\t\t\t\t\t}\t\n\t\t\t\t}else{\n\t\t\t\t\tworking = false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tworking = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(changes){\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\n\t\t}\n\t}\n\t\n\taddColLeft(){\n\t\tvar changes = false,\n\t\tworking = true;\n\t\t\n\t\twhile(working){\n\t\t\tlet column = this.columns[this.leftCol - 1];\n\t\t\t\n\t\t\tif(column){\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\n\t\t\t\t\tchanges = true;\n\t\t\t\t\t\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\n\t\t\t\t\t\tif(row.type !== \"group\"){\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\n\t\t\t\t\t\t\trow.getElement().insertBefore(cell.getElement(), row.getCell(this.columns[this.leftCol]).getElement());\n\t\t\t\t\t\t\tcell.cellRendered();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\n\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\n\t\t\t\t\t\tif(row.type !== \"group\"){\n\t\t\t\t\t\t\trow.modules.vdomHoz.leftCol = this.leftCol;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\n\t\t\t\t\t\n\t\t\t\t\tif(diff){\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tworking = false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tworking = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(changes){\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\n\t\t}\n\t}\n\t\n\tremoveColRight(){\n\t\tvar changes = false,\n\t\tworking = true;\n\t\t\n\t\twhile(working){\n\t\t\tlet column = this.columns[this.rightCol];\n\t\t\t\n\t\t\tif(column){\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\n\t\t\t\t\tchanges = true;\n\t\t\t\t\t\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\n\t\t\t\t\t\tif(row.type !== \"group\"){\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\n\t\t\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\n\t\t\t\t\tthis.rightCol --;\n\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\n\t\t\t\t\t\tif(row.type !== \"group\"){\n\t\t\t\t\t\t\trow.modules.vdomHoz.rightCol = this.rightCol;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}else{\n\t\t\t\t\tworking = false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tworking = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(changes){\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\n\t\t}\n\t}\n\t\n\tremoveColLeft(){\n\t\tvar changes = false,\n\t\tworking = true;\n\n\t\twhile(working){\n\t\t\tlet column = this.columns[this.leftCol];\n\t\t\t\n\t\t\tif(column){\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\n\t\t\t\t\tchanges = true;\n\t\t\t\t\t\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\n\t\t\t\t\t\tif(row.type !== \"group\"){\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\n\t\t\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\n\t\t\t\t\tthis.leftCol ++;\n\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\n\t\t\t\t\t\tif(row.type !== \"group\"){\n\t\t\t\t\t\t\trow.modules.vdomHoz.leftCol = this.leftCol;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}else{\n\t\t\t\t\tworking = false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tworking = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(changes){\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\n\t\t}\n\t}\n\t\n\tfitDataColActualWidthCheck(column){\n\t\tvar newWidth, widthDiff;\n\t\t\n\t\tif(column.modules.vdomHoz.fitDataCheck){\n\t\t\tcolumn.reinitializeWidth();\n\t\t\t\n\t\t\tnewWidth = column.getWidth();\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\n\t\t\t\n\t\t\tif(widthDiff){\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\n\t\t\t}\n\t\t\t\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\n\t\t}\n\t\t\n\t\treturn widthDiff;\n\t}\n\t\n\tinitializeRow(row){\n\t\tif(row.type !== \"group\"){\n\t\t\trow.modules.vdomHoz = {\n\t\t\t\tleftCol:this.leftCol,\n\t\t\t\trightCol:this.rightCol,\n\t\t\t};\n\n\t\t\tif(this.table.modules.frozenColumns){\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((column) => {\n\t\t\t\t\tthis.appendCell(row, column);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\n\t\t\t\tthis.appendCell(row, this.columns[i]);\n\t\t\t}\n\n\t\t\tif(this.table.modules.frozenColumns){\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((column) => {\n\t\t\t\t\tthis.appendCell(row, column);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\t\n\tappendCell(row, column){\n\t\tif(column && column.visible){\n\t\t\tlet cell = row.getCell(column);\n\t\t\t\n\t\t\trow.getElement().appendChild(cell.getElement());\n\t\t\tcell.cellRendered();\n\t\t}\n\t}\n\t\n\treinitializeRow(row, force){\n\t\tif(row.type !== \"group\"){\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\n\t\t\t\t\n\t\t\t\tvar rowEl = row.getElement();\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\n\n\t\t\t\tthis.initializeRow(row);\n\t\t\t}\n\t\t}\n\t}\n}","import CoreFeature from './CoreFeature.js';\nimport Column from './column/Column.js';\nimport ColumnComponent from './column/ColumnComponent.js';\nimport Helpers from './tools/Helpers.js';\nimport OptionsList from './tools/OptionsList.js';\n\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\n\nimport defaultColumnOptions from './column/defaults/options.js';\n\nexport default class ColumnManager extends CoreFeature {\n\t\n\tconstructor (table){\n\t\tsuper(table);\n\t\t\n\t\tthis.blockHozScrollEvent = false;\n\t\tthis.headersElement = null;\n\t\tthis.contentsElement = null;\n\t\tthis.element = null ; //containing element\n\t\tthis.columns = []; // column definition object\n\t\tthis.columnsByIndex = []; //columns by index\n\t\tthis.columnsByField = {}; //columns by field\n\t\tthis.scrollLeft = 0;\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\n\t\t\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\n\t\tthis.redrawBlockUpdate = null; //store latest redraw update only status\n\t\t\n\t\tthis.renderer = null;\n\t}\n\t\n\t////////////// Setup Functions /////////////////\n\t\n\tinitialize(){\n\t\tthis.initializeRenderer();\n\t\t\n\t\tthis.headersElement = this.createHeadersElement();\n\t\tthis.contentsElement = this.createHeaderContentsElement();\n\t\tthis.element = this.createHeaderElement();\n\t\t\n\t\tthis.contentsElement.insertBefore(this.headersElement, this.contentsElement.firstChild);\n\t\tthis.element.insertBefore(this.contentsElement, this.element.firstChild);\n\t\t\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\n\t\tthis.subscribe(\"scrollbar-vertical\", this.padVerticalScrollbar.bind(this));\n\t}\n\n\tpadVerticalScrollbar(width){\n\t\tif(this.table.rtl){\n\t\t\tthis.headersElement.style.marginLeft = width + \"px\";\n\t\t}else{\n\t\t\tthis.headersElement.style.marginRight = width + \"px\";\n\t\t}\n\t}\n\t\n\tinitializeRenderer(){\n\t\tvar renderClass;\n\t\t\n\t\tvar renderers = {\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\n\t\t\t\"basic\": RendererBasicHorizontal,\n\t\t};\n\t\t\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\n\t\t}else{\n\t\t\trenderClass = this.table.options.renderHorizontal;\n\t\t}\n\t\t\n\t\tif(renderClass){\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\n\t\t\tthis.renderer.initialize();\n\t\t}else{\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderHorizontal);\n\t\t}\n\t}\n\t\n\t\n\tcreateHeadersElement (){\n\t\tvar el = document.createElement(\"div\");\n\t\t\n\t\tel.classList.add(\"tabulator-headers\");\n\t\tel.setAttribute(\"role\", \"row\");\n\t\t\n\t\treturn el;\n\t}\n\n\tcreateHeaderContentsElement (){\n\t\tvar el = document.createElement(\"div\");\n\t\t\n\t\tel.classList.add(\"tabulator-header-contents\");\n\t\tel.setAttribute(\"role\", \"rowgroup\");\n\t\t\n\t\treturn el;\n\t}\n\t\n\tcreateHeaderElement (){\n\t\tvar el = document.createElement(\"div\");\n\t\t\n\t\tel.classList.add(\"tabulator-header\");\n\t\tel.setAttribute(\"role\", \"rowgroup\");\n\t\t\n\t\tif(!this.table.options.headerVisible){\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\n\t\t}\n\t\t\n\t\treturn el;\n\t}\n\t\n\t//return containing element\n\tgetElement(){\n\t\treturn this.element;\n\t}\n\n\t//return containing contents element\n\tgetContentsElement(){\n\t\treturn this.contentsElement;\n\t}\n\t\n\t\n\t//return header containing element\n\tgetHeadersElement(){\n\t\treturn this.headersElement;\n\t}\n\t\n\t//scroll horizontally to match table body\n\tscrollHorizontal(left){\n\t\tthis.contentsElement.scrollLeft = left;\n\n\t\tthis.scrollLeft = left;\n\t\t\n\t\tthis.renderer.scrollColumns(left);\n\t}\n\t\n\t///////////// Column Setup Functions /////////////\n\tgenerateColumnsFromRowData(data){\n\t\tvar cols = [],\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\n\t\trow, sorter;\n\t\t\n\t\tif(data && data.length){\n\t\t\t\n\t\t\trow = data[0];\n\t\t\t\n\t\t\tfor(var key in row){\n\t\t\t\tlet col = {\n\t\t\t\t\tfield:key,\n\t\t\t\t\ttitle:key,\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tlet value = row[key];\n\t\t\t\t\n\t\t\t\tswitch(typeof value){\n\t\t\t\t\tcase \"undefined\":\n\t\t\t\t\t\tsorter = \"string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"boolean\":\n\t\t\t\t\t\tsorter = \"boolean\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\tif(Array.isArray(value)){\n\t\t\t\t\t\t\tsorter = \"array\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tsorter = \"string\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\n\t\t\t\t\t\t\tsorter = \"number\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tsorter = \"string\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcol.sorter = sorter;\n\t\t\t\t\n\t\t\t\tcols.push(col);\n\t\t\t}\n\t\t\t\n\t\t\tif(definitions){\n\t\t\t\t\n\t\t\t\tswitch(typeof definitions){\n\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\tif(Array.isArray(definitions)){\n\t\t\t\t\t\t\tcols.forEach((col) => {\n\t\t\t\t\t\t\t\tvar match = definitions.find((def) => {\n\t\t\t\t\t\t\t\t\treturn def.field === col.field;\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(match){\n\t\t\t\t\t\t\t\t\tObject.assign(col, match);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcols.forEach((col) => {\n\t\t\t\t\t\t\t\tif(definitions[col.field]){\n\t\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.table.options.columns = cols;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthis.table.options.columns = cols;\n\t\t\t}\n\t\t\t\n\t\t\tthis.setColumns(this.table.options.columns);\n\t\t}\n\t}\n\t\n\tsetColumns(cols, row){\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\n\t\t\n\t\tthis.columns = [];\n\t\tthis.columnsByIndex = [];\n\t\tthis.columnsByField = {};\n\t\t\n\t\tthis.dispatch(\"columns-loading\");\n\t\t\n\t\tcols.forEach((def, i) => {\n\t\t\tthis._addColumn(def);\n\t\t});\n\t\t\n\t\tthis._reIndexColumns();\n\t\t\n\t\tthis.dispatch(\"columns-loaded\");\n\t\t\n\t\tthis.rerenderColumns(false, true);\n\t\t\n\t\tthis.redraw(true);\n\t}\n\t\n\t_addColumn(definition, before, nextToColumn){\n\t\tvar column = new Column(definition, this),\n\t\tcolEl = column.getElement(),\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\n\t\t\n\t\tif(nextToColumn && index > -1){\n\t\t\tvar topColumn = nextToColumn.getTopColumn();\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\n\t\t\tvar nextEl = topColumn.getElement();\n\t\t\t\n\t\t\tif(before){\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\n\t\t\t}else{\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\n\t\t\t}\n\t\t}else{\n\t\t\tif(before){\n\t\t\t\tthis.columns.unshift(column);\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\n\t\t\t}else{\n\t\t\t\tthis.columns.push(column);\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\n\t\t\t}\n\t\t}\n\t\t\n\t\tcolumn.columnRendered();\n\t\t\n\t\treturn column;\n\t}\n\t\n\tregisterColumnField(col){\n\t\tif(col.definition.field){\n\t\t\tthis.columnsByField[col.definition.field] = col;\n\t\t}\n\t}\n\t\n\tregisterColumnPosition(col){\n\t\tthis.columnsByIndex.push(col);\n\t}\n\t\n\t_reIndexColumns(){\n\t\tthis.columnsByIndex = [];\n\t\t\n\t\tthis.columns.forEach(function(column){\n\t\t\tcolumn.reRegisterPosition();\n\t\t});\n\t}\n\t\n\t//ensure column headers take up the correct amount of space in column groups\n\tverticalAlignHeaders(){\n\t\tvar minHeight = 0;\n\t\t\n\t\tif(!this.redrawBlock){\n\n\t\t\tthis.headersElement.style.height=\"\";\n\t\t\t\n\t\t\tthis.columns.forEach((column) => {\n\t\t\t\tcolumn.clearVerticalAlign();\n\t\t\t});\n\t\t\t\n\t\t\tthis.columns.forEach((column) => {\n\t\t\t\tvar height = column.getHeight();\n\t\t\t\t\n\t\t\t\tif(height > minHeight){\n\t\t\t\t\tminHeight = height;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis.headersElement.style.height = minHeight + \"px\";\n\n\t\t\tthis.columns.forEach((column) => {\n\t\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\n\t\t\t});\n\t\t\t\n\t\t\tthis.table.rowManager.adjustTableSize();\n\t\t}\n\t}\n\t\n\t//////////////// Column Details /////////////////\n\tfindColumn(subject){\n\t\tvar columns;\n\n\t\tif(typeof subject == \"object\"){\n\t\t\t\n\t\t\tif(subject instanceof Column){\n\t\t\t\t//subject is column element\n\t\t\t\treturn subject;\n\t\t\t}else if(subject instanceof ColumnComponent){\n\t\t\t\t//subject is public column component\n\t\t\t\treturn subject._getSelf() || false;\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\n\n\t\t\t\tcolumns = [];\n\n\t\t\t\tthis.columns.forEach((column) => {\n\t\t\t\t\tcolumns.push(column);\n\t\t\t\t\tcolumns = columns.concat(column.getColumns(true));\n\t\t\t\t});\n\n\t\t\t\t//subject is a HTML element of the column header\n\t\t\t\tlet match = columns.find((column) => {\n\t\t\t\t\treturn column.element === subject;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\treturn match || false;\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t//subject should be treated as the field name of the column\n\t\t\treturn this.columnsByField[subject] || false;\n\t\t}\n\t\t\n\t\t//catch all for any other type of input\n\t\treturn false;\n\t}\n\t\n\tgetColumnByField(field){\n\t\treturn this.columnsByField[field];\n\t}\n\t\n\tgetColumnsByFieldRoot(root){\n\t\tvar matches = [];\n\t\t\n\t\tObject.keys(this.columnsByField).forEach((field) => {\n\t\t\tvar fieldRoot = field.split(\".\")[0];\n\t\t\tif(fieldRoot === root){\n\t\t\t\tmatches.push(this.columnsByField[field]);\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn matches;\n\t}\n\t\n\tgetColumnByIndex(index){\n\t\treturn this.columnsByIndex[index];\n\t}\n\t\n\tgetFirstVisibleColumn(){\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\n\t\t\treturn col.visible;\n\t\t});\n\t\t\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\n\t}\n\t\n\tgetColumns(){\n\t\treturn this.columns;\n\t}\n\t\n\tfindColumnIndex(column){\n\t\treturn this.columnsByIndex.findIndex((col) => {\n\t\t\treturn column === col;\n\t\t});\n\t}\n\t\n\t//return all columns that are not groups\n\tgetRealColumns(){\n\t\treturn this.columnsByIndex;\n\t}\n\t\n\t//traverse across columns and call action\n\ttraverse(callback){\n\t\tthis.columnsByIndex.forEach((column,i) =>{\n\t\t\tcallback(column, i);\n\t\t});\n\t}\n\t\n\t//get definitions of actual columns\n\tgetDefinitions(active){\n\t\tvar output = [];\n\t\t\n\t\tthis.columnsByIndex.forEach((column) => {\n\t\t\tif(!active || (active && column.visible)){\n\t\t\t\toutput.push(column.getDefinition());\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn output;\n\t}\n\t\n\t//get full nested definition tree\n\tgetDefinitionTree(){\n\t\tvar output = [];\n\t\t\n\t\tthis.columns.forEach((column) => {\n\t\t\toutput.push(column.getDefinition(true));\n\t\t});\n\t\t\n\t\treturn output;\n\t}\n\t\n\tgetComponents(structured){\n\t\tvar output = [],\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\n\t\t\n\t\tcolumns.forEach((column) => {\n\t\t\toutput.push(column.getComponent());\n\t\t});\n\t\t\n\t\treturn output;\n\t}\n\t\n\tgetWidth(){\n\t\tvar width = 0;\n\t\t\n\t\tthis.columnsByIndex.forEach((column) => {\n\t\t\tif(column.visible){\n\t\t\t\twidth += column.getWidth();\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn width;\n\t}\n\t\n\tmoveColumn(from, to, after){\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\n\t\t\n\t\tif(after){\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\n\t\t}\n\t\t\n\t\tthis.moveColumnActual(from, to, after);\n\n\t\tthis.verticalAlignHeaders();\n\t\t\n\t\tthis.table.rowManager.reinitialize();\n\t}\n\t\n\tmoveColumnActual(from, to, after){\n\t\tif(from.parent.isGroup){\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\n\t\t}else{\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\n\t\t}\n\t\t\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\n\t\t\n\t\tthis.rerenderColumns(true);\n\t\t\n\t\tthis.dispatch(\"column-moved\", from, to, after);\n\t\t\n\t\tif(this.subscribedExternal(\"columnMoved\")){\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\n\t\t}\n\t}\n\t\n\t_moveColumnInArray(columns, from, to, after, updateRows){\n\t\tvar\tfromIndex = columns.indexOf(from),\n\t\ttoIndex, rows = [];\n\t\t\n\t\tif (fromIndex > -1) {\n\t\t\t\n\t\t\tcolumns.splice(fromIndex, 1);\n\t\t\t\n\t\t\ttoIndex = columns.indexOf(to);\n\t\t\t\n\t\t\tif (toIndex > -1) {\n\t\t\t\t\n\t\t\t\tif(after){\n\t\t\t\t\ttoIndex = toIndex+1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\ttoIndex = fromIndex;\n\t\t\t}\n\t\t\t\n\t\t\tcolumns.splice(toIndex, 0, from);\n\t\t\t\n\t\t\tif(updateRows){\n\t\t\t\t\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\n\t\t\t\t\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\n\t\t\t\t\n\t\t\t\trows.forEach(function(row){\n\t\t\t\t\tif(row.cells.length){\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\tscrollToColumn(column, position, ifVisible){\n\t\tvar left = 0,\n\t\toffset = column.getLeftOffset(),\n\t\tadjust = 0,\n\t\tcolEl = column.getElement();\n\t\t\n\t\t\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t\n\t\t\tif(typeof position === \"undefined\"){\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\n\t\t\t}\n\t\t\t\n\t\t\tif(typeof ifVisible === \"undefined\"){\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\n\t\t\t}\n\t\t\t\n\t\t\tif(column.visible){\n\t\t\t\t\n\t\t\t\t//align to correct position\n\t\t\t\tswitch(position){\n\t\t\t\t\tcase \"middle\":\n\t\t\t\t\tcase \"center\":\n\t\t\t\t\t\tadjust = -this.element.clientWidth / 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"right\":\n\t\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//check column visibility\n\t\t\t\tif(!ifVisible){\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//calculate scroll position\n\t\t\t\tleft = offset + adjust;\n\t\t\t\t\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\n\t\t\t\t\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\n\t\t\t\tthis.scrollHorizontal(left);\n\t\t\t\t\n\t\t\t\tresolve();\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\n\t\t\t\treject(\"Scroll Error - Column not visible\");\n\t\t\t}\n\t\t\t\n\t\t});\n\t}\n\t\n\t//////////////// Cell Management /////////////////\n\tgenerateCells(row){\n\t\tvar cells = [];\n\t\t\n\t\tthis.columnsByIndex.forEach((column) => {\n\t\t\tcells.push(column.generateCell(row));\n\t\t});\n\t\t\n\t\treturn cells;\n\t}\n\t\n\t//////////////// Column Management /////////////////\n\tgetFlexBaseWidth(){\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\n\t\tfixedWidth = 0;\n\t\t\n\t\t//adjust for vertical scrollbar if present\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\n\t\t}\n\t\t\n\t\tthis.columnsByIndex.forEach(function(column){\n\t\t\tvar width, minWidth, colWidth;\n\t\t\t\n\t\t\tif(column.visible){\n\t\t\t\t\n\t\t\t\twidth = column.definition.width || 0;\n\t\t\t\t\n\t\t\t\tminWidth = parseInt(column.minWidth);\n\t\t\t\t\n\t\t\t\tif(typeof(width) == \"string\"){\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tcolWidth = parseInt(width);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tcolWidth = width;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\n\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn fixedWidth;\n\t}\n\t\n\taddColumn(definition, before, nextToColumn){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\n\t\t\t\n\t\t\tthis._reIndexColumns();\n\t\t\t\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\n\t\t\t\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\n\t\t\t\tcolumn.reinitializeWidth();\n\t\t\t}\n\t\t\t\n\t\t\tthis.redraw(true);\n\t\t\t\n\t\t\tthis.table.rowManager.reinitialize();\n\t\t\t\n\t\t\tthis.rerenderColumns();\n\t\t\t\n\t\t\tresolve(column);\n\t\t});\n\t}\n\t\n\t//remove column from system\n\tderegisterColumn(column){\n\t\tvar field = column.getField(),\n\t\tindex;\n\t\t\n\t\t//remove from field list\n\t\tif(field){\n\t\t\tdelete this.columnsByField[field];\n\t\t}\n\t\t\n\t\t//remove from index list\n\t\tindex = this.columnsByIndex.indexOf(column);\n\t\t\n\t\tif(index > -1){\n\t\t\tthis.columnsByIndex.splice(index, 1);\n\t\t}\n\t\t\n\t\t//remove from column list\n\t\tindex = this.columns.indexOf(column);\n\t\t\n\t\tif(index > -1){\n\t\t\tthis.columns.splice(index, 1);\n\t\t}\n\t\t\n\t\tthis.verticalAlignHeaders();\n\t\t\n\t\tthis.redraw();\n\t}\n\t\n\trerenderColumns(update, silent){\n\t\tif(!this.redrawBlock){\n\t\t\tthis.renderer.rerenderColumns(update, silent);\n\t\t}else{\n\t\t\tif(update === false || (update === true && this.redrawBlockUpdate === null)){\n\t\t\t\tthis.redrawBlockUpdate = update;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tblockRedraw(){\n\t\tthis.redrawBlock = true;\n\t\tthis.redrawBlockUpdate = null;\n\t}\n\t\n\trestoreRedraw(){\n\t\tthis.redrawBlock = false;\n\t\tthis.verticalAlignHeaders();\n\t\tthis.renderer.rerenderColumns(this.redrawBlockUpdate);\n\t\t\n\t}\n\t\n\t//redraw columns\n\tredraw(force){\n\t\tif(Helpers.elVisible(this.element)){\n\t\t\tthis.verticalAlignHeaders();\n\t\t}\n\t\t\n\t\tif(force){\n\t\t\tthis.table.rowManager.resetScroll();\n\t\t\tthis.table.rowManager.reinitialize();\n\t\t}\n\t\t\n\t\tif(!this.confirm(\"table-redrawing\", force)){\n\t\t\tthis.layoutRefresh(force);\n\t\t}\n\t\t\n\t\tthis.dispatch(\"table-redraw\", force);\n\t\t\n\t\tthis.table.footerManager.redraw();\n\t}\n}","//public row object\nexport default class RowComponent {\n\n\tconstructor (row){\n\t\tthis._row = row;\n\n\t\treturn new Proxy(this, {\n\t\t\tget: function(target, name, receiver) {\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\n\t\t\t\t\treturn target[name];\n\t\t\t\t}else{\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tgetData(transform){\n\t\treturn this._row.getData(transform);\n\t}\n\n\tgetElement(){\n\t\treturn this._row.getElement();\n\t}\n\n\tgetCells(){\n\t\tvar cells = [];\n\n\t\tthis._row.getCells().forEach(function(cell){\n\t\t\tcells.push(cell.getComponent());\n\t\t});\n\n\t\treturn cells;\n\t}\n\n\tgetCell(column){\n\t\tvar cell = this._row.getCell(column);\n\t\treturn cell ? cell.getComponent() : false;\n\t}\n\n\tgetIndex(){\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\n\t}\n\n\tgetPosition(){\n\t\treturn this._row.getPosition();\n\t}\n\n\twatchPosition(callback){\n\t\treturn this._row.watchPosition(callback);\n\t}\n\n\tdelete(){\n\t\treturn this._row.delete();\n\t}\n\n\tscrollTo(){\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\n\t}\n\n\tmove(to, after){\n\t\tthis._row.moveToRow(to, after);\n\t}\n\n\tupdate(data){\n\t\treturn this._row.updateData(data);\n\t}\n\n\tnormalizeHeight(){\n\t\tthis._row.normalizeHeight(true);\n\t}\n\n\t_getSelf(){\n\t\treturn this._row;\n\t}\n\n\treformat(){\n\t\treturn this._row.reinitialize();\n\t}\n\n\tgetTable(){\n\t\treturn this._row.table;\n\t}\n\n\tgetNextRow(){\n\t\tvar row = this._row.nextRow();\n\t\treturn row ? row.getComponent() : row;\n\t}\n\n\tgetPrevRow(){\n\t\tvar row = this._row.prevRow();\n\t\treturn row ? row.getComponent() : row;\n\t}\n}","import CoreFeature from '../CoreFeature.js';\nimport RowComponent from './RowComponent.js';\nimport Helpers from '../tools/Helpers.js';\n\nexport default class Row extends CoreFeature{\n\tconstructor (data, parent, type = \"row\"){\n\t\tsuper(parent.table);\n\t\t\n\t\tthis.parent = parent;\n\t\tthis.data = {};\n\t\tthis.type = type; //type of element\n\t\tthis.element = false;\n\t\tthis.modules = {}; //hold module variables;\n\t\tthis.cells = [];\n\t\tthis.height = 0; //hold element height\n\t\tthis.heightStyled = \"\"; //hold element height pre-styled to improve render efficiency\n\t\tthis.manualHeight = false; //user has manually set row height\n\t\tthis.outerHeight = 0; //hold elements outer height\n\t\tthis.initialized = false; //element has been rendered\n\t\tthis.heightInitialized = false; //element has resized cells to fit\n\t\tthis.position = 0; //store position of element in row list\n\t\tthis.positionWatchers = [];\n\t\t\n\t\tthis.component = null;\n\t\t\n\t\tthis.created = false;\n\t\t\n\t\tthis.setData(data);\n\t}\n\t\n\tcreate(){\n\t\tif(!this.created){\n\t\t\tthis.created = true;\n\t\t\tthis.generateElement();\n\t\t}\n\t}\n\t\n\tcreateElement (){\n\t\tvar el = document.createElement(\"div\");\n\t\t\n\t\tel.classList.add(\"tabulator-row\");\n\t\tel.setAttribute(\"role\", \"row\");\n\t\t\n\t\tthis.element = el;\n\t}\n\t\n\tgetElement(){\n\t\tthis.create();\n\t\treturn this.element;\n\t}\n\t\n\tdetachElement(){\n\t\tif (this.element && this.element.parentNode){\n\t\t\tthis.element.parentNode.removeChild(this.element);\n\t\t}\n\t}\n\t\n\tgenerateElement(){\n\t\tthis.createElement();\n\t\tthis.dispatch(\"row-init\", this);\n\t}\n\t\n\tgenerateCells(){\n\t\tthis.cells = this.table.columnManager.generateCells(this);\n\t}\n\t\n\t//functions to setup on first render\n\tinitialize(force){\n\t\tthis.create();\n\t\t\n\t\tif(!this.initialized || force){\n\t\t\t\n\t\t\tthis.deleteCells();\n\t\t\t\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\n\t\t\t\n\t\t\tthis.dispatch(\"row-layout-before\", this);\n\t\t\t\n\t\t\tthis.generateCells();\n\t\t\t\n\t\t\tthis.initialized = true;\n\t\t\t\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\n\t\t\t\n\t\t\tif(force){\n\t\t\t\tthis.normalizeHeight();\n\t\t\t}\n\t\t\t\n\t\t\tthis.dispatch(\"row-layout\", this);\n\t\t\t\n\t\t\tif(this.table.options.rowFormatter){\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\n\t\t\t}\n\t\t\t\n\t\t\tthis.dispatch(\"row-layout-after\", this);\n\t\t}else{\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\n\t\t}\n\t}\n\t\n\treinitializeHeight(){\n\t\tthis.heightInitialized = false;\n\t\t\n\t\tif(this.element && this.element.offsetParent !== null){\n\t\t\tthis.normalizeHeight(true);\n\t\t}\n\t}\n\n\tdeinitialize(){\n\t\tthis.initialized = false;\n\t}\n\t\n\tdeinitializeHeight(){\n\t\tthis.heightInitialized = false;\n\t}\n\t\n\treinitialize(children){\n\t\tthis.initialized = false;\n\t\tthis.heightInitialized = false;\n\t\t\n\t\tif(!this.manualHeight){\n\t\t\tthis.height = 0;\n\t\t\tthis.heightStyled = \"\";\n\t\t}\n\t\t\n\t\tif(this.element && this.element.offsetParent !== null){\n\t\t\tthis.initialize(true);\n\t\t}\n\t\t\n\t\tthis.dispatch(\"row-relayout\", this);\n\t}\n\t\n\t//get heights when doing bulk row style calcs in virtual DOM\n\tcalcHeight(force){\n\t\tvar maxHeight = 0,\n\t\tminHeight;\n\t\t\n\t\tif(this.table.options.rowHeight){\n\t\t\tthis.height = this.table.options.rowHeight;\n\t\t}else{\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\n\t\t\t\n\t\t\tthis.cells.forEach(function(cell){\n\t\t\t\tvar height = cell.getHeight();\n\t\t\t\tif(height > maxHeight){\n\t\t\t\t\tmaxHeight = height;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tif(force){\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\n\t\t\t}else{\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\n\t\tthis.outerHeight = this.element.offsetHeight;\n\t}\n\t\n\t//set of cells\n\tsetCellHeight(){\n\t\tthis.cells.forEach(function(cell){\n\t\t\tcell.setHeight();\n\t\t});\n\t\t\n\t\tthis.heightInitialized = true;\n\t}\n\t\n\tclearCellHeight(){\n\t\tthis.cells.forEach(function(cell){\n\t\t\tcell.clearHeight();\n\t\t});\n\t}\n\t\n\t//normalize the height of elements in the row\n\tnormalizeHeight(force){\n\t\tif(force && !this.table.options.rowHeight){\n\t\t\tthis.clearCellHeight();\n\t\t}\n\t\t\n\t\tthis.calcHeight(force);\n\t\t\n\t\tthis.setCellHeight();\n\t}\n\t\n\t//set height of rows\n\tsetHeight(height, force){\n\t\tif(this.height != height || force){\n\t\t\t\n\t\t\tthis.manualHeight = true;\n\t\t\t\n\t\t\tthis.height = height;\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\n\t\t\t\n\t\t\tthis.setCellHeight();\n\t\t\t\n\t\t\t// this.outerHeight = this.element.outerHeight();\n\t\t\tthis.outerHeight = this.element.offsetHeight;\n\t\t}\n\t}\n\t\n\t//return rows outer height\n\tgetHeight(){\n\t\treturn this.outerHeight;\n\t}\n\t\n\t//return rows outer Width\n\tgetWidth(){\n\t\treturn this.element.offsetWidth;\n\t}\n\t\n\t//////////////// Cell Management /////////////////\n\tdeleteCell(cell){\n\t\tvar index = this.cells.indexOf(cell);\n\t\t\n\t\tif(index > -1){\n\t\t\tthis.cells.splice(index, 1);\n\t\t}\n\t}\n\t\n\t//////////////// Data Management /////////////////\n\tsetData(data){\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\n\t\t\n\t\tthis.dispatch(\"row-data-init-after\", this);\n\t}\n\t\n\t//update the rows data\n\tupdateData(updatedData){\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\n\t\ttempData = {},\n\t\tnewRowData;\n\t\t\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t\n\t\t\tif(typeof updatedData === \"string\"){\n\t\t\t\tupdatedData = JSON.parse(updatedData);\n\t\t\t}\n\t\t\t\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\n\t\t\t\n\t\t\tif(this.subscribed(\"row-data-changing\")){\n\t\t\t\ttempData = Object.assign(tempData, this.data);\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\n\t\t\t}\n\t\t\t\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\n\t\t\t\n\t\t\t//set data\n\t\t\tfor (let attrname in newRowData) {\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\n\t\t\t}\n\t\t\t\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\n\t\t\t\n\t\t\t//update affected cells only\n\t\t\tfor (let attrname in updatedData) {\n\t\t\t\t\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\n\t\t\t\t\n\t\t\t\tcolumns.forEach((column) => {\n\t\t\t\t\tlet cell = this.getCell(column.getField());\n\t\t\t\t\t\n\t\t\t\t\tif(cell){\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\n\t\t\t\t\t\tif(cell.getValue() !== value){\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(visible){\n\t\t\t\t\t\t\t\tcell.cellRendered();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t//Partial reinitialization if visible\n\t\t\tif(visible){\n\t\t\t\tthis.normalizeHeight(true);\n\t\t\t\t\n\t\t\t\tif(this.table.options.rowFormatter){\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthis.initialized = false;\n\t\t\t\tthis.height = 0;\n\t\t\t\tthis.heightStyled = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\n\t\t\t\n\t\t\t//this.reinitialize();\n\t\t\t\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\n\t\t\t\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\n\t\t\t}\n\t\t\t\n\t\t\tresolve();\n\t\t});\n\t}\n\t\n\tgetData(transform){\n\t\tif(transform){\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\n\t\t}\n\t\t\n\t\treturn this.data;\n\t}\n\t\n\tgetCell(column){\n\t\tvar match = false;\n\t\t\n\t\tcolumn = this.table.columnManager.findColumn(column);\n\t\t\n\t\tif(!this.initialized && this.cells.length === 0){\n\t\t\tthis.generateCells();\n\t\t}\n\t\t\n\t\tmatch = this.cells.find(function(cell){\n\t\t\treturn cell.column === column;\n\t\t});\n\t\t\n\t\treturn match;\n\t}\n\t\n\tgetCellIndex(findCell){\n\t\treturn this.cells.findIndex(function(cell){\n\t\t\treturn cell === findCell;\n\t\t});\n\t}\n\t\n\tfindCell(subject){\n\t\treturn this.cells.find((cell) => {\n\t\t\treturn cell.element === subject;\n\t\t});\n\t}\n\t\n\tgetCells(){\n\t\tif(!this.initialized && this.cells.length === 0){\n\t\t\tthis.generateCells();\n\t\t}\n\t\t\n\t\treturn this.cells;\n\t}\n\t\n\tnextRow(){\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\n\t\treturn row || false;\n\t}\n\t\n\tprevRow(){\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\n\t\treturn row || false;\n\t}\n\t\n\tmoveToRow(to, before){\n\t\tvar toRow = this.table.rowManager.findRow(to);\n\t\t\n\t\tif(toRow){\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\n\t\t}else{\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\n\t\t}\n\t}\n\t\n\t///////////////////// Actions /////////////////////\n\tdelete(){\n\t\tthis.dispatch(\"row-delete\", this);\n\t\t\n\t\tthis.deleteActual();\n\t\t\n\t\treturn Promise.resolve();\n\t}\n\t\n\tdeleteActual(blockRedraw){\n\t\tthis.detachModules();\n\t\t\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\n\t\t\n\t\tthis.deleteCells();\n\t\t\n\t\tthis.initialized = false;\n\t\tthis.heightInitialized = false;\n\t\tthis.element = false;\n\t\t\n\t\tthis.dispatch(\"row-deleted\", this);\n\t}\n\t\n\tdetachModules(){\n\t\tthis.dispatch(\"row-deleting\", this);\n\t}\n\t\n\tdeleteCells(){\n\t\tvar cellCount = this.cells.length;\n\t\t\n\t\tfor(let i = 0; i < cellCount; i++){\n\t\t\tthis.cells[0].delete();\n\t\t}\n\t}\n\t\n\twipe(){\n\t\tthis.detachModules();\n\t\tthis.deleteCells();\n\t\t\n\t\tif(this.element){\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\n\t\t\t\n\t\t\tif(this.element.parentNode){\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.element = false;\n\t\tthis.modules = {};\n\t}\n\n\tisDisplayed(){\n\t\treturn this.table.rowManager.getDisplayRows().includes(this);\n\t}\n\n\tgetPosition(){\n\t\treturn this.isDisplayed() ? this.position : false;\n\t}\n\n\tsetPosition(position){\n\t\tif(position != this.position){\n\t\t\tthis.position = position;\n\n\t\t\tthis.positionWatchers.forEach((callback) => {\n\t\t\t\tcallback(this.position);\n\t\t\t});\n\t\t}\n\t}\n\n\twatchPosition(callback){\n\t\tthis.positionWatchers.push(callback);\n\n\t\tcallback(this.position);\n\t}\n\t\n\tgetGroup(){\n\t\treturn this.modules.group || false;\n\t}\n\t\n\t//////////////// Object Generation /////////////////\n\tgetComponent(){\n\t\tif(!this.component){\n\t\t\tthis.component = new RowComponent(this);\n\t\t}\n\t\t\n\t\treturn this.component;\n\t}\n}\n","import Renderer from '../Renderer.js';\nimport Helpers from '../../tools/Helpers.js';\n\nexport default class BasicVertical extends Renderer{\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.verticalFillMode = \"fill\";\n\n\t\tthis.scrollTop = 0;\n\t\tthis.scrollLeft = 0;\n\n\t\tthis.scrollTop = 0;\n\t\tthis.scrollLeft = 0;\n\t}\n\n\tclearRows(){\n\t\tvar element = this.tableElement;\n\n\t\t// element.children.detach();\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\n\n\t\telement.scrollTop = 0;\n\t\telement.scrollLeft = 0;\n\n\t\telement.style.minWidth = \"\";\n\t\telement.style.minHeight = \"\";\n\t\telement.style.display = \"\";\n\t\telement.style.visibility = \"\";\n\t}\n\n\trenderRows(){\n\t\tvar element = this.tableElement,\n\t\tonlyGroupHeaders = true;\n\n\t\tthis.rows().forEach((row, index) => {\n\t\t\tthis.styleRow(row, index);\n\t\t\telement.appendChild(row.getElement());\n\t\t\trow.initialize(true);\n\n\t\t\tif(row.type !== \"group\"){\n\t\t\t\tonlyGroupHeaders = false;\n\t\t\t}\n\t\t});\n\n\t\tif(onlyGroupHeaders){\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\n\t\t}else{\n\t\t\telement.style.minWidth = \"\";\n\t\t}\n\t}\n\n\n\trerenderRows(callback){\t\n\t\tthis.clearRows();\n\n\t\tif(callback){\n\t\t\tcallback();\n\t\t}\n\n\t\tthis.renderRows();\n\t}\n\n\tscrollToRowNearestTop(row){\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\n\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\n\t}\n\n\tscrollToRow(row){\n\t\tvar rowEl = row.getElement();\n\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\n\t}\n\n\tvisibleRows(includingBuffer){\n\t\treturn this.rows();\n\t}\n\n}","import Renderer from '../Renderer.js';\nimport Helpers from '../../tools/Helpers.js';\n\nexport default class VirtualDomVertical extends Renderer{\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.verticalFillMode = \"fill\";\n\n\t\tthis.scrollTop = 0;\n\t\tthis.scrollLeft = 0;\n\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\n\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\n\t\tthis.vDomBottom = 0; //hold position for last rendered row in the virtual DOM\n\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\n\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\n\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\n\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\n\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\n\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\n\t}\n\n\t//////////////////////////////////////\n\t///////// Public Functions ///////////\n\t//////////////////////////////////////\n\n\tclearRows(){\n\t\tvar element = this.tableElement;\n\n\t\t// element.children.detach();\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\n\n\t\telement.style.paddingTop = \"\";\n\t\telement.style.paddingBottom = \"\";\n\t\t// element.style.minWidth = \"\";\n\t\telement.style.minHeight = \"\";\n\t\telement.style.display = \"\";\n\t\telement.style.visibility = \"\";\n\n\t\tthis.elementVertical.scrollTop = 0;\n\t\tthis.elementVertical.scrollLeft = 0;\n\n\t\tthis.scrollTop = 0;\n\t\tthis.scrollLeft = 0;\n\n\t\tthis.vDomTop = 0;\n\t\tthis.vDomBottom = 0;\n\t\tthis.vDomTopPad = 0;\n\t\tthis.vDomBottomPad = 0;\n\t\tthis.vDomScrollPosTop = 0;\n\t\tthis.vDomScrollPosBottom = 0;\n\t}\n\n\trenderRows(){\n\t\tthis._virtualRenderFill();\n\t}\n\n\trerenderRows(callback){\n\t\tvar scrollTop = this.elementVertical.scrollTop;\n\t\tvar topRow = false;\n\t\tvar topOffset = false;\n\n\t\tvar left = this.table.rowManager.scrollLeft;\n\n\t\tvar rows = this.rows();\n\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\n\n\t\t\tif(rows[i]){\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\n\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\n\t\t\t\t\ttopOffset = diff;\n\t\t\t\t\ttopRow = i;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\trows.forEach((row) => {\n\t\t\trow.deinitializeHeight();\n\t\t});\n\n\t\tif(callback){\n\t\t\tcallback();\n\t\t}\n\n\t\tif(this.rows().length){\n\t\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\n\t\t}else{\n\t\t\tthis.clear();\n\t\t\tthis.table.rowManager.tableEmpty();\n\t\t}\n\n\t\tthis.scrollColumns(left);\n\t}\n\n\tscrollColumns(left){\n\t\tthis.table.rowManager.scrollHorizontal(left);\n\t}\n\n\tscrollRows(top, dir){\n\t\tvar topDiff = top - this.vDomScrollPosTop;\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\n\t\tvar margin = this.vDomWindowBuffer * 2;\n\t\tvar rows = this.rows();\n\n\t\tthis.scrollTop = top;\n\n\t\tif(-topDiff > margin || bottomDiff > margin){\n\t\t\t//if big scroll redraw table;\n\t\t\tvar left = this.table.rowManager.scrollLeft;\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\n\t\t\tthis.scrollColumns(left);\n\t\t}else{\n\n\t\t\tif(dir){\n\t\t\t\t//scrolling up\n\t\t\t\tif(topDiff < 0){\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\n\t\t\t\t}\n\n\t\t\t\tif(bottomDiff < 0){\n\t\t\t\t\t//hide bottom row if needed\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\n\t\t\t\tif(bottomDiff >= 0){\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\n\t\t\t\t}\n\n\t\t\t\t//scrolling down\n\t\t\t\tif(topDiff >= 0){\n\t\t\t\t\t//hide top row if needed\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tresize(){\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\n\t}\n\n\tscrollToRowNearestTop(row){\n\t\tvar rowIndex = this.rows().indexOf(row);\n\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\n\t}\n\n\tscrollToRow(row){\n\t\tvar index = this.rows().indexOf(row);\n\n\t\tif(index > -1){\n\t\t\tthis._virtualRenderFill(index, true);\n\t\t}\n\t}\n\n\tvisibleRows(includingBuffer){\n\t\tvar topEdge = this.elementVertical.scrollTop,\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\n\t\ttopFound = false,\n\t\ttopRow = 0,\n\t\tbottomRow = 0,\n\t\trows = this.rows();\n\n\t\tif(includingBuffer){\n\t\t\ttopRow = this.vDomTop;\n\t\t\tbottomRow = this.vDomBottom;\n\t\t}else{\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\n\t\t\t\tif(rows[i]){\n\t\t\t\t\tif(!topFound){\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\n\t\t\t\t\t\t\ttopRow = i;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\ttopFound = true;\n\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\n\t\t\t\t\t\t\t\tbottomRow = i;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\n\t\t\t\t\t\t\tbottomRow = i;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn rows.slice(topRow, bottomRow + 1);\n\t}\n\n\t//////////////////////////////////////\n\t//////// Internal Rendering //////////\n\t//////////////////////////////////////\n\n\t//full virtual render\n\t_virtualRenderFill(position, forceMove, offset){\n\t\tvar\telement = this.tableElement,\n\t\tholder = this.elementVertical,\n\t\ttopPad = 0,\n\t\trowsHeight = 0,\n\t\theightOccupied = 0,\n\t\ttopPadHeight = 0,\n\t\ti = 0,\n\t\trows = this.rows(),\n\t\trowsCount = rows.length,\n\t\tcontainerHeight = this.elementVertical.clientHeight;\n\n\t\tposition = position || 0;\n\n\t\toffset = offset || 0;\n\n\t\tif(!position){\n\t\t\tthis.clear();\n\t\t}else{\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\n\n\t\t\t//check if position is too close to bottom of table\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\n\n\t\t\tif(heightOccupied < containerHeight){\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\n\t\t\t\tif(position < 0){\n\t\t\t\t\tposition = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//calculate initial pad\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\n\t\t\tposition -= topPad;\n\t\t}\n\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\n\t\t\tthis.vDomTop = position;\n\n\t\t\tthis.vDomBottom = position -1;\n\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\n\t\t\t\tvar index = this.vDomBottom + 1,\n\t\t\t\trow = rows[index],\n\t\t\t\trowHeight = 0;\n\n\t\t\t\tthis.styleRow(row, index);\n\n\t\t\t\telement.appendChild(row.getElement());\n\n\t\t\t\trow.initialize();\n\n\t\t\t\tif(!row.heightInitialized){\n\t\t\t\t\trow.normalizeHeight(true);\n\t\t\t\t}\n\n\t\t\t\trowHeight = row.getHeight();\n\n\t\t\t\tif(i < topPad){\n\t\t\t\t\ttopPadHeight += rowHeight;\n\t\t\t\t}else{\n\t\t\t\t\trowsHeight += rowHeight;\n\t\t\t\t}\n\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\n\t\t\t\t}\n\n\t\t\t\tthis.vDomBottom ++;\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\tif(!position){\n\t\t\t\tthis.vDomTopPad = 0;\n\t\t\t\t//adjust row height to match average of rendered elements\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\n\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\n\t\t\t}else{\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\n\t\t\t}\n\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\n\n\t\t\tif(forceMove){\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\n\t\t\t}\n\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\n\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.clientWidth && forceMove){\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\n\t\t\t}\n\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\n\n\t\t\tholder.scrollTop = this.scrollTop;\n\n\t\t\tthis.dispatch(\"render-virtual-fill\");\n\t\t}\n\t}\n\n\t_addTopRow(rows, fillableSpace){\n\t\tvar table = this.tableElement,\n\t\taddedRows = [],\n\t\tpaddingAdjust = 0,\n\t\tindex = this.vDomTop -1,\n\t\ti = 0,\n\t\tworking = true;\n\n\t\twhile(working){\n\t\t\tif(this.vDomTop){\n\t\t\t\tlet row = rows[index],\n\t\t\t\trowHeight, initialized;\n\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\n\t\t\t\t\tinitialized = row.initialized;\n\n\t\t\t\t\tif(fillableSpace >= rowHeight){\n\n\t\t\t\t\t\tthis.styleRow(row, index);\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\n\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\n\t\t\t\t\t\t\taddedRows.push(row);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trow.initialize();\n\n\t\t\t\t\t\tif(!initialized){\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\n\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfillableSpace -= rowHeight;\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\n\n\t\t\t\t\t\tthis.vDomTop--;\n\t\t\t\t\t\tindex--;\n\t\t\t\t\t\ti++;\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tworking = false;\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\tworking = false;\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\tworking = false;\n\t\t\t}\n\t\t}\n\n\t\tfor (let row of addedRows){\n\t\t\trow.clearCellHeight();\n\t\t}\n\n\t\tthis._quickNormalizeRowHeight(addedRows);\n\n\t\tif(paddingAdjust){\n\t\t\tthis.vDomTopPad -= paddingAdjust;\n\n\t\t\tif(this.vDomTopPad < 0){\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\n\t\t\t}\n\n\t\t\tif(index < 1){\n\t\t\t\tthis.vDomTopPad = 0;\n\t\t\t}\n\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\n\t\t}\n\t}\n\n\t_removeTopRow(rows, fillableSpace){\n\t\tvar removableRows = [],\n\t\tpaddingAdjust = 0,\n\t\ti = 0,\n\t\tworking = true;\n\n\t\twhile(working){\n\t\t\tlet row = rows[this.vDomTop],\n\t\t\trowHeight;\n\n\t\t\tif(row && i < this.vDomMaxRenderChain){\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\n\n\t\t\t\tif(fillableSpace >= rowHeight){\n\t\t\t\t\tthis.vDomTop++;\n\n\t\t\t\t\tfillableSpace -= rowHeight;\n\t\t\t\t\tpaddingAdjust += rowHeight;\n\n\t\t\t\t\tremovableRows.push(row);\n\t\t\t\t\ti++;\n\t\t\t\t}else{\n\t\t\t\t\tworking = false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tworking = false;\n\t\t\t}\n\t\t}\n\n\t\tfor (let row of removableRows){\n\t\t\tlet rowEl = row.getElement();\n\n\t\t\tif(rowEl.parentNode){\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\n\t\t\t}\n\t\t}\n\n\t\tif(paddingAdjust){\n\t\t\tthis.vDomTopPad += paddingAdjust;\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\n\t\t}\n\t}\n\n\t_addBottomRow(rows, fillableSpace){\n\t\tvar table = this.tableElement,\n\t\taddedRows = [],\n\t\tpaddingAdjust = 0,\n\t\tindex = this.vDomBottom + 1,\n\t\ti = 0,\n\t\tworking = true;\n\n\t\twhile(working){\n\t\t\tlet row = rows[index],\n\t\t\trowHeight, initialized;\n\n\t\t\tif(row && i < this.vDomMaxRenderChain){\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\n\t\t\t\tinitialized = row.initialized;\n\n\t\t\t\tif(fillableSpace >= rowHeight){\n\n\t\t\t\t\tthis.styleRow(row, index);\n\t\t\t\t\ttable.appendChild(row.getElement());\n\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\n\t\t\t\t\t\taddedRows.push(row);\n\t\t\t\t\t}\n\n\t\t\t\t\trow.initialize();\n\n\t\t\t\t\tif(!initialized){\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\n\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfillableSpace -= rowHeight;\n\t\t\t\t\tpaddingAdjust += rowHeight;\n\n\t\t\t\t\tthis.vDomBottom++;\n\t\t\t\t\tindex++;\n\t\t\t\t\ti++;\n\t\t\t\t}else{\n\t\t\t\t\tworking = false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tworking = false;\n\t\t\t}\n\t\t}\n\n\t\tfor (let row of addedRows){\n\t\t\trow.clearCellHeight();\n\t\t}\n\n\t\tthis._quickNormalizeRowHeight(addedRows);\n\n\t\tif(paddingAdjust){\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\n\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\n\t\t\t\tthis.vDomBottomPad = 0;\n\t\t\t}\n\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\n\t\t}\n\t}\n\n\t_removeBottomRow(rows, fillableSpace){\n\t\tvar removableRows = [],\n\t\tpaddingAdjust = 0,\n\t\ti = 0,\n\t\tworking = true;\n\n\t\twhile(working){\n\t\t\tlet row = rows[this.vDomBottom],\n\t\t\trowHeight;\n\n\t\t\tif(row && i < this.vDomMaxRenderChain){\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\n\n\t\t\t\tif(fillableSpace >= rowHeight){\n\t\t\t\t\tthis.vDomBottom --;\n\n\t\t\t\t\tfillableSpace -= rowHeight;\n\t\t\t\t\tpaddingAdjust += rowHeight;\n\n\t\t\t\t\tremovableRows.push(row);\n\t\t\t\t\ti++;\n\t\t\t\t}else{\n\t\t\t\t\tworking = false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tworking = false;\n\t\t\t}\n\t\t}\n\n\t\tfor (let row of removableRows){\n\t\t\tlet rowEl = row.getElement();\n\n\t\t\tif(rowEl.parentNode){\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\n\t\t\t}\n\t\t}\n\n\t\tif(paddingAdjust){\n\t\t\tthis.vDomBottomPad += paddingAdjust;\n\n\t\t\tif(this.vDomBottomPad < 0){\n\t\t\t\tthis.vDomBottomPad = 0;\n\t\t\t}\n\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\n\t\t}\n\t}\n\n\t_quickNormalizeRowHeight(rows){\n\t\tfor(let row of rows){\n\t\t\trow.calcHeight();\n\t\t}\n\n\t\tfor(let row of rows){\n\t\t\trow.setCellHeight();\n\t\t}\n\t}\n}","import CoreFeature from './CoreFeature.js';\nimport Row from './row/Row.js';\nimport RowComponent from './row/RowComponent.js';\nimport Helpers from './tools/Helpers.js';\n\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\n\nexport default class RowManager extends CoreFeature{\n\t\n\tconstructor(table){\n\t\tsuper(table);\n\t\t\n\t\tthis.element = this.createHolderElement(); //containing element\n\t\tthis.tableElement = this.createTableElement(); //table element\n\t\tthis.heightFixer = this.createTableElement(); //table element\n\t\tthis.placeholder = null; //placeholder element\n\t\tthis.placeholderContents = null; //placeholder element\n\t\t\n\t\tthis.firstRender = false; //handle first render\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\n\t\tthis.fixedHeight = false; //current rendering mode\n\t\t\n\t\tthis.rows = []; //hold row data objects\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\n\t\tthis.activeRows = []; //rows currently available to on display in the table\n\t\tthis.activeRowsCount = 0; //count of active rows\n\t\t\n\t\tthis.displayRows = []; //rows currently on display in the table\n\t\tthis.displayRowsCount = 0; //count of display rows\n\t\t\n\t\tthis.scrollTop = 0;\n\t\tthis.scrollLeft = 0;\n\t\t\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\n\t\t\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\n\n\t\tthis.scrollbarWidth = 0;\n\t\t\n\t\tthis.renderer = null;\n\t}\n\t\n\t//////////////// Setup Functions /////////////////\n\t\n\tcreateHolderElement (){\n\t\tvar el = document.createElement(\"div\");\n\t\t\n\t\tel.classList.add(\"tabulator-tableholder\");\n\t\tel.setAttribute(\"tabindex\", 0);\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\n\t\t\n\t\treturn el;\n\t}\n\t\n\tcreateTableElement (){\n\t\tvar el = document.createElement(\"div\");\n\t\t\n\t\tel.classList.add(\"tabulator-table\");\n\t\tel.setAttribute(\"role\", \"rowgroup\");\n\t\t\n\t\treturn el;\n\t}\n\t\n\tinitializePlaceholder(){\n\t\tvar placeholder = this.table.options.placeholder;\n\n\t\t//configure placeholder element\n\t\tif(placeholder){\t\n\t\t\tlet el = document.createElement(\"div\");\n\t\t\tel.classList.add(\"tabulator-placeholder\");\n\n\t\t\tif(typeof placeholder == \"string\"){\n\t\t\t\tlet contents = document.createElement(\"div\");\n\t\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\n\t\t\t\tcontents.innerHTML = placeholder;\n\t\t\t\t\n\t\t\t\tel.appendChild(contents);\n\t\t\t\t\n\t\t\t\tthis.placeholderContents = contents;\n\t\t\t\t\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && placeholder instanceof HTMLElement){\n\t\t\t\t\n\t\t\t\tel.appendChild(placeholder);\n\t\t\t\tthis.placeholderContents = placeholder;\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Invalid placeholder provided, must be string or HTML Element\", placeholder);\n\n\t\t\t\tthis.el = null;\n\t\t\t}\n\n\t\t\tthis.placeholder = el;\n\t\t}\n\t}\n\t\n\t//return containing element\n\tgetElement(){\n\t\treturn this.element;\n\t}\n\t\n\t//return table element\n\tgetTableElement(){\n\t\treturn this.tableElement;\n\t}\n\t\n\tinitialize(){\n\t\tthis.initializePlaceholder();\n\t\tthis.initializeRenderer();\n\t\t\n\t\t//initialize manager\n\t\tthis.element.appendChild(this.tableElement);\n\t\t\n\t\tthis.firstRender = true;\n\t\t\n\t\t//scroll header along with table body\n\t\tthis.element.addEventListener(\"scroll\", () => {\n\t\t\tvar left = this.element.scrollLeft,\n\t\t\tleftDir = this.scrollLeft > left,\n\t\t\ttop = this.element.scrollTop,\n\t\t\ttopDir = this.scrollTop > top;\n\t\t\t\n\t\t\t//handle horizontal scrolling\n\t\t\tif(this.scrollLeft != left){\n\t\t\t\tthis.scrollLeft = left;\n\t\t\t\t\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\n\t\t\t\t\n\t\t\t\tthis._positionPlaceholder();\n\t\t\t}\n\t\t\t\n\t\t\t//handle vertical scrolling\n\t\t\tif(this.scrollTop != top){\n\t\t\t\tthis.scrollTop = top;\n\t\t\t\t\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\n\t\t\t\t\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\n\t\t\t}\n\t\t});\n\t}\n\t\n\t////////////////// Row Manipulation //////////////////\n\tfindRow(subject){\n\t\tif(typeof subject == \"object\"){\n\t\t\tif(subject instanceof Row){\n\t\t\t\t//subject is row element\n\t\t\t\treturn subject;\n\t\t\t}else if(subject instanceof RowComponent){\n\t\t\t\t//subject is public row component\n\t\t\t\treturn subject._getSelf() || false;\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\n\t\t\t\t//subject is a HTML element of the row\n\t\t\t\tlet match = this.rows.find((row) => {\n\t\t\t\t\treturn row.getElement() === subject;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\treturn match || false;\n\t\t\t}else if(subject === null){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else if(typeof subject == \"undefined\"){\n\t\t\treturn false;\n\t\t}else{\n\t\t\t//subject should be treated as the index of the row\n\t\t\tlet match = this.rows.find((row) => {\n\t\t\t\treturn row.data[this.table.options.index] == subject;\n\t\t\t});\n\t\t\t\n\t\t\treturn match || false;\n\t\t}\n\t\t\n\t\t//catch all for any other type of input\n\t\treturn false;\n\t}\n\t\n\tgetRowFromDataObject(data){\n\t\tvar match = this.rows.find((row) => {\n\t\t\treturn row.data === data;\n\t\t});\n\t\t\n\t\treturn match || false;\n\t}\n\t\n\tgetRowFromPosition(position){\n\t\treturn this.getDisplayRows().find((row) => {\n\t\t\treturn row.getPosition() === position && row.isDisplayed();\n\t\t});\n\t}\n\t\n\tscrollToRow(row, position, ifVisible){\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\n\t}\n\t\n\t////////////////// Data Handling //////////////////\n\tsetData(data, renderInPosition, columnsChanged){\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\n\t\t\t\tif(this.table.options.pagination){\n\t\t\t\t\tthis._setDataActual(data, true);\n\t\t\t\t}else{\n\t\t\t\t\tthis.reRenderInPosition(() => {\n\t\t\t\t\t\tthis._setDataActual(data);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\n\t\t\t\t}\n\t\t\t\tthis.resetScroll();\n\t\t\t\t\n\t\t\t\tthis._setDataActual(data);\n\t\t\t}\n\t\t\t\n\t\t\tresolve();\n\t\t});\n\t}\n\t\n\t_setDataActual(data, renderInPosition){\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\n\t\t\n\t\tthis._wipeElements();\n\t\t\n\t\tif(Array.isArray(data)){\n\t\t\tthis.dispatch(\"data-processing\", data);\n\t\t\t\n\t\t\tdata.forEach((def, i) => {\n\t\t\t\tif(def && typeof def === \"object\"){\n\t\t\t\t\tvar row = new Row(def, this);\n\t\t\t\t\tthis.rows.push(row);\n\t\t\t\t}else{\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\n\t\t\t\n\t\t\tthis.dispatch(\"data-processed\", data);\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\n\t\t}else{\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\n\t\t}\n\t}\n\t\n\t_wipeElements(){\n\t\tthis.dispatch(\"rows-wipe\");\n\t\t\n\t\tthis.destroy();\n\t\t\n\t\tthis.adjustTableSize();\n\n\t\tthis.dispatch(\"rows-wiped\");\n\t}\n\n\tdestroy(){\n\t\tthis.rows.forEach((row) => {\n\t\t\trow.wipe();\n\t\t});\n\n\t\tthis.rows = [];\n\t\tthis.activeRows = [];\n\t\tthis.activeRowsPipeline = [];\n\t\tthis.activeRowsCount = 0;\n\t\tthis.displayRows = [];\n\t\tthis.displayRowsCount = 0;\n\t}\n\t\n\tdeleteRow(row, blockRedraw){\n\t\tvar allIndex = this.rows.indexOf(row),\n\t\tactiveIndex = this.activeRows.indexOf(row);\n\t\t\n\t\tif(activeIndex > -1){\n\t\t\tthis.activeRows.splice(activeIndex, 1);\n\t\t}\n\t\t\n\t\tif(allIndex > -1){\n\t\t\tthis.rows.splice(allIndex, 1);\n\t\t}\n\t\t\n\t\tthis.setActiveRows(this.activeRows);\n\t\t\n\t\tthis.displayRowIterator((rows) => {\n\t\t\tvar displayIndex = rows.indexOf(row);\n\t\t\t\n\t\t\tif(displayIndex > -1){\n\t\t\t\trows.splice(displayIndex, 1);\n\t\t\t}\n\t\t});\n\t\t\n\t\tif(!blockRedraw){\n\t\t\tthis.reRenderInPosition();\n\t\t}\n\t\t\n\t\tthis.regenerateRowPositions();\n\t\t\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\n\t\t\n\t\tif(!this.displayRowsCount){\n\t\t\tthis.tableEmpty();\n\t\t}\n\t\t\n\t\tif(this.subscribedExternal(\"dataChanged\")){\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\n\t\t}\n\t}\n\t\n\taddRow(data, pos, index, blockRedraw){\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\n\t\treturn row;\n\t}\n\t\n\t//add multiple rows\n\taddRows(data, pos, index, refreshDisplayOnly){\n\t\tvar rows = [];\n\t\t\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tpos = this.findAddRowPos(pos);\n\t\t\t\n\t\t\tif(!Array.isArray(data)){\n\t\t\t\tdata = [data];\n\t\t\t}\n\t\t\t\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\n\t\t\t\tdata.reverse();\n\t\t\t}\n\t\t\t\n\t\t\tdata.forEach((item, i) => {\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\n\t\t\t\trows.push(row);\n\t\t\t\tthis.dispatch(\"row-added\", row, item, pos, index);\n\t\t\t});\n\n\t\t\tthis.refreshActiveData(refreshDisplayOnly ? \"displayPipeline\" : false, false, true);\n\t\t\t\n\t\t\tthis.regenerateRowPositions();\n\t\t\t\n\t\t\tif(rows.length){\n\t\t\t\tthis._clearPlaceholder();\n\t\t\t}\n\t\t\t\n\t\t\tresolve(rows);\n\t\t});\n\t}\n\t\n\tfindAddRowPos(pos){\n\t\tif(typeof pos === \"undefined\"){\n\t\t\tpos = this.table.options.addRowPos;\n\t\t}\n\t\t\n\t\tif(pos === \"pos\"){\n\t\t\tpos = true;\n\t\t}\n\t\t\n\t\tif(pos === \"bottom\"){\n\t\t\tpos = false;\n\t\t}\n\t\t\n\t\treturn pos;\n\t}\n\t\n\taddRowActual(data, pos, index, blockRedraw){\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\n\t\ttop = this.findAddRowPos(pos),\n\t\tallIndex = -1,\n\t\tactiveIndex, chainResult;\n\t\t\n\t\tif(!index){\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\n\t\t\t\n\t\t\tindex = chainResult.index;\n\t\t\ttop = chainResult.top;\n\t\t}\n\t\t\n\t\tif(typeof index !== \"undefined\"){\n\t\t\tindex = this.findRow(index);\n\t\t}\n\t\t\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\n\t\t\n\t\tif(index){\n\t\t\tallIndex = this.rows.indexOf(index);\n\t\t}\n\t\t\n\t\tif(index && allIndex > -1){\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\n\t\t\t\n\t\t\tthis.displayRowIterator(function(rows){\n\t\t\t\tvar displayIndex = rows.indexOf(index);\n\t\t\t\t\n\t\t\t\tif(displayIndex > -1){\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tif(activeIndex > -1){\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\n\t\t\t}\n\t\t\t\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\tif(top){\n\t\t\t\t\n\t\t\t\tthis.displayRowIterator(function(rows){\n\t\t\t\t\trows.unshift(row);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tthis.activeRows.unshift(row);\n\t\t\t\tthis.rows.unshift(row);\n\t\t\t}else{\n\t\t\t\tthis.displayRowIterator(function(rows){\n\t\t\t\t\trows.push(row);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tthis.activeRows.push(row);\n\t\t\t\tthis.rows.push(row);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.setActiveRows(this.activeRows);\n\t\t\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\n\t\t\n\t\tif(this.subscribedExternal(\"dataChanged\")){\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\n\t\t}\n\t\t\n\t\tif(!blockRedraw){\n\t\t\tthis.reRenderInPosition();\n\t\t}\n\t\t\n\t\treturn row;\n\t}\n\t\n\tmoveRow(from, to, after){\n\t\tthis.dispatch(\"row-move\", from, to, after);\n\t\t\n\t\tthis.moveRowActual(from, to, after);\n\t\t\n\t\tthis.regenerateRowPositions();\n\t\t\n\t\tthis.dispatch(\"row-moved\", from, to, after);\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\n\t}\n\t\n\tmoveRowActual(from, to, after){\n\t\tthis.moveRowInArray(this.rows, from, to, after);\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\n\t\t\n\t\tthis.displayRowIterator((rows) => {\n\t\t\tthis.moveRowInArray(rows, from, to, after);\n\t\t});\n\t\t\n\t\tthis.dispatch(\"row-moving\", from, to, after);\n\t}\n\t\n\tmoveRowInArray(rows, from, to, after){\n\t\tvar\tfromIndex, toIndex, start, end;\n\t\t\n\t\tif(from !== to){\n\t\t\t\n\t\t\tfromIndex = rows.indexOf(from);\n\t\t\t\n\t\t\tif (fromIndex > -1) {\n\t\t\t\t\n\t\t\t\trows.splice(fromIndex, 1);\n\t\t\t\t\n\t\t\t\ttoIndex = rows.indexOf(to);\n\t\t\t\t\n\t\t\t\tif (toIndex > -1) {\n\t\t\t\t\t\n\t\t\t\t\tif(after){\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\n\t\t\t\t\t}else{\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\trows.splice(fromIndex, 0, from);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//restyle rows\n\t\t\tif(rows === this.getDisplayRows()){\n\t\t\t\t\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\n\t\t\t\t\n\t\t\t\tfor(let i = start; i <= end; i++){\n\t\t\t\t\tif(rows[i]){\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tclearData(){\n\t\tthis.setData([]);\n\t}\n\t\n\tgetRowIndex(row){\n\t\treturn this.findRowIndex(row, this.rows);\n\t}\n\t\n\tgetDisplayRowIndex(row){\n\t\tvar index = this.getDisplayRows().indexOf(row);\n\t\treturn index > -1 ? index : false;\n\t}\n\t\n\tnextDisplayRow(row, rowOnly){\n\t\tvar index = this.getDisplayRowIndex(row),\n\t\tnextRow = false;\n\t\t\n\t\t\n\t\tif(index !== false && index < this.displayRowsCount -1){\n\t\t\tnextRow = this.getDisplayRows()[index+1];\n\t\t}\n\t\t\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\n\t\t}\n\t\t\n\t\treturn nextRow;\n\t}\n\t\n\tprevDisplayRow(row, rowOnly){\n\t\tvar index = this.getDisplayRowIndex(row),\n\t\tprevRow = false;\n\t\t\n\t\tif(index){\n\t\t\tprevRow = this.getDisplayRows()[index-1];\n\t\t}\n\t\t\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\n\t\t}\n\t\t\n\t\treturn prevRow;\n\t}\n\t\n\tfindRowIndex(row, list){\n\t\tvar rowIndex;\n\t\t\n\t\trow = this.findRow(row);\n\t\t\n\t\tif(row){\n\t\t\trowIndex = list.indexOf(row);\n\t\t\t\n\t\t\tif(rowIndex > -1){\n\t\t\t\treturn rowIndex;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}\n\t\n\tgetData(active, transform){\n\t\tvar output = [],\n\t\trows = this.getRows(active);\n\t\t\n\t\trows.forEach(function(row){\n\t\t\tif(row.type == \"row\"){\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn output;\n\t}\n\t\n\tgetComponents(active){\n\t\tvar\toutput = [],\n\t\trows = this.getRows(active);\n\t\t\n\t\trows.forEach(function(row){\n\t\t\toutput.push(row.getComponent());\n\t\t});\n\t\t\n\t\treturn output;\n\t}\n\t\n\tgetDataCount(active){\n\t\tvar rows = this.getRows(active);\n\t\t\n\t\treturn rows.length;\n\t}\n\t\n\tscrollHorizontal(left){\n\t\tthis.scrollLeft = left;\n\t\tthis.element.scrollLeft = left;\n\t\t\n\t\tthis.dispatch(\"scroll-horizontal\", left);\n\t}\n\t\n\tregisterDataPipelineHandler(handler, priority){\n\t\tif(typeof priority !== \"undefined\"){\n\t\t\tthis.dataPipeline.push({handler, priority});\n\t\t\tthis.dataPipeline.sort((a, b) => {\n\t\t\t\treturn a.priority - b.priority;\n\t\t\t});\n\t\t}else{\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\");\n\t\t}\n\t}\n\t\n\tregisterDisplayPipelineHandler(handler, priority){\n\t\tif(typeof priority !== \"undefined\"){\n\t\t\tthis.displayPipeline.push({handler, priority});\n\t\t\tthis.displayPipeline.sort((a, b) => {\n\t\t\t\treturn a.priority - b.priority;\n\t\t\t});\n\t\t}else{\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\");\n\t\t}\n\t}\n\t\n\t//set active data set\n\trefreshActiveData(handler, skipStage, renderInPosition){\n\t\tvar table = this.table,\n\t\tstage = \"\",\n\t\tindex = 0,\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"];\n\t\t\n\t\tif(!this.table.destroyed){\n\t\t\tif(typeof handler === \"function\"){\n\t\t\t\tindex = this.dataPipeline.findIndex((item) => {\n\t\t\t\t\treturn item.handler === handler;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tif(index > -1){\n\t\t\t\t\tstage = \"dataPipeline\";\n\t\t\t\t\t\n\t\t\t\t\tif(skipStage){\n\t\t\t\t\t\tif(index == this.dataPipeline.length - 1){\n\t\t\t\t\t\t\tstage = \"display\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\n\t\t\t\t\t\treturn item.handler === handler;\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tif(index > -1){\n\t\t\t\t\t\tstage = \"displayPipeline\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(skipStage){\n\t\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\n\t\t\t\t\t\t\t\tstage = \"end\";\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tstage = handler || \"all\";\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif(this.redrawBlock){\n\t\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\n\t\t\t\t\tthis.redrawBlockRestoreConfig = {\n\t\t\t\t\t\thandler: handler,\n\t\t\t\t\t\tskipStage: skipStage,\n\t\t\t\t\t\trenderInPosition: renderInPosition,\n\t\t\t\t\t\tstage:stage,\n\t\t\t\t\t\tindex:index,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}else{\n\t\t\t\tif(Helpers.elVisible(this.element)){\n\t\t\t\t\tif(renderInPosition){\n\t\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!handler){\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tthis.renderTable();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\n\t\t\t\t\t\t\tthis.table.columnManager.redraw(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.dispatch(\"data-refreshed\");\n\t\t\t}\n\t\t}\n\t}\n\t\n\trefreshPipelines(handler, stage, index, renderInPosition){\n\t\tthis.dispatch(\"data-refreshing\");\n\t\t\n\t\tif(!handler){\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\n\t\t}\n\t\t\n\t\t//cascade through data refresh stages\n\t\tswitch(stage){\n\t\t\tcase \"all\":\n\t\t\t//handle case where all data needs refreshing\n\t\t\t\n\t\t\tcase \"dataPipeline\":\n\t\t\t\n\t\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\n\t\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\n\t\t\t\t\t\n\t\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\n\t\t\t\t\n\t\t\tcase \"display\":\n\t\t\t\tindex = 0;\n\t\t\t\tthis.resetDisplayRows();\n\t\t\t\t\n\t\t\tcase \"displayPipeline\":\n\t\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\n\t\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\n\n\t\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\n\t\t\t\t}\n\t\t\t\n\t\t\tcase \"end\":\n\t\t\t\t//case to handle scenario when trying to skip past end stage\n\t\t\t\tthis.regenerateRowPositions();\n\t\t}\n\n\t\tif(this.getDisplayRows().length){\n\t\t\tthis._clearPlaceholder();\n\t\t}\n\t}\n\t\n\t//regenerate row positions\n\tregenerateRowPositions(){\n\t\tvar rows = this.getDisplayRows();\n\t\tvar index = 1;\n\t\t\n\t\trows.forEach((row) => {\n\t\t\tif (row.type === \"row\"){\n\t\t\t\trow.setPosition(index);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t});\n\t}\n\t\n\tsetActiveRows(activeRows){\n\t\tthis.activeRows = this.activeRows = Object.assign([], activeRows);\n\t\tthis.activeRowsCount = this.activeRows.length;\n\t}\n\t\n\t//reset display rows array\n\tresetDisplayRows(){\n\t\tthis.displayRows = [];\n\t\t\n\t\tthis.displayRows.push(this.activeRows.slice(0));\n\t\t\n\t\tthis.displayRowsCount = this.displayRows[0].length;\n\t}\n\t\n\t//set display row pipeline data\n\tsetDisplayRows(displayRows, index){\n\t\tthis.displayRows[index] = displayRows;\n\n\t\tif(index == this.displayRows.length -1){\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\n\t\t}\n\t}\n\t\n\tgetDisplayRows(index){\n\t\tif(typeof index == \"undefined\"){\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\n\t\t}else{\n\t\t\treturn this.displayRows[index] || [];\n\t\t}\n\t}\n\t\n\tgetVisibleRows(chain, viewable){\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\n\t\t\n\t\tif(chain){\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\n\t\t}\n\t\t\n\t\treturn rows;\n\t}\n\t\n\t//repeat action across display rows\n\tdisplayRowIterator(callback){\n\t\tthis.activeRowsPipeline.forEach(callback);\n\t\tthis.displayRows.forEach(callback);\n\t\t\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\n\t}\n\t\n\t//return only actual rows (not group headers etc)\n\tgetRows(type){\n\t\tvar rows = [];\n\n\t\tswitch(type){\n\t\t\tcase \"active\":\n\t\t\t\trows = this.activeRows;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"display\":\n\t\t\t\trows = this.table.rowManager.getDisplayRows();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"visible\":\n\t\t\t\trows = this.getVisibleRows(false, true);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\n\t\t}\n\t\t\n\t\treturn rows;\n\t}\n\t\n\t///////////////// Table Rendering /////////////////\n\t//trigger rerender of table in current position\n\treRenderInPosition(callback){\n\t\tif(this.redrawBlock){\n\t\t\tif(callback){\n\t\t\t\tcallback();\n\t\t\t}else{\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\n\t\t\t}\n\t\t}else{\n\t\t\tthis.dispatchExternal(\"renderStarted\");\n\t\t\t\n\t\t\tthis.renderer.rerenderRows(callback);\n\n\t\t\tif(!this.fixedHeight){\n\t\t\t\tthis.adjustTableSize();\n\t\t\t}\n\n\t\t\tthis.scrollBarCheck();\n\t\t\t\n\t\t\tthis.dispatchExternal(\"renderComplete\");\n\t\t}\n\t}\n\n\tscrollBarCheck(){\n\t\tvar scrollbarWidth = 0;\n\n\t\t//adjust for vertical scrollbar moving table when present\n\t\tif(this.element.scrollHeight > this.element.clientHeight){\n\t\t\tscrollbarWidth = this.element.offsetWidth - this.element.clientWidth;\n\t\t}\n\n\t\tif(scrollbarWidth !== this.scrollbarWidth){\n\t\t\tthis.scrollbarWidth = scrollbarWidth;\n\t\t\tthis.dispatch(\"scrollbar-vertical\", scrollbarWidth);\n\t\t}\n\t}\n\t\n\tinitializeRenderer(){\n\t\tvar renderClass;\n\t\t\n\t\tvar renderers = {\n\t\t\t\"virtual\": RendererVirtualDomVertical,\n\t\t\t\"basic\": RendererBasicVertical,\n\t\t};\n\t\t\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\n\t\t}else{\n\t\t\trenderClass = this.table.options.renderVertical;\n\t\t}\n\t\t\n\t\tif(renderClass){\n\t\t\tthis.renderMode = this.table.options.renderVertical;\n\t\t\t\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\n\t\t\tthis.renderer.initialize();\n\t\t\t\n\t\t\tif((this.table.element.clientHeight || this.table.options.height) && !(this.table.options.minHeight && this.table.options.maxHeight)){\n\t\t\t\tthis.fixedHeight = true;\n\t\t\t}else{\n\t\t\t\tthis.fixedHeight = false;\n\t\t\t}\n\t\t}else{\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderVertical);\n\t\t}\n\t}\n\t\n\tgetRenderMode(){\n\t\treturn this.renderMode;\n\t}\n\t\n\trenderTable(){\n\t\tthis.dispatchExternal(\"renderStarted\");\n\t\t\n\t\tthis.element.scrollTop = 0;\n\t\t\n\t\tthis._clearTable();\n\t\t\n\t\tif(this.displayRowsCount){\n\t\t\tthis.renderer.renderRows();\n\t\t\t\n\t\t\tif(this.firstRender){\n\t\t\t\tthis.firstRender = false;\n\n\t\t\t\tif(!this.fixedHeight){\n\t\t\t\t\tthis.adjustTableSize();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.layoutRefresh(true);\n\t\t\t}\n\t\t}else{\n\t\t\tthis.renderEmptyScroll();\n\t\t}\n\t\t\n\t\tif(!this.fixedHeight){\n\t\t\tthis.adjustTableSize();\n\t\t}\n\t\t\n\t\tthis.dispatch(\"table-layout\");\n\t\t\n\t\tif(!this.displayRowsCount){\n\t\t\tthis._showPlaceholder();\n\t\t}\n\n\t\tthis.scrollBarCheck();\n\t\t\n\t\tthis.dispatchExternal(\"renderComplete\");\n\t}\n\t\n\t//show scrollbars on empty table div\n\trenderEmptyScroll(){\n\t\tif(this.placeholder){\n\t\t\tthis.tableElement.style.display = \"none\";\n\t\t}else{\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\n\t\t}\n\t}\n\t\n\t_clearTable(){\t\n\t\tthis._clearPlaceholder();\n\t\t\n\t\tthis.scrollTop = 0;\n\t\tthis.scrollLeft = 0;\n\t\t\n\t\tthis.renderer.clearRows();\n\t}\n\n\ttableEmpty(){\n\t\tthis.renderEmptyScroll();\n\t\tthis._showPlaceholder();\n\t}\n\t\n\t_showPlaceholder(){\n\t\tif(this.placeholder){\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\n\t\t\t\n\t\t\tthis.getElement().appendChild(this.placeholder);\n\t\t\tthis._positionPlaceholder();\n\t\t}\n\t}\n\t\n\t_clearPlaceholder(){\n\t\tif(this.placeholder && this.placeholder.parentNode){\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\n\t\t}\n\n\t\t// clear empty table placeholder min\n\t\tthis.tableElement.style.minWidth = \"\";\n\t\tthis.tableElement.style.display = \"\";\n\t}\n\t\n\t_positionPlaceholder(){\n\t\tif(this.placeholder && this.placeholder.parentNode){\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\n\t\t}\n\t}\n\t\n\tstyleRow(row, index){\n\t\tvar rowEl = row.getElement();\n\t\t\n\t\tif(index % 2){\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\n\t\t}else{\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\n\t\t}\n\t}\n\t\n\t//normalize height of active rows\n\tnormalizeHeight(){\n\t\tthis.activeRows.forEach(function(row){\n\t\t\trow.normalizeHeight();\n\t\t});\n\t}\n\t\n\t//adjust the height of the table holder to fit in the Tabulator element\n\tadjustTableSize(){\n\t\tvar initialHeight = this.element.clientHeight, minHeight;\n\t\t\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\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));\n\t\t\t\n\t\t\tif(this.fixedHeight){\n\t\t\t\tminHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + \"px\";\n\t\t\t\t\n\t\t\t\tthis.element.style.minHeight = minHeight || \"calc(100% - \" + otherHeight + \"px)\";\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\n\t\t\t}else{\n\t\t\t\tthis.element.style.height = \"\";\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\n\t\t\t}\n\t\t\t\n\t\t\tthis.renderer.resize();\n\t\t\t\n\t\t\t//check if the table has changed size when dealing with variable height tables\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\n\t\t\t\tif(this.subscribed(\"table-resize\")){\n\t\t\t\t\tthis.dispatch(\"table-resize\");\n\t\t\t\t}else{\n\t\t\t\t\tthis.redraw();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.scrollBarCheck();\n\t\t}\n\t\t\n\t\tthis._positionPlaceholder();\n\t}\n\t\n\t//reinitialize all rows\n\treinitialize(){\n\t\tthis.rows.forEach(function(row){\n\t\t\trow.reinitialize(true);\n\t\t});\n\t}\n\t\n\t//prevent table from being redrawn\n\tblockRedraw (){\n\t\tthis.redrawBlock = true;\n\t\tthis.redrawBlockRestoreConfig = false;\n\t}\n\t\n\t//restore table redrawing\n\trestoreRedraw (){\n\t\tthis.redrawBlock = false;\n\t\t\n\t\tif(this.redrawBlockRestoreConfig){\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition);\n\t\t\t\n\t\t\tthis.redrawBlockRestoreConfig = false;\n\t\t}else{\n\t\t\tif(this.redrawBlockRenderInPosition){\n\t\t\t\tthis.reRenderInPosition();\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.redrawBlockRenderInPosition = false;\n\t}\n\t\n\t//redraw table\n\tredraw (force){\n\t\tvar left = this.scrollLeft;\n\t\t\n\t\tthis.adjustTableSize();\n\t\t\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\n\t\t\n\t\tif(!force){\n\t\t\tthis.reRenderInPosition();\n\t\t\tthis.scrollHorizontal(left);\n\t\t}else{\n\t\t\tthis.renderTable();\n\t\t}\n\t}\n\t\n\tresetScroll(){\n\t\tthis.element.scrollLeft = 0;\n\t\tthis.element.scrollTop = 0;\n\t\t\n\t\tif(this.table.browser === \"ie\"){\n\t\t\tvar event = document.createEvent(\"Event\");\n\t\t\tevent.initEvent(\"scroll\", false, true);\n\t\t\tthis.element.dispatchEvent(event);\n\t\t}else{\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\n\t\t}\n\t}\n}\n","import CoreFeature from './CoreFeature.js';\n\nexport default class FooterManager extends CoreFeature{\n\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.active = false;\n\t\tthis.element = this.createElement(); //containing element\n\t\tthis.containerElement = this.createContainerElement(); //containing element\n\t\tthis.external = false;\n\t}\n\n\tinitialize(){\n\t\tthis.initializeElement();\n\t}\n\n\tcreateElement(){\n\t\tvar el = document.createElement(\"div\");\n\n\t\tel.classList.add(\"tabulator-footer\");\n\n\t\treturn el;\n\t}\n\n\t\n\tcreateContainerElement(){\n\t\tvar el = document.createElement(\"div\");\n\n\t\tel.classList.add(\"tabulator-footer-contents\");\n\n\t\tthis.element.appendChild(el);\n\n\t\treturn el;\n\t}\n\n\tinitializeElement(){\n\t\tif(this.table.options.footerElement){\n\n\t\t\tswitch(typeof this.table.options.footerElement){\n\t\t\t\tcase \"string\":\n\t\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\n\t\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.external = true;\n\t\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.element = this.table.options.footerElement;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tgetElement(){\n\t\treturn this.element;\n\t}\n\n\tappend(element){\n\t\tthis.activate();\n\n\t\tthis.containerElement.appendChild(element);\n\t\tthis.table.rowManager.adjustTableSize();\n\t}\n\n\tprepend(element){\n\t\tthis.activate();\n\n\t\tthis.element.insertBefore(element, this.element.firstChild);\n\t\tthis.table.rowManager.adjustTableSize();\n\t}\n\n\tremove(element){\n\t\telement.parentNode.removeChild(element);\n\t\tthis.deactivate();\n\t}\n\n\tdeactivate(force){\n\t\tif(!this.element.firstChild || force){\n\t\t\tif(!this.external){\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\n\t\t\t}\n\t\t\tthis.active = false;\n\t\t}\n\t}\n\n\tactivate(){\n\t\tif(!this.active){\n\t\t\tthis.active = true;\n\t\t\tif(!this.external){\n\t\t\t\tthis.table.element.appendChild(this.getElement());\n\t\t\t\tthis.table.element.style.display = '';\n\t\t\t}\n\t\t}\n\t}\n\n\tredraw(){\n\t\tthis.dispatch(\"footer-redraw\");\n\t}\n}","import CoreFeature from '../CoreFeature.js';\nimport Row from '../row/Row.js';\n\nexport default class InteractionManager extends CoreFeature {\n\t\n\tconstructor (table){\n\t\tsuper(table);\n\t\t\n\t\tthis.el = null;\n\t\t\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\n\t\t\n\t\tthis.previousTargets = {};\n\t\t\n\t\tthis.listeners = [\n\t\t\t\"click\",\n\t\t\t\"dblclick\",\n\t\t\t\"contextmenu\",\n\t\t\t\"mouseenter\",\n\t\t\t\"mouseleave\",\n\t\t\t\"mouseover\",\n\t\t\t\"mouseout\",\n\t\t\t\"mousemove\",\n\t\t\t\"mouseup\",\n\t\t\t\"mousedown\",\n\t\t\t\"touchstart\",\n\t\t\t\"touchend\",\n\t\t];\n\t\t\n\t\tthis.componentMap = {\n\t\t\t\"tabulator-cell\":\"cell\",\n\t\t\t\"tabulator-row\":\"row\",\n\t\t\t\"tabulator-group\":\"group\",\n\t\t\t\"tabulator-col\":\"column\",\n\t\t};\n\t\t\n\t\tthis.pseudoTrackers = {\n\t\t\t\"row\":{\n\t\t\t\tsubscriber:null,\n\t\t\t\ttarget:null,\n\t\t\t},\n\t\t\t\"cell\":{\n\t\t\t\tsubscriber:null,\n\t\t\t\ttarget:null,\n\t\t\t},\n\t\t\t\"group\":{\n\t\t\t\tsubscriber:null,\n\t\t\t\ttarget:null,\n\t\t\t},\n\t\t\t\"column\":{\n\t\t\t\tsubscriber:null,\n\t\t\t\ttarget:null,\n\t\t\t},\n\t\t};\n\t\t\n\t\tthis.pseudoTracking = false;\n\t}\n\t\n\tinitialize(){\n\t\tthis.el = this.table.element;\n\t\t\n\t\tthis.buildListenerMap();\n\t\tthis.bindSubscriptionWatchers();\n\t}\n\t\n\tbuildListenerMap(){\n\t\tvar listenerMap = {};\n\t\t\n\t\tthis.listeners.forEach((listener) => {\n\t\t\tlistenerMap[listener] = {\n\t\t\t\thandler:null,\n\t\t\t\tcomponents:[],\n\t\t\t};\n\t\t});\n\t\t\n\t\tthis.listeners = listenerMap;\n\t}\n\t\n\tbindPseudoEvents(){\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\n\t\t});\n\t\t\n\t\tthis.pseudoTracking = true;\n\t}\n\t\n\tpseudoMouseEnter(key, e, target){\n\t\tif(this.pseudoTrackers[key].target !== target){\n\t\t\t\n\t\t\tif(this.pseudoTrackers[key].target){\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\n\t\t\t}\n\t\t\t\n\t\t\tthis.pseudoMouseLeave(key, e);\n\t\t\t\n\t\t\tthis.pseudoTrackers[key].target = target;\n\t\t\t\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\n\t\t}\n\t}\n\t\n\tpseudoMouseLeave(key, e){\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\n\t\tlinkedKeys = {\n\t\t\t\"row\":[\"cell\"],\n\t\t\t\"cell\":[\"row\"],\n\t\t};\n\t\t\n\t\tleaveList = leaveList.filter((item) => {\n\t\t\tvar links = linkedKeys[key];\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\n\t\t});\n\t\t\n\t\t\n\t\tleaveList.forEach((key) => {\n\t\t\tvar target = this.pseudoTrackers[key].target;\n\t\t\t\n\t\t\tif(this.pseudoTrackers[key].target){\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\n\t\t\t\t\n\t\t\t\tthis.pseudoTrackers[key].target = null;\n\t\t\t}\n\t\t});\n\t}\n\t\n\t\n\tbindSubscriptionWatchers(){\n\t\tvar listeners = Object.keys(this.listeners),\n\t\tcomponents = Object.values(this.componentMap);\n\t\t\n\t\tfor(let comp of components){\n\t\t\tfor(let listener of listeners){\n\t\t\t\tlet key = comp + \"-\" + listener;\n\t\t\t\t\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this));\n\t}\n\t\n\tsubscriptionChanged(component, key, added){\n\t\tvar listener = this.listeners[key].components,\n\t\tindex = listener.indexOf(component),\n\t\tchanged = false;\n\t\t\n\t\tif(added){\n\t\t\tif(index === -1){\n\t\t\t\tlistener.push(component);\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t}else{\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\n\t\t\t\tif(index > -1){\n\t\t\t\t\tlistener.splice(index, 1);\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\n\t\t\tthis.bindPseudoEvents();\n\t\t}\n\t\t\n\t\tif(changed){\n\t\t\tthis.updateEventListeners();\n\t\t}\n\t}\n\t\n\tupdateEventListeners(){\n\t\tfor(let key in this.listeners){\n\t\t\tlet listener = this.listeners[key];\n\t\t\t\n\t\t\tif(listener.components.length){\n\t\t\t\tif(!listener.handler){\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler);\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(listener.handler){\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler);\n\t\t\t\t\tlistener.handler = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\ttrack(type, e){\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\n\t\t\n\t\tvar targets = this.findTargets(path);\n\t\ttargets = this.bindComponents(type, targets);\n\t\t\n\t\tthis.triggerEvents(type, e, targets);\n\t\t\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\n\t\t}\n\t}\n\t\n\tfindTargets(path){\n\t\tvar targets = {};\n\t\t\n\t\tlet componentMap = Object.keys(this.componentMap);\n\t\t\n\t\tfor (let el of path) {\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\n\t\t\t\n\t\t\tlet abort = classList.filter((item) => {\n\t\t\t\treturn this.abortClasses.includes(item);\n\t\t\t});\n\t\t\t\n\t\t\tif(abort.length){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tlet elTargets = classList.filter((item) => {\n\t\t\t\treturn componentMap.includes(item);\n\t\t\t});\n\t\t\t\n\t\t\tfor (let target of elTargets) {\n\t\t\t\tif(!targets[this.componentMap[target]]){\n\t\t\t\t\ttargets[this.componentMap[target]] = el;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(targets.group && targets.group === targets.row){\n\t\t\tdelete targets.row;\n\t\t}\n\t\t\n\t\treturn targets;\n\t}\n\t\n\tbindComponents(type, targets){\n\t\t//ensure row component is looked up before cell\n\t\tvar keys = Object.keys(targets).reverse(),\n\t\tlistener = this.listeners[type],\n\t\tmatches = {},\n\t\ttargetMatches = {};\n\t\t\n\t\tfor(let key of keys){\n\t\t\tlet component,\n\t\t\ttarget = targets[key],\n\t\t\tpreviousTarget = this.previousTargets[key];\n\t\t\t\n\t\t\tif(previousTarget && previousTarget.target === target){\n\t\t\t\tcomponent = previousTarget.component;\n\t\t\t}else{\n\t\t\t\tswitch(key){\n\t\t\t\t\tcase \"row\":\n\t\t\t\t\tcase \"group\":\n\t\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\n\t\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tcomponent = rows.find((row) => {\n\t\t\t\t\t\t\t\treturn row.getElement() === target;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\n\t\t\t\t\t\t\t\ttargets[key] = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"column\":\n\t\t\t\t\t\tif(listener.components.includes(\"column\")){\n\t\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase \"cell\":\n\t\t\t\t\t\tif(listener.components.includes(\"cell\")){\n\t\t\t\t\t\t\tif(matches[\"row\"] instanceof Row){\n\t\t\t\t\t\t\t\tcomponent = matches[\"row\"].findCell(target);\n\t\t\t\t\t\t\t}else{\t\n\t\t\t\t\t\t\t\tif(targets[\"row\"]){\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?\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(component){\n\t\t\t\tmatches[key] = component;\n\t\t\t\ttargetMatches[key] = {\n\t\t\t\t\ttarget:target,\n\t\t\t\t\tcomponent:component,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.previousTargets = targetMatches;\n\t\t\n\t\treturn matches;\n\t}\n\t\n\ttriggerEvents(type, e, targets){\n\t\tvar listener = this.listeners[type];\n\n\t\tfor(let key in targets){\n\t\t\tif(targets[key] && listener.components.includes(key)){\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tclearWatchers(){\n\t\tfor(let key in this.listeners){\n\t\t\tlet listener = this.listeners[key];\n\t\t\t\n\t\t\tif(listener.handler){\n\t\t\t\tthis.el.removeEventListener(key, listener.handler);\n\t\t\t\tlistener.handler = null;\n\t\t\t}\n\t\t}\n\t}\n}","export default class ComponentFunctionBinder{\n\n\tconstructor(table){\n\t\tthis.table = table;\n\n\t\tthis.bindings = {};\n\t}\n\n\tbind(type, funcName, handler){\n\t\tif(!this.bindings[type]){\n\t\t\tthis.bindings[type] = {};\n\t\t}\n\n\t\tif(this.bindings[type][funcName]){\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler);\n\t\t}else{\n\t\t\tthis.bindings[type][funcName] = handler;\n\t\t}\n\t}\n\n\thandle(type, component, name){\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\n\t\t\treturn this.bindings[type][name].bind(null, component);\n\t\t}else{\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\n\t\t\t\tif(this.table.options.debugInvalidComponentFuncs){\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?\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import CoreFeature from '../CoreFeature.js';\n\nexport default class DataLoader extends CoreFeature{\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\n\t\tthis.loading = false;\n\t}\n\n\tinitialize(){}\n\n\tload(data, params, config, replace, silent, columnsChanged){\n\t\tvar requestNo = ++this.requestOrder;\n\n\t\tthis.dispatchExternal(\"dataLoading\", data);\n\n\t\t//parse json data to array\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\n\t\t\tdata = JSON.parse(data);\n\t\t}\n\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\n\t\t\tthis.loading = true;\n\n\t\t\tif(!silent){\n\t\t\t\tthis.alertLoader();\n\t\t\t}\n\n\t\t\t//get params for request\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\n\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\n\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\n\t\t\t\n\t\t\treturn result.then((response) => {\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\n\t\t\t\t}\n\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\n\n\t\t\t\tif(requestNo == this.requestOrder){\n\t\t\t\t\tthis.clearAlert();\n\n\t\t\t\t\tif(rowData !== false){\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\n\t\t\t\t\t}\n\t\t\t\t}else{\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\");\n\t\t\t\t}\n\t\t\t}).catch((error) => {\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\n\n\t\t\t\tif(!silent){\n\t\t\t\t\tthis.alertError();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.clearAlert();\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\n\t\t\t})\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.loading = false;\n\t\t\t\t});\n\t\t}else{\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\n\n\t\t\tif(!data){\n\t\t\t\tdata = [];\n\t\t\t}\n\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\n\t\t\treturn Promise.resolve();\n\t\t}\n\t}\n\n\tmapParams(params, map){\n\t\tvar output = {};\n\n\t\tfor(let key in params){\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\n\t\t}\n\n\t\treturn output;\n\t}\n\n\tobjectInvert(obj){\n\t\tvar output = {};\n\n\t\tfor(let key in obj){\n\t\t\toutput[obj[key]] = key;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\tblockActiveLoad(){\n\t\tthis.requestOrder++;\n\t}\n\n\talertLoader(){\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\n\n\t\tif(shouldLoad){\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\n\t\t}\n\t}\n\n\talertError(){\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\n\t}\n\n\tclearAlert(){\n\t\tthis.table.alertManager.clear();\n\t}\n}","export default class ExternalEventBus {\n\n\tconstructor(table, optionsList, debug){\n\t\tthis.table = table;\n\t\tthis.events = {};\n\t\tthis.optionsList = optionsList || {};\n\t\tthis.subscriptionNotifiers = {};\n\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\n\t\tthis.debug = debug;\n\t}\n\n\tsubscriptionChange(key, callback){\n\t\tif(!this.subscriptionNotifiers[key]){\n\t\t\tthis.subscriptionNotifiers[key] = [];\n\t\t}\n\n\t\tthis.subscriptionNotifiers[key].push(callback);\n\n\t\tif(this.subscribed(key)){\n\t\t\tthis._notifySubscriptionChange(key, true);\n\t\t}\n\t}\n\n\tsubscribe(key, callback){\n\t\tif(!this.events[key]){\n\t\t\tthis.events[key] = [];\n\t\t}\n\n\t\tthis.events[key].push(callback);\n\n\t\tthis._notifySubscriptionChange(key, true);\n\t}\n\n\tunsubscribe(key, callback){\n\t\tvar index;\n\n\t\tif(this.events[key]){\n\t\t\tif(callback){\n\t\t\t\tindex = this.events[key].findIndex((item) => {\n\t\t\t\t\treturn item === callback;\n\t\t\t\t});\n\n\t\t\t\tif(index > -1){\n\t\t\t\t\tthis.events[key].splice(index, 1);\n\t\t\t\t}else{\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tdelete this.events[key];\n\t\t\t}\n\t\t}else{\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._notifySubscriptionChange(key, false);\n\t}\n\n\tsubscribed(key){\n\t\treturn this.events[key] && this.events[key].length;\n\t}\n\n\t_notifySubscriptionChange(key, subscribed){\n\t\tvar notifiers = this.subscriptionNotifiers[key];\n\n\t\tif(notifiers){\n\t\t\tnotifiers.forEach((callback)=>{\n\t\t\t\tcallback(subscribed);\n\t\t\t});\n\t\t}\n\t}\n\n\t_dispatch(){\n\t\tvar args = Array.from(arguments),\n\t\tkey = args.shift(),\n\t\tresult;\n\n\t\tif(this.events[key]){\n\t\t\tthis.events[key].forEach((callback, i) => {\n\t\t\t\tlet callResult = callback.apply(this.table, args);\n\n\t\t\t\tif(!i){\n\t\t\t\t\tresult = callResult;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t_debugDispatch(){\n\t\tvar args = Array.from(arguments),\n\t\tkey = args[0];\n\n\t\targs[0] = \"ExternalEvent:\" + args[0];\n\n\t\tif(this.debug === true || this.debug.includes(key)){\n\t\t\tconsole.log(...args);\n\t\t}\n\n\t\treturn this._dispatch(...arguments);\n\t}\n}","export default class InternalEventBus {\n\n\tconstructor(debug){\n\t\tthis.events = {};\n\t\tthis.subscriptionNotifiers = {};\n\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\n\t\tthis.debug = debug;\n\t}\n\n\tsubscriptionChange(key, callback){\n\t\tif(!this.subscriptionNotifiers[key]){\n\t\t\tthis.subscriptionNotifiers[key] = [];\n\t\t}\n\n\t\tthis.subscriptionNotifiers[key].push(callback);\n\n\t\tif(this.subscribed(key)){\n\t\t\tthis._notifySubscriptionChange(key, true);\n\t\t}\n\t}\n\n\tsubscribe(key, callback, priority = 10000){\n\t\tif(!this.events[key]){\n\t\t\tthis.events[key] = [];\n\t\t}\n\n\t\tthis.events[key].push({callback, priority});\n\n\t\tthis.events[key].sort((a, b) => {\n\t\t\treturn a.priority - b.priority;\n\t\t});\n\n\t\tthis._notifySubscriptionChange(key, true);\n\t}\n\n\tunsubscribe(key, callback){\n\t\tvar index;\n\n\t\tif(this.events[key]){\n\t\t\tif(callback){\n\t\t\t\tindex = this.events[key].findIndex((item) => {\n\t\t\t\t\treturn item.callback === callback;\n\t\t\t\t});\n\n\t\t\t\tif(index > -1){\n\t\t\t\t\tthis.events[key].splice(index, 1);\n\t\t\t\t}else{\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._notifySubscriptionChange(key, false);\n\t}\n\n\tsubscribed(key){\n\t\treturn this.events[key] && this.events[key].length;\n\t}\n\n\t_chain(key, args, initialValue, fallback){\n\t\tvar value = initialValue;\n\n\t\tif(!Array.isArray(args)){\n\t\t\targs = [args];\n\t\t}\n\n\t\tif(this.subscribed(key)){\n\t\t\tthis.events[key].forEach((subscriber, i) => {\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\n\t\t\t});\n\n\t\t\treturn value;\n\t\t}else{\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\n\t\t}\n\t}\n\n\t_confirm(key, args){\n\t\tvar confirmed = false;\n\n\t\tif(!Array.isArray(args)){\n\t\t\targs = [args];\n\t\t}\n\n\t\tif(this.subscribed(key)){\n\t\t\tthis.events[key].forEach((subscriber, i) => {\n\t\t\t\tif(subscriber.callback.apply(this, args)){\n\t\t\t\t\tconfirmed = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn confirmed;\n\t}\n\n\t_notifySubscriptionChange(key, subscribed){\n\t\tvar notifiers = this.subscriptionNotifiers[key];\n\n\t\tif(notifiers){\n\t\t\tnotifiers.forEach((callback)=>{\n\t\t\t\tcallback(subscribed);\n\t\t\t});\n\t\t}\n\t}\n\n\t_dispatch(){\n\t\tvar args = Array.from(arguments),\n\t\tkey = args.shift();\n\n\t\tif(this.events[key]){\n\t\t\tthis.events[key].forEach((subscriber) => {\n\t\t\t\tsubscriber.callback.apply(this, args);\n\t\t\t});\n\t\t}\n\t}\n\n\t_debugDispatch(){\n\t\tvar args = Array.from(arguments),\n\t\tkey = args[0];\n\n\t\targs[0] = \"InternalEvent:\" + key;\n\n\t\tif(this.debug === true || this.debug.includes(key)){\n\t\t\tconsole.log(...args);\n\t\t}\n\n\t\treturn this._dispatch(...arguments);\n\t}\n\n\t_debugChain(){\n\t\tvar args = Array.from(arguments),\n\t\tkey = args[0];\n\n\t\targs[0] = \"InternalEvent:\" + key;\n\n\t\tif(this.debug === true || this.debug.includes(key)){\n\t\t\tconsole.log(...args);\n\t\t}\n\n\t\treturn this._chain(...arguments);\n\t}\n\n\t_debugConfirm(){\n\t\tvar args = Array.from(arguments),\n\t\tkey = args[0];\n\n\t\targs[0] = \"InternalEvent:\" + key;\n\n\t\tif(this.debug === true || this.debug.includes(key)){\n\t\t\tconsole.log(...args);\n\t\t}\n\n\t\treturn this._confirm(...arguments);\n\t}\n}","import CoreFeature from '../CoreFeature.js';\n\nexport default class DeprecationAdvisor extends CoreFeature{\n\t\n\tconstructor(table){\n\t\tsuper(table);\n\t}\n\t\n\t_warnUser(){\n\t\tif(this.options(\"debugDeprecation\")){\n\t\t\tconsole.warn(...arguments);\n\t\t}\n\t}\n\t\n\tcheck(oldOption, newOption){\n\t\tvar msg = \"\";\n\t\t\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\n\t\t\tmsg = \"Deprecated Setup Option - Use of the %c\" + oldOption + \"%c option is now deprecated\";\n\t\t\t\n\t\t\tif(newOption){\n\t\t\t\tmsg = msg + \", Please use the %c\" + newOption + \"%c option instead\";\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\n\t\t\t}else{\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;');\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\tcheckMsg(oldOption, msg){\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\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;');\n\t\t\t\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\tmsg(msg){\n\t\tthis._warnUser(msg);\n\t}\n}","import Tabulator from '../Tabulator.js';\n\nclass TableRegistry {\n\n\tstatic register(table){\n\t\tTableRegistry.tables.push(table);\n\t}\n\n\tstatic deregister(table){\n\t\tvar index = TableRegistry.tables.indexOf(table);\n\n\t\tif(index > -1){\n\t\t\tTableRegistry.tables.splice(index, 1);\n\t\t}\n\t}\n\n\tstatic lookupTable(query, silent){\n\t\tvar results = [],\n\t\tmatches, match;\n\n\t\tif(typeof query === \"string\"){\n\t\t\tmatches = document.querySelectorAll(query);\n\n\t\t\tif(matches.length){\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\n\n\t\t\t\t\tif(match){\n\t\t\t\t\t\tresults.push(match);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\n\t\t\tmatch = TableRegistry.matchElement(query);\n\n\t\t\tif(match){\n\t\t\t\tresults.push(match);\n\t\t\t}\n\t\t}else if(Array.isArray(query)){\n\t\t\tquery.forEach(function(item){\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\n\t\t\t});\n\t\t}else{\n\t\t\tif(!silent){\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\n\t\t\t}\n\t\t}\n\n\t\treturn results;\n\t}\n\n\tstatic matchElement(element){\n\t\treturn TableRegistry.tables.find(function(table){\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\n\t\t});\n\t}\n}\n\nTableRegistry.tables = [];\n\nexport default TableRegistry;","import CoreFeature from '../CoreFeature.js';\nimport Helpers from './Helpers.js';\n\nexport default class Popup extends CoreFeature{\n\tconstructor(table, element, parent){\n\t\tsuper(table);\n\t\t\n\t\tthis.element = element;\n\t\tthis.container = this._lookupContainer();\n\t\t\n\t\tthis.parent = parent;\n\t\t\n\t\tthis.reversedX = false;\n\t\tthis.childPopup = null;\n\t\tthis.blurable = false;\n\t\tthis.blurCallback = null;\n\t\tthis.blurEventsBound = false;\n\t\tthis.renderedCallback = null;\n\t\t\n\t\tthis.visible = false;\n\t\tthis.hideable = true;\n\t\t\n\t\tthis.element.classList.add(\"tabulator-popup-container\");\n\t\t\n\t\tthis.blurEvent = this.hide.bind(this, false);\n\t\tthis.escEvent = this._escapeCheck.bind(this);\n\t\t\n\t\tthis.destroyBinding = this.tableDestroyed.bind(this);\n\t\tthis.destroyed = false;\n\t}\n\t\n\ttableDestroyed(){\n\t\tthis.destroyed = true;\n\t\tthis.hide(true);\n\t}\n\t\n\t_lookupContainer(){\n\t\tvar container = this.table.options.popupContainer;\n\t\t\n\t\tif(typeof container === \"string\"){\n\t\t\tcontainer = document.querySelector(container);\n\t\t\t\n\t\t\tif(!container){\n\t\t\t\tconsole.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\n\t\t\t}\n\t\t}else if (container === true){\n\t\t\tcontainer = this.table.element;\n\t\t}\n\t\t\n\t\tif(container && !this._checkContainerIsParent(container)){\n\t\t\tcontainer = false;\n\t\t\tconsole.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\n\t\t}\n\t\t\n\t\tif(!container){\n\t\t\tcontainer = document.body;\n\t\t}\n\t\t\n\t\treturn container;\n\t}\n\t\n\t_checkContainerIsParent(container, element = this.table.element){\n\t\tif(container === element){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\n\t\t}\n\t}\n\t\n\trenderCallback(callback){\n\t\tthis.renderedCallback = callback;\n\t}\n\t\n\tcontainerEventCoords(e){\n\t\tvar touch = !(e instanceof MouseEvent);\n\t\t\n\t\tvar x = touch ? e.touches[0].pageX : e.pageX;\n\t\tvar y = touch ? e.touches[0].pageY : e.pageY;\n\t\t\n\t\tif(this.container !== document.body){\n\t\t\tlet parentOffset = Helpers.elOffset(this.container);\n\t\t\t\n\t\t\tx -= parentOffset.left;\n\t\t\ty -= parentOffset.top;\n\t\t}\n\t\t\n\t\treturn {x, y};\n\t}\n\t\n\telementPositionCoords(element, position = \"right\"){\n\t\tvar offset = Helpers.elOffset(element),\n\t\tcontainerOffset, x, y;\n\t\t\n\t\tif(this.container !== document.body){\n\t\t\tcontainerOffset = Helpers.elOffset(this.container);\n\t\t\t\n\t\t\toffset.left -= containerOffset.left;\n\t\t\toffset.top -= containerOffset.top;\n\t\t}\n\t\t\n\t\tswitch(position){\n\t\t\tcase \"right\":\n\t\t\t\tx = offset.left + element.offsetWidth;\n\t\t\t\ty = offset.top - 1;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"bottom\":\n\t\t\t\tx = offset.left;\n\t\t\t\ty = offset.top + element.offsetHeight;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"left\":\n\t\t\t\tx = offset.left;\n\t\t\t\ty = offset.top - 1;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"top\":\n\t\t\t\tx = offset.left;\n\t\t\t\ty = offset.top;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"center\":\n\t\t\t\tx = offset.left + (element.offsetWidth / 2);\n\t\t\t\ty = offset.top + (element.offsetHeight / 2);\n\t\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn {x, y, offset};\n\t}\n\t\n\tshow(origin, position){\n\t\tvar x, y, parentEl, parentOffset, coords;\n\t\t\n\t\tif(this.destroyed || this.table.destroyed){\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tif(origin instanceof HTMLElement){\n\t\t\tparentEl = origin;\n\t\t\tcoords = this.elementPositionCoords(origin, position);\n\t\t\t\n\t\t\tparentOffset = coords.offset;\n\t\t\tx = coords.x;\n\t\t\ty = coords.y;\n\t\t\t\n\t\t}else if(typeof origin === \"number\"){\n\t\t\tparentOffset = {top:0, left:0};\n\t\t\tx = origin;\n\t\t\ty = position;\n\t\t}else{\n\t\t\tcoords = this.containerEventCoords(origin);\n\t\t\t\n\t\t\tx = coords.x;\n\t\t\ty = coords.y;\n\t\t\t\n\t\t\tthis.reversedX = false;\n\t\t}\n\t\t\n\t\tthis.element.style.top = y + \"px\";\n\t\tthis.element.style.left = x + \"px\";\n\t\t\n\t\tthis.container.appendChild(this.element);\n\t\t\n\t\tif(typeof this.renderedCallback === \"function\"){\n\t\t\tthis.renderedCallback();\n\t\t}\n\t\t\n\t\tthis._fitToScreen(x, y, parentEl, parentOffset, position);\n\t\t\n\t\tthis.visible = true;\n\t\t\n\t\tthis.subscribe(\"table-destroy\", this.destroyBinding);\n\t\t\n\t\tthis.element.addEventListener(\"mousedown\", (e) => {\n\t\t\te.stopPropagation();\n\t\t});\n\t\t\n\t\treturn this;\n\t}\n\t\n\t_fitToScreen(x, y, parentEl, parentOffset, position){\n\t\tvar scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\n\t\t\n\t\t//move menu to start on right edge if it is too close to the edge of the screen\n\t\tif((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\n\t\t\tthis.element.style.left = \"\";\n\t\t\t\n\t\t\tif(parentEl){\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\n\t\t\t}else{\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - x) + \"px\";\n\t\t\t}\n\t\t\t\n\t\t\tthis.reversedX = true;\n\t\t}\n\t\t\n\t\t//move menu to start on bottom edge if it is too close to the edge of the screen\n\t\tif((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\n\t\t\tif(parentEl){\n\t\t\t\tswitch(position){\n\t\t\t\t\tcase \"bottom\":\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tisVisible(){\n\t\treturn this.visible;\n\t}\n\t\n\thideOnBlur(callback){\n\t\tthis.blurable = true;\n\t\t\n\t\tif(this.visible){\n\t\t\tsetTimeout(() => {\n\t\t\t\tif(this.visible){\n\t\t\t\t\tthis.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\n\t\t\t\t\tthis.subscribe(\"cell-editing\", this.blurEvent);\n\t\t\t\t\tdocument.body.addEventListener(\"click\", this.blurEvent);\n\t\t\t\t\tdocument.body.addEventListener(\"contextmenu\", this.blurEvent);\n\t\t\t\t\tdocument.body.addEventListener(\"mousedown\", this.blurEvent);\n\t\t\t\t\twindow.addEventListener(\"resize\", this.blurEvent);\n\t\t\t\t\tdocument.body.addEventListener(\"keydown\", this.escEvent);\n\n\t\t\t\t\tthis.blurEventsBound = true;\n\t\t\t\t}\n\t\t\t}, 100);\n\t\t\t\n\t\t\tthis.blurCallback = callback;\n\t\t}\n\t\t\n\t\treturn this;\n\t}\n\t\n\t_escapeCheck(e){\n\t\tif(e.keyCode == 27){\n\t\t\tthis.hide();\n\t\t}\n\t}\n\t\n\tblockHide(){\n\t\tthis.hideable = false;\n\t}\n\t\n\trestoreHide(){\n\t\tthis.hideable = true;\n\t}\n\t\n\thide(silent = false){\n\t\tif(this.visible && this.hideable){\n\t\t\tif(this.blurable && this.blurEventsBound){\n\t\t\t\tdocument.body.removeEventListener(\"keydown\", this.escEvent);\n\t\t\t\tdocument.body.removeEventListener(\"click\", this.blurEvent);\n\t\t\t\tdocument.body.removeEventListener(\"contextmenu\", this.blurEvent);\n\t\t\t\tdocument.body.removeEventListener(\"mousedown\", this.blurEvent);\n\t\t\t\twindow.removeEventListener(\"resize\", this.blurEvent);\n\t\t\t\tthis.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\n\t\t\t\tthis.unsubscribe(\"cell-editing\", this.blurEvent);\n\n\t\t\t\tthis.blurEventsBound = false;\n\t\t\t}\n\t\t\t\n\t\t\tif(this.childPopup){\n\t\t\t\tthis.childPopup.hide();\n\t\t\t}\n\t\t\t\n\t\t\tif(this.parent){\n\t\t\t\tthis.parent.childPopup = null;\n\t\t\t}\n\t\t\t\n\t\t\tif(this.element.parentNode){\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\n\t\t\t}\n\t\t\t\n\t\t\tthis.visible = false;\n\t\t\t\n\t\t\tif(this.blurCallback && !silent){\n\t\t\t\tthis.blurCallback();\n\t\t\t}\n\t\t\t\n\t\t\tthis.unsubscribe(\"table-destroy\", this.destroyBinding);\n\t\t}\n\t\t\n\t\treturn this;\n\t}\n\t\n\tchild(element){\n\t\tif(this.childPopup){\n\t\t\tthis.childPopup.hide();\n\t\t}\n\t\t\n\t\tthis.childPopup = new Popup(this.table, element, this);\n\t\t\n\t\treturn this.childPopup;\n\t}\n}","import CoreFeature from './CoreFeature.js';\nimport Popup from './tools/Popup.js';\n\nclass Module extends CoreFeature{\n\t\n\tconstructor(table, name){\n\t\tsuper(table);\n\t\t\n\t\tthis._handler = null;\n\t}\n\t\n\tinitialize(){\n\t\t// setup module when table is initialized, to be overridden in module\n\t}\n\t\n\t\n\t///////////////////////////////////\n\t////// Options Registration ///////\n\t///////////////////////////////////\n\t\n\tregisterTableOption(key, value){\n\t\tthis.table.optionsList.register(key, value);\n\t}\n\t\n\tregisterColumnOption(key, value){\n\t\tthis.table.columnManager.optionsList.register(key, value);\n\t}\n\t\n\t///////////////////////////////////\n\t/// Public Function Registration ///\n\t///////////////////////////////////\n\t\n\tregisterTableFunction(name, func){\n\t\tif(typeof this.table[name] === \"undefined\"){\n\t\t\tthis.table[name] = (...args) => {\n\t\t\t\tthis.table.initGuard(name);\n\t\t\t\t\n\t\t\t\treturn func(...args);\n\t\t\t};\n\t\t}else{\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name);\n\t\t}\n\t}\n\t\n\tregisterComponentFunction(component, func, handler){\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\n\t}\n\t\n\t///////////////////////////////////\n\t////////// Data Pipeline //////////\n\t///////////////////////////////////\n\t\n\tregisterDataHandler(handler, priority){\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority);\n\t\tthis._handler = handler;\n\t}\n\t\n\tregisterDisplayHandler(handler, priority){\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority);\n\t\tthis._handler = handler;\n\t}\n\t\n\tdisplayRows(adjust){\n\t\tvar index = this.table.rowManager.displayRows.length - 1, \n\t\tlookupIndex;\n\t\t\n\t\tif(this._handler){\n\t\t\tlookupIndex = this.table.rowManager.displayPipeline.findIndex((item) => {\n\t\t\t\treturn item.handler === this._handler;\n\t\t\t});\n\n\t\t\tif(lookupIndex > -1){\n\t\t\t\tindex = lookupIndex;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(adjust){\n\t\t\tindex = index + adjust;\n\t\t}\n\n\t\tif(this._handler){\n\t\t\tif(index > -1){\n\t\t\t\treturn this.table.rowManager.getDisplayRows(index);\n\t\t\t}else{\n\t\t\t\treturn this.activeRows();\n\t\t\t}\n\t\t}\t\n\t}\n\t\n\tactiveRows(){\n\t\treturn this.table.rowManager.activeRows;\n\t}\n\t\n\trefreshData(renderInPosition, handler){\n\t\tif(!handler){\n\t\t\thandler = this._handler;\n\t\t}\n\t\t\n\t\tif(handler){\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\n\t\t}\n\t}\n\t\n\t///////////////////////////////////\n\t//////// Footer Management ////////\n\t///////////////////////////////////\n\t\n\tfooterAppend(element){\n\t\treturn this.table.footerManager.append(element);\n\t}\n\t\n\tfooterPrepend(element){\n\t\treturn this.table.footerManager.prepend(element);\n\t}\n\t\n\tfooterRemove(element){\n\t\treturn this.table.footerManager.remove(element);\n\t} \n\t\n\t///////////////////////////////////\n\t//////// Popups Management ////////\n\t///////////////////////////////////\n\t\n\tpopup(menuEl, menuContainer){\n\t\treturn new Popup(this.table, menuEl, menuContainer);\n\t}\n\t\n\t///////////////////////////////////\n\t//////// Alert Management ////////\n\t///////////////////////////////////\n\t\n\talert(content, type){\n\t\treturn this.table.alertManager.alert(content, type);\n\t}\n\t\n\tclearAlert(){\n\t\treturn this.table.alertManager.clear();\n\t}\n\t\n}\n\nexport default Module;","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\nexport default function(columns, forced){\n\tcolumns.forEach(function(column){\n\t\tcolumn.reinitializeWidth();\n\t});\n\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\n\t\tthis.table.modules.responsiveLayout.update();\n\t}\n}","import fitData from './modes/fitData.js';\nimport fitDataGeneral from './modes/fitDataGeneral.js';\nimport fitDataStretch from './modes/fitDataStretch.js';\nimport fitColumns from './modes/fitColumns.js';\n\nexport default {\n\tfitData:fitData,\n\tfitDataFill:fitDataGeneral,\n\tfitDataTable:fitDataGeneral,\n\tfitDataStretch:fitDataStretch,\n\tfitColumns:fitColumns ,\n};","//resize columns to fit data they contain\nexport default function(columns, forced){\n\tif(forced){\n\t\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\n\t}\n\t\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\n\t\tthis.table.modules.responsiveLayout.update();\n\t}\n}","//resize columns to fit data the contain and stretch last column to fill table\nexport default function(columns, forced){\n\tvar colsWidth = 0,\n\ttableWidth = this.table.rowManager.element.clientWidth,\n\tgap = 0,\n\tlastCol = false;\n\n\tcolumns.forEach((column, i) => {\n\t\tif(!column.widthFixed){\n\t\t\tcolumn.reinitializeWidth();\n\t\t}\n\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\n\t\t\tlastCol = column;\n\t\t}\n\n\t\tif(column.visible){\n\t\t\tcolsWidth += column.getWidth();\n\t\t}\n\t});\n\n\tif(lastCol){\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\n\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\n\t\t\tlastCol.setWidth(0);\n\t\t\tthis.table.modules.responsiveLayout.update();\n\t\t}\n\n\t\tif(gap > 0){\n\t\t\tlastCol.setWidth(gap);\n\t\t}else{\n\t\t\tlastCol.reinitializeWidth();\n\t\t}\n\t}else{\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\n\t\t\tthis.table.modules.responsiveLayout.update();\n\t\t}\n\t}\n}","//resize columns to fit\nexport default function(columns, forced){\n\tvar totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width\n\tvar fixedWidth = 0; //total width of columns with a defined width\n\tvar flexWidth = 0; //total width available to flexible columns\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks across all columns\n\tvar flexColWidth = 0; //desired width of flexible columns\n\tvar flexColumns = []; //array of flexible width columns\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks across all columns\n\tvar overflowWidth = 0; //horizontal overflow width\n\tvar gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps\n\n\tfunction calcWidth(width){\n\t\tvar colWidth;\n\n\t\tif(typeof(width) == \"string\"){\n\t\t\tif(width.indexOf(\"%\") > -1){\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\n\t\t\t}else{\n\t\t\t\tcolWidth = parseInt(width);\n\t\t\t}\n\t\t}else{\n\t\t\tcolWidth = width;\n\t\t}\n\n\t\treturn colWidth;\n\t}\n\n\t//ensure columns resize to take up the correct amount of space\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\n\t\tvar oversizeCols = [],\n\t\toversizeSpace = 0,\n\t\tremainingSpace = 0,\n\t\tnextColWidth = 0,\n\t\tremainingFlexGrowUnits = flexGrowUnits,\n\t\tgap = 0,\n\t\tchangeUnits = 0,\n\t\tundersizeCols = [];\n\n\t\tfunction calcGrow(col){\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\n\t\t}\n\n\t\tfunction calcShrink(col){\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)));\n\t\t}\n\n\t\tcolumns.forEach(function(col, i){\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\n\t\t\tif(col.column.minWidth >= width){\n\t\t\t\toversizeCols.push(col);\n\t\t\t}else{\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\n\t\t\t\t\tcol.width = col.column.maxWidth;\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\n\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\n\n\t\t\t\t\tif(remainingFlexGrowUnits){\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tundersizeCols.push(col);\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif(oversizeCols.length){\n\t\t\toversizeCols.forEach(function(col){\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\n\t\t\t\tcol.width = col.column.minWidth;\n\t\t\t});\n\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\n\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\n\n\t\t\tgap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\n\t\t}else{\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\n\n\t\t\tundersizeCols.forEach(function(column){\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\n\t\t\t});\n\t\t}\n\n\t\treturn gap;\n\t}\n\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\n\t\tthis.table.modules.responsiveLayout.update();\n\t}\n\n\t//adjust for vertical scrollbar if present\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\n\t}\n\n\tcolumns.forEach(function(column){\n\t\tvar width, minWidth, colWidth;\n\n\t\tif(column.visible){\n\n\t\t\twidth = column.definition.width;\n\t\t\tminWidth = parseInt(column.minWidth);\n\n\t\t\tif(width){\n\n\t\t\t\tcolWidth = calcWidth(width);\n\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\n\n\t\t\t\tif(column.definition.widthShrink){\n\t\t\t\t\tfixedShrinkColumns.push({\n\t\t\t\t\t\tcolumn:column,\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\n\t\t\t\t\t});\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\tflexColumns.push({\n\t\t\t\t\tcolumn:column,\n\t\t\t\t\twidth:0,\n\t\t\t\t});\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\n\t\t\t}\n\t\t}\n\t});\n\n\t//calculate available space\n\tflexWidth = totalWidth - fixedWidth;\n\n\t//calculate correct column size\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits);\n\n\t//generate column widths\n\tgapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\n\n\t//increase width of last column to account for rounding errors\n\tif(flexColumns.length && gapFill > 0){\n\t\tflexColumns[flexColumns.length-1].width += gapFill;\n\t}\n\n\t//calculate space for columns to be shrunk into\n\tflexColumns.forEach(function(col){\n\t\tflexWidth -= col.width;\n\t});\n\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\n\n\t//shrink oversize columns if there is no available space\n\tif(overflowWidth > 0 && flexShrinkUnits){\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\n\t}\n\n\t//decrease width of last column to account for rounding errors\n\tif(gapFill && fixedShrinkColumns.length){\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\n\t}\n\n\tflexColumns.forEach(function(col){\n\t\tcol.column.setWidth(col.width);\n\t});\n\n\tfixedShrinkColumns.forEach(function(col){\n\t\tcol.column.setWidth(col.width);\n\t});\n}\n","import Module from '../../core/Module.js';\n\nimport defaultModes from './defaults/modes.js';\n\nclass Layout extends Module{\n\n\tconstructor(table){\n\t\tsuper(table, \"layout\");\n\n\t\tthis.mode = null;\n\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\n\n\t\tthis.registerColumnOption(\"widthGrow\");\n\t\tthis.registerColumnOption(\"widthShrink\");\n\t}\n\n\t//initialize layout system\n\tinitialize(){\n\t\tvar layout = this.table.options.layout;\n\n\t\tif(Layout.modes[layout]){\n\t\t\tthis.mode = layout;\n\t\t}else{\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\n\t\t\tthis.mode = 'fitData';\n\t\t}\n\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\n\t}\n\n\tgetMode(){\n\t\treturn this.mode;\n\t}\n\n\t//trigger table layout\n\tlayout(dataChanged){\n\t\tthis.dispatch(\"layout-refreshing\");\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex, dataChanged);\n\t\tthis.dispatch(\"layout-refreshed\");\n\t}\n}\n\nLayout.moduleName = \"layout\";\n\n//load defaults\nLayout.modes = defaultModes;\n\nexport default Layout;","import Module from '../../core/Module.js';\n\nimport Helpers from '../../core/tools/Helpers.js';\n\nimport defaultLangs from './defaults/langs.js';\n\nclass Localize extends Module{\n\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.locale = \"default\"; //current locale\n\t\tthis.lang = false; //current language\n\t\tthis.bindings = {}; //update events to call when locale is changed\n\t\tthis.langList = {};\n\n\t\tthis.registerTableOption(\"locale\", false); //current system language\n\t\tthis.registerTableOption(\"langs\", {});\n\t}\n\n\tinitialize(){\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\n\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\n\t\t}\n\n\t\tfor(let locale in this.table.options.langs){\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\n\t\t}\n\n\t\tthis.setLocale(this.table.options.locale);\n\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\n\t}\n\n\t//set header placeholder\n\tsetHeaderFilterPlaceholder(placeholder){\n\t\tthis.langList.default.headerFilters.default = placeholder;\n\t}\n\n\t//setup a lang description object\n\tinstallLang(locale, lang){\n\t\tif(this.langList[locale]){\n\t\t\tthis._setLangProp(this.langList[locale], lang);\n\t\t}else{\n\t\t\tthis.langList[locale] = lang;\n\t\t}\n\t}\n\n\t_setLangProp(lang, values){\n\t\tfor(let key in values){\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\n\t\t\t\tthis._setLangProp(lang[key], values[key]);\n\t\t\t}else{\n\t\t\t\tlang[key] = values[key];\n\t\t\t}\n\t\t}\n\t}\n\n\t//set current locale\n\tsetLocale(desiredLocale){\n\t\tdesiredLocale = desiredLocale || \"default\";\n\n\t\t//fill in any matching language values\n\t\tfunction traverseLang(trans, path){\n\t\t\tfor(var prop in trans){\n\t\t\t\tif(typeof trans[prop] == \"object\"){\n\t\t\t\t\tif(!path[prop]){\n\t\t\t\t\t\tpath[prop] = {};\n\t\t\t\t\t}\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\n\t\t\t\t}else{\n\t\t\t\t\tpath[prop] = trans[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//determining correct locale to load\n\t\tif(desiredLocale === true && navigator.language){\n\t\t\t//get local from system\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\n\t\t}\n\n\t\tif(desiredLocale){\n\t\t\t//if locale is not set, check for matching top level locale else use default\n\t\t\tif(!this.langList[desiredLocale]){\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\n\n\t\t\t\tif(this.langList[prefix]){\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\n\t\t\t\t\tdesiredLocale = prefix;\n\t\t\t\t}else{\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\n\t\t\t\t\tdesiredLocale = \"default\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.locale = desiredLocale;\n\n\t\t//load default lang template\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\n\n\t\tif(desiredLocale != \"default\"){\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\n\t\t}\n\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\n\n\t\tthis._executeBindings();\n\t}\n\n\t//get current locale\n\tgetLocale(locale){\n\t\treturn this.locale;\n\t}\n\n\t//get lang object for given local or current if none provided\n\tgetLang(locale){\n\t\treturn locale ? this.langList[locale] : this.lang;\n\t}\n\n\t//get text for current locale\n\tgetText(path, value){\n\t\tvar fillPath = value ? path + \"|\" + value : path,\n\t\tpathArray = fillPath.split(\"|\"),\n\t\ttext = this._getLangElement(pathArray, this.locale);\n\n\t\t// if(text === false){\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\n\t\t// }\n\n\t\treturn text || \"\";\n\t}\n\n\t//traverse langs object and find localized copy\n\t_getLangElement(path, locale){\n\t\tvar root = this.lang;\n\n\t\tpath.forEach(function(level){\n\t\t\tvar rootPath;\n\n\t\t\tif(root){\n\t\t\t\trootPath = root[level];\n\n\t\t\t\tif(typeof rootPath != \"undefined\"){\n\t\t\t\t\troot = rootPath;\n\t\t\t\t}else{\n\t\t\t\t\troot = false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn root;\n\t}\n\n\t//set update binding\n\tbind(path, callback){\n\t\tif(!this.bindings[path]){\n\t\t\tthis.bindings[path] = [];\n\t\t}\n\n\t\tthis.bindings[path].push(callback);\n\n\t\tcallback(this.getText(path), this.lang);\n\t}\n\n\t//iterate through bindings and trigger updates\n\t_executeBindings(){\n\t\tfor(let path in this.bindings){\n\t\t\tthis.bindings[path].forEach((binding) => {\n\t\t\t\tbinding(this.getText(path), this.lang);\n\t\t\t});\n\t\t}\n\t}\n}\n\nLocalize.moduleName = \"localize\";\n\n//load defaults\nLocalize.langs = defaultLangs;\n\nexport default Localize;","export default {\n\t\"default\":{ //hold default locale text\n\t\t\"groups\":{\n\t\t\t\"item\":\"item\",\n\t\t\t\"items\":\"items\",\n\t\t},\n\t\t\"columns\":{\n\t\t},\n\t\t\"data\":{\n\t\t\t\"loading\":\"Loading\",\n\t\t\t\"error\":\"Error\",\n\t\t},\n\t\t\"pagination\":{\n\t\t\t\"page_size\":\"Page Size\",\n\t\t\t\"page_title\":\"Show Page\",\n\t\t\t\"first\":\"First\",\n\t\t\t\"first_title\":\"First Page\",\n\t\t\t\"last\":\"Last\",\n\t\t\t\"last_title\":\"Last Page\",\n\t\t\t\"prev\":\"Prev\",\n\t\t\t\"prev_title\":\"Prev Page\",\n\t\t\t\"next\":\"Next\",\n\t\t\t\"next_title\":\"Next Page\",\n\t\t\t\"all\":\"All\",\n\t\t\t\"counter\":{\n\t\t\t\t\"showing\": \"Showing\",\n\t\t\t\t\"of\": \"of\",\n\t\t\t\t\"rows\": \"rows\",\n\t\t\t\t\"pages\": \"pages\",\n\t\t\t}\n\t\t},\n\t\t\"headerFilters\":{\n\t\t\t\"default\":\"filter column...\",\n\t\t\t\"columns\":{}\n\t\t}\n\t},\n};","import Module from '../../core/Module.js';\nimport TableRegistry from '../../core/tools/TableRegistry.js';\n\nclass Comms extends Module{\n\n\tconstructor(table){\n\t\tsuper(table);\n\t}\n\n\tinitialize(){\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\n\t}\n\n\tgetConnections(selectors){\n\t\tvar connections = [],\n\t\tconnection;\n\n\t\tconnection = TableRegistry.lookupTable(selectors);\n\n\t\tconnection.forEach((con) =>{\n\t\t\tif(this.table !== con){\n\t\t\t\tconnections.push(con);\n\t\t\t}\n\t\t});\n\n\t\treturn connections;\n\t}\n\n\tsend(selectors, module, action, data){\n\t\tvar connections = this.getConnections(selectors);\n\n\t\tconnections.forEach((connection) => {\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\n\t\t});\n\n\t\tif(!connections.length && selectors){\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\n\t\t}\n\t}\n\n\treceive(table, module, action, data){\n\t\tif(this.table.modExists(module)){\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\n\t\t}else{\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\n\t\t}\n\t}\n}\n\nComms.moduleName = \"comms\";\n\nexport default Comms;","import * as coreModules from '../modules/core.js';\nimport TableRegistry from './TableRegistry.js';\n\nexport default class ModuleBinder {\n\t\n\tconstructor(tabulator, modules){\n\t\tthis.bindStaticFunctionality(tabulator);\n\t\tthis.bindModules(tabulator, coreModules, true);\n\t\t\n\t\tif(modules){\n\t\t\tthis.bindModules(tabulator, modules);\n\t\t}\n\t}\n\t\n\tbindStaticFunctionality(tabulator){\n\t\ttabulator.moduleBindings = {};\n\t\t\n\t\ttabulator.extendModule = function(name, property, values){\n\t\t\tif(tabulator.moduleBindings[name]){\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\n\t\t\t\t\n\t\t\t\tif(source){\n\t\t\t\t\tif(typeof values == \"object\"){\n\t\t\t\t\t\tfor(let key in values){\n\t\t\t\t\t\t\tsource[key] = values[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\n\t\t\t}\n\t\t};\n\t\t\n\t\ttabulator.registerModule = function(modules){\n\t\t\tif(!Array.isArray(modules)){\n\t\t\t\tmodules = [modules];\n\t\t\t}\n\t\t\t\n\t\t\tmodules.forEach((mod) => {\n\t\t\t\ttabulator.registerModuleBinding(mod);\n\t\t\t});\n\t\t};\n\t\t\n\t\ttabulator.registerModuleBinding = function(mod){\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\n\t\t};\n\t\t\n\t\ttabulator.findTable = function(query){\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\n\t\t};\n\t\t\n\t\t//ensure that module are bound to instantiated function\n\t\ttabulator.prototype.bindModules = function(){\n\t\t\tvar orderedStartMods = [],\n\t\t\torderedEndMods = [],\n\t\t\tunOrderedMods = [];\n\t\t\t\n\t\t\tthis.modules = {};\n\t\t\t\n\t\t\tfor(var name in tabulator.moduleBindings){\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\n\t\t\t\tlet module = new mod(this);\n\t\t\t\t\n\t\t\t\tthis.modules[name] = module;\n\t\t\t\t\n\t\t\t\tif(mod.prototype.moduleCore){\n\t\t\t\t\tthis.modulesCore.push(module);\n\t\t\t\t}else{\n\t\t\t\t\tif(mod.moduleInitOrder){\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\n\t\t\t\t\t\t\torderedStartMods.push(module);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\torderedEndMods.push(module);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tunOrderedMods.push(module);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\n\t\t\t\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\n\t\t};\n\t}\n\t\n\tbindModules(tabulator, modules, core){\n\t\tvar mods = Object.values(modules);\n\t\t\n\t\tif(core){\n\t\t\tmods.forEach((mod) => {\n\t\t\t\tmod.prototype.moduleCore = true;\n\t\t\t});\n\t\t}\n\t\t\n\t\ttabulator.registerModule(mods);\n\t}\n}","import CoreFeature from '../CoreFeature.js';\n\nexport default class Alert extends CoreFeature{\n\tconstructor(table){\n\t\tsuper(table);\n \n\t\tthis.element = this._createAlertElement();\n\t\tthis.msgElement = this._createMsgElement();\n\t\tthis.type = null;\n \n\t\tthis.element.appendChild(this.msgElement);\n\t}\n \n\t_createAlertElement(){\n\t\tvar el = document.createElement(\"div\");\n\t\tel.classList.add(\"tabulator-alert\");\n\t\treturn el;\n\t}\n \n\t_createMsgElement(){\n\t\tvar el = document.createElement(\"div\");\n\t\tel.classList.add(\"tabulator-alert-msg\");\n\t\tel.setAttribute(\"role\", \"alert\");\n\t\treturn el;\n\t}\n \n\t_typeClass(){\n\t\treturn \"tabulator-alert-state-\" + this.type;\n\t}\n \n\talert(content, type = \"msg\"){\n\t\tif(content){\n\t\t\tthis.clear();\n \n\t\t\tthis.type = type;\n \n\t\t\twhile(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\n \n\t\t\tthis.msgElement.classList.add(this._typeClass());\n \n\t\t\tif(typeof content === \"function\"){\n\t\t\t\tcontent = content();\n\t\t\t}\n \n\t\t\tif(content instanceof HTMLElement){\n\t\t\t\tthis.msgElement.appendChild(content);\n\t\t\t}else{\n\t\t\t\tthis.msgElement.innerHTML = content;\n\t\t\t}\n \n\t\t\tthis.table.element.appendChild(this.element);\n\t\t}\n\t}\n \n\tclear(){\n\t\tif(this.element.parentNode){\n\t\t\tthis.element.parentNode.removeChild(this.element);\n\t\t}\n \n\t\tthis.msgElement.classList.remove(this._typeClass());\n\t}\n}","'use strict';\n\nimport defaultOptions from './defaults/options.js';\n\nimport ColumnManager from './ColumnManager.js';\nimport RowManager from './RowManager.js';\nimport FooterManager from './FooterManager.js';\n\nimport InteractionMonitor from './tools/InteractionMonitor.js';\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\nimport DataLoader from './tools/DataLoader.js';\n\nimport ExternalEventBus from './tools/ExternalEventBus.js';\nimport InternalEventBus from './tools/InternalEventBus.js';\n\nimport DeprecationAdvisor from './tools/DeprecationAdvisor.js';\n\nimport TableRegistry from './tools/TableRegistry.js';\nimport ModuleBinder from './tools/ModuleBinder.js';\n\nimport OptionsList from './tools/OptionsList.js';\n\nimport Alert from './tools/Alert.js';\n\nclass Tabulator {\n\t\n\tconstructor(element, options){\n\t\t\n\t\tthis.options = {};\n\t\t\n\t\tthis.columnManager = null; // hold Column Manager\n\t\tthis.rowManager = null; //hold Row Manager\n\t\tthis.footerManager = null; //holder Footer Manager\n\t\tthis.alertManager = null; //hold Alert Manager\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\n\t\tthis.externalEvents = null; //handle external event messaging\n\t\tthis.eventBus = null; //handle internal event messaging\n\t\tthis.interactionMonitor = false; //track user interaction\n\t\tthis.browser = \"\"; //hold current browser type\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\n\t\tthis.rtl = false; //check if the table is in RTL mode\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\n\t\t\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\n\t\tthis.dataLoader = false; //bind component functions\n\t\t\n\t\tthis.modules = {}; //hold all modules bound to this table\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\n\t\t\n\t\tthis.deprecationAdvisor = new DeprecationAdvisor(this);\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\n\t\t\n\t\tthis.initialized = false;\n\t\tthis.destroyed = false;\n\t\t\n\t\tif(this.initializeElement(element)){\n\t\t\t\n\t\t\tthis.initializeCoreSystems(options);\n\t\t\t\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis._create();\n\t\t\t});\n\t\t}\n\t\t\n\t\tTableRegistry.register(this); //register table for inter-device communication\n\t}\n\t\n\tinitializeElement(element){\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\n\t\t\tthis.element = element;\n\t\t\treturn true;\n\t\t}else if(typeof element === \"string\"){\n\t\t\tthis.element = document.querySelector(element);\n\t\t\t\n\t\t\tif(this.element){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else{\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tinitializeCoreSystems(options){\n\t\tthis.columnManager = new ColumnManager(this);\n\t\tthis.rowManager = new RowManager(this);\n\t\tthis.footerManager = new FooterManager(this);\n\t\tthis.dataLoader = new DataLoader(this);\n\t\tthis.alertManager = new Alert(this);\n\t\t\n\t\tthis.bindModules();\n\t\t\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options);\n\t\t\n\t\tthis._clearObjectPointers();\n\t\t\n\t\tthis._mapDeprecatedFunctionality();\n\t\t\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\n\t\t\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\n\t\t\n\t\tthis.dataLoader.initialize();\n\t\t// this.columnManager.initialize();\n\t\t// this.rowManager.initialize();\n\t\tthis.footerManager.initialize();\n\t}\n\t\n\t//convert deprecated functionality to new functions\n\t_mapDeprecatedFunctionality(){\n\t\t//all previously deprecated functionality removed in the 5.0 release\n\t}\n\t\n\t_clearSelection(){\n\t\t\n\t\tthis.element.classList.add(\"tabulator-block-select\");\n\t\t\n\t\tif (window.getSelection) {\n\t\t\tif (window.getSelection().empty) { // Chrome\n\t\t\t\twindow.getSelection().empty();\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\n\t\t\t\twindow.getSelection().removeAllRanges();\n\t\t\t}\n\t\t} else if (document.selection) { // IE?\n\t\t\tdocument.selection.empty();\n\t\t}\n\t\t\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\n\t}\n\t\n\t//create table\n\t_create(){\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\n\t\tthis.eventBus.dispatch(\"table-building\");\n\t\t\n\t\tthis._rtlCheck();\n\t\t\n\t\tthis._buildElement();\n\t\t\n\t\tthis._initializeTable();\n\t\t\n\t\tthis._loadInitialData();\n\t\t\n\t\tthis.initialized = true;\n\t\t\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\n\t}\n\t\n\t_rtlCheck(){\n\t\tvar style = window.getComputedStyle(this.element);\n\t\t\n\t\tswitch(this.options.textDirection){\n\t\t\tcase\"auto\":\n\t\t\t\tif(style.direction !== \"rtl\"){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\tcase \"rtl\":\n\t\t\t\tthis.element.classList.add(\"tabulator-rtl\");\n\t\t\t\tthis.rtl = true;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"ltr\":\n\t\t\t\tthis.element.classList.add(\"tabulator-ltr\");\n\t\t\t\n\t\t\tdefault:\n\t\t\t\tthis.rtl = false;\n\t\t}\n\t}\n\t\n\t//clear pointers to objects in default config object\n\t_clearObjectPointers(){\n\t\tthis.options.columns = this.options.columns.slice(0);\n\t\t\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\n\t\t\tthis.options.data = this.options.data.slice(0);\n\t\t}\n\t}\n\t\n\t//build tabulator element\n\t_buildElement(){\n\t\tvar element = this.element,\n\t\toptions = this.options,\n\t\tnewElement;\n\t\t\n\t\tif(element.tagName === \"TABLE\"){\n\t\t\tthis.originalElement = this.element;\n\t\t\tnewElement = document.createElement(\"div\");\n\t\t\t\n\t\t\t//transfer attributes to new element\n\t\t\tvar attributes = element.attributes;\n\t\t\t\n\t\t\t// loop through attributes and apply them on div\n\t\t\tfor(var i in attributes){\n\t\t\t\tif(typeof attributes[i] == \"object\"){\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// replace table with div element\n\t\t\telement.parentNode.replaceChild(newElement, element);\n\t\t\t\n\t\t\tthis.element = element = newElement;\n\t\t}\n\t\t\n\t\telement.classList.add(\"tabulator\");\n\t\telement.setAttribute(\"role\", \"grid\");\n\t\t\n\t\t//empty element\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\n\t\t\n\t\t//set table height\n\t\tif(options.height){\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\n\t\t\telement.style.height = options.height;\n\t\t}\n\t\t\n\t\t//set table min height\n\t\tif(options.minHeight !== false){\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\n\t\t\telement.style.minHeight = options.minHeight;\n\t\t}\n\t\t\n\t\t//set table maxHeight\n\t\tif(options.maxHeight !== false){\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\n\t\t\telement.style.maxHeight = options.maxHeight;\n\t\t}\n\t}\n\t\n\t//initialize core systems and modules\n\t_initializeTable(){\n\t\tvar element = this.element,\n\t\toptions = this.options;\n\t\t\n\t\tthis.interactionMonitor.initialize();\n\t\t\n\t\tthis.columnManager.initialize();\n\t\tthis.rowManager.initialize();\n\t\t\n\t\tthis._detectBrowser();\n\t\t\n\t\t//initialize core modules\n\t\tthis.modulesCore.forEach((mod) => {\n\t\t\tmod.initialize();\n\t\t});\n\t\t\n\t\t//build table elements\n\t\telement.appendChild(this.columnManager.getElement());\n\t\telement.appendChild(this.rowManager.getElement());\n\t\t\n\t\tif(options.footerElement){\n\t\t\tthis.footerManager.activate();\n\t\t}\n\t\t\n\t\tif(options.autoColumns && options.data){\n\t\t\t\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\n\t\t}\n\t\t\n\t\t//initialize regular modules\n\t\tthis.modulesRegular.forEach((mod) => {\n\t\t\tmod.initialize();\n\t\t});\n\t\t\n\t\tthis.columnManager.setColumns(options.columns);\n\t\t\n\t\tthis.eventBus.dispatch(\"table-built\");\n\t}\n\t\n\t_loadInitialData(){\n\t\tthis.dataLoader.load(this.options.data);\n\t}\n\t\n\t//deconstructor\n\tdestroy(){\n\t\tvar element = this.element;\n\t\t\n\t\tthis.destroyed = true;\n\t\t\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\n\t\t\n\t\tthis.eventBus.dispatch(\"table-destroy\");\n\t\t\n\t\t//clear row data\n\t\tthis.rowManager.destroy();\n\t\t\n\t\t//clear DOM\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\n\t\telement.classList.remove(\"tabulator\");\n\n\t\tthis.externalEvents.dispatch(\"tableDestroyed\");\n\t}\n\t\n\t_detectBrowser(){\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\n\t\t\n\t\tif(ua.indexOf(\"Trident\") > -1){\n\t\t\tthis.browser = \"ie\";\n\t\t\tthis.browserSlow = true;\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\n\t\t\tthis.browser = \"edge\";\n\t\t\tthis.browserSlow = true;\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\n\t\t\tthis.browser = \"firefox\";\n\t\t\tthis.browserSlow = false;\n\t\t}else if(ua.indexOf(\"Mac OS\") > -1){\n\t\t\tthis.browser = \"safari\";\n\t\t\tthis.browserSlow = false;\n\t\t}else{\n\t\t\tthis.browser = \"other\";\n\t\t\tthis.browserSlow = false;\n\t\t}\n\t\t\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));\n\t}\n\t\n\tinitGuard(func, msg){\n\t\tvar stack, line;\n\t\t\n\t\tif(this.options.debugInitialization && !this.initialized){\n\t\t\tif(!func){\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\n\t\t\t\t\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\n\t\t\t\t\n\t\t\t\tif(line[0] == \" \"){\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\n\t\t\t\t}else{\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\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 : \"\"));\n\t\t}\n\t\t\n\t\treturn this.initialized;\n\t}\n\t\n\t////////////////// Data Handling //////////////////\n\t//block table redrawing\n\tblockRedraw(){\n\t\tthis.initGuard();\n\n\t\tthis.eventBus.dispatch(\"redraw-blocking\");\n\t\t\n\t\tthis.rowManager.blockRedraw();\n\t\tthis.columnManager.blockRedraw();\n\n\t\tthis.eventBus.dispatch(\"redraw-blocked\");\n\t}\n\t\n\t//restore table redrawing\n\trestoreRedraw(){\n\t\tthis.initGuard();\n\n\t\tthis.eventBus.dispatch(\"redraw-restoring\");\n\n\t\tthis.rowManager.restoreRedraw();\n\t\tthis.columnManager.restoreRedraw();\n\n\t\tthis.eventBus.dispatch(\"redraw-restored\");\n\t}\n\t\n\t//load data\n\tsetData(data, params, config){\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\n\t\t\n\t\treturn this.dataLoader.load(data, params, config, false);\n\t}\n\t\n\t//clear data\n\tclearData(){\n\t\tthis.initGuard();\n\t\t\n\t\tthis.dataLoader.blockActiveLoad();\n\t\tthis.rowManager.clearData();\n\t}\n\t\n\t//get table data array\n\tgetData(active){\n\t\treturn this.rowManager.getData(active);\n\t}\n\t\n\t//get table data array count\n\tgetDataCount(active){\n\t\treturn this.rowManager.getDataCount(active);\n\t}\n\t\n\t//replace data, keeping table in position with same sort\n\treplaceData(data, params, config){\n\t\tthis.initGuard();\n\t\t\n\t\treturn this.dataLoader.load(data, params, config, true, true);\n\t}\n\t\n\t//update table data\n\tupdateData(data){\n\t\tvar responses = 0;\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.dataLoader.blockActiveLoad();\n\t\t\t\n\t\t\tif(typeof data === \"string\"){\n\t\t\t\tdata = JSON.parse(data);\n\t\t\t}\n\t\t\t\n\t\t\tif(data && data.length > 0){\n\t\t\t\tdata.forEach((item) => {\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\n\t\t\t\t\t\n\t\t\t\t\tif(row){\n\t\t\t\t\t\tresponses++;\n\t\t\t\t\t\t\n\t\t\t\t\t\trow.updateData(item)\n\t\t\t\t\t\t\t.then(()=>{\n\t\t\t\t\t\t\t\tresponses--;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!responses){\n\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch((e) => {\n\t\t\t\t\t\t\t\treject(\"Update Error - Unable to update row\", item, e);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}else{\n\t\t\t\t\t\treject(\"Update Error - Unable to find row\", item);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\n\t\t\t\treject(\"Update Error - No data provided\");\n\t\t\t}\n\t\t});\n\t}\n\t\n\taddData(data, pos, index){\n\t\tthis.initGuard();\n\t\t\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.dataLoader.blockActiveLoad();\n\t\t\t\n\t\t\tif(typeof data === \"string\"){\n\t\t\t\tdata = JSON.parse(data);\n\t\t\t}\n\t\t\t\n\t\t\tif(data){\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\n\t\t\t\t\t.then((rows) => {\n\t\t\t\t\t\tvar output = [];\n\t\t\t\t\t\n\t\t\t\t\t\trows.forEach(function(row){\n\t\t\t\t\t\t\toutput.push(row.getComponent());\n\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t\tresolve(output);\n\t\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\n\t\t\t\treject(\"Update Error - No data provided\");\n\t\t\t}\n\t\t});\n\t}\n\t\n\t//update table data\n\tupdateOrAddData(data){\n\t\tvar rows = [],\n\t\tresponses = 0;\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.dataLoader.blockActiveLoad();\n\t\t\t\n\t\t\tif(typeof data === \"string\"){\n\t\t\t\tdata = JSON.parse(data);\n\t\t\t}\n\t\t\t\n\t\t\tif(data && data.length > 0){\n\t\t\t\tdata.forEach((item) => {\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\n\t\t\t\t\t\n\t\t\t\t\tresponses++;\n\t\t\t\t\t\n\t\t\t\t\tif(row){\n\t\t\t\t\t\trow.updateData(item)\n\t\t\t\t\t\t\t.then(()=>{\n\t\t\t\t\t\t\t\tresponses--;\n\t\t\t\t\t\t\t\trows.push(row.getComponent());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!responses){\n\t\t\t\t\t\t\t\t\tresolve(rows);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.rowManager.addRows(item)\n\t\t\t\t\t\t\t.then((newRows)=>{\n\t\t\t\t\t\t\t\tresponses--;\n\t\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!responses){\n\t\t\t\t\t\t\t\t\tresolve(rows);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\n\t\t\t\treject(\"Update Error - No data provided\");\n\t\t\t}\n\t\t});\n\t}\n\t\n\t//get row object\n\tgetRow(index){\n\t\tvar row = this.rowManager.findRow(index);\n\t\t\n\t\tif(row){\n\t\t\treturn row.getComponent();\n\t\t}else{\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//get row object\n\tgetRowFromPosition(position){\n\t\tvar row = this.rowManager.getRowFromPosition(position);\n\t\t\n\t\tif(row){\n\t\t\treturn row.getComponent();\n\t\t}else{\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t//delete row from table\n\tdeleteRow(index){\n\t\tvar foundRows = [];\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(!Array.isArray(index)){\n\t\t\tindex = [index];\n\t\t}\n\t\t\n\t\t//find matching rows\n\t\tfor(let item of index){\n\t\t\tlet row = this.rowManager.findRow(item, true);\n\t\t\t\n\t\t\tif(row){\n\t\t\t\tfoundRows.push(row);\n\t\t\t}else{\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t//sort rows into correct order to ensure smooth delete from table\n\t\tfoundRows.sort((a, b) => {\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\n\t\t});\n\t\t\n\t\t//delete rows\n\t\tfoundRows.forEach((row) =>{\n\t\t\trow.delete();\n\t\t});\n\t\t\n\t\tthis.rowManager.reRenderInPosition();\n\t\t\n\t\treturn Promise.resolve();\n\t}\n\t\n\t//add row to table\n\taddRow(data, pos, index){\n\t\tthis.initGuard();\n\t\t\n\t\tif(typeof data === \"string\"){\n\t\t\tdata = JSON.parse(data);\n\t\t}\n\t\t\n\t\treturn this.rowManager.addRows(data, pos, index, true)\n\t\t\t.then((rows)=>{\n\t\t\t\treturn rows[0].getComponent();\n\t\t\t});\n\t}\n\t\n\t//update a row if it exists otherwise create it\n\tupdateOrAddRow(index, data){\n\t\tvar row = this.rowManager.findRow(index);\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(typeof data === \"string\"){\n\t\t\tdata = JSON.parse(data);\n\t\t}\n\t\t\n\t\tif(row){\n\t\t\treturn row.updateData(data)\n\t\t\t\t.then(()=>{\n\t\t\t\t\treturn row.getComponent();\n\t\t\t\t});\n\t\t}else{\n\t\t\treturn this.rowManager.addRows(data)\n\t\t\t\t.then((rows)=>{\n\t\t\t\t\treturn rows[0].getComponent();\n\t\t\t\t});\n\t\t}\n\t}\n\t\n\t//update row data\n\tupdateRow(index, data){\n\t\tvar row = this.rowManager.findRow(index);\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(typeof data === \"string\"){\n\t\t\tdata = JSON.parse(data);\n\t\t}\n\t\t\n\t\tif(row){\n\t\t\treturn row.updateData(data)\n\t\t\t\t.then(()=>{\n\t\t\t\t\treturn Promise.resolve(row.getComponent());\n\t\t\t\t});\n\t\t}else{\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\n\t\t}\n\t}\n\t\n\t//scroll to row in DOM\n\tscrollToRow(index, position, ifVisible){\n\t\tvar row = this.rowManager.findRow(index);\n\t\t\n\t\tif(row){\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible);\n\t\t}else{\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\n\t\t}\n\t}\n\t\n\tmoveRow(from, to, after){\n\t\tvar fromRow = this.rowManager.findRow(from);\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(fromRow){\n\t\t\tfromRow.moveToRow(to, after);\n\t\t}else{\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\n\t\t}\n\t}\n\t\n\tgetRows(active){\n\t\treturn this.rowManager.getComponents(active);\t\n\t}\n\t\n\t//get position of row in table\n\tgetRowPosition(index){\n\t\tvar row = this.rowManager.findRow(index);\n\t\t\n\t\tif(row){\n\t\t\treturn row.getPosition();\n\t\t}else{\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t/////////////// Column Functions ///////////////\n\tsetColumns(definition){\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\n\t\t\n\t\tthis.columnManager.setColumns(definition);\n\t}\n\t\n\tgetColumns(structured){\n\t\treturn this.columnManager.getComponents(structured);\n\t}\n\t\n\tgetColumn(field){\n\t\tvar column = this.columnManager.findColumn(field);\n\t\t\n\t\tif(column){\n\t\t\treturn column.getComponent();\n\t\t}else{\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tgetColumnDefinitions(){\n\t\treturn this.columnManager.getDefinitionTree();\n\t}\n\t\n\tshowColumn(field){\n\t\tvar column = this.columnManager.findColumn(field);\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(column){\n\t\t\tcolumn.show();\n\t\t}else{\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\thideColumn(field){\n\t\tvar column = this.columnManager.findColumn(field); \n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(column){\n\t\t\tcolumn.hide();\n\t\t}else{\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\ttoggleColumn(field){\n\t\tvar column = this.columnManager.findColumn(field);\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(column){\n\t\t\tif(column.visible){\n\t\t\t\tcolumn.hide();\n\t\t\t}else{\n\t\t\t\tcolumn.show();\n\t\t\t}\n\t\t}else{\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\taddColumn(definition, before, field){\n\t\tvar column = this.columnManager.findColumn(field);\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\treturn this.columnManager.addColumn(definition, before, column)\n\t\t\t.then((column) => {\n\t\t\t\treturn column.getComponent();\n\t\t\t});\n\t}\n\t\n\tdeleteColumn(field){\n\t\tvar column = this.columnManager.findColumn(field);\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(column){\n\t\t\treturn column.delete();\n\t\t}else{\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\n\t\t\treturn Promise.reject();\n\t\t}\n\t}\n\t\n\tupdateColumnDefinition(field, definition){\n\t\tvar column = this.columnManager.findColumn(field);\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(column){\n\t\t\treturn column.updateDefinition(definition);\n\t\t}else{\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\n\t\t\treturn Promise.reject();\n\t\t}\n\t}\n\t\n\tmoveColumn(from, to, after){\n\t\tvar fromColumn = this.columnManager.findColumn(from),\n\t\ttoColumn = this.columnManager.findColumn(to);\n\t\t\n\t\tthis.initGuard();\n\t\t\n\t\tif(fromColumn){\n\t\t\tif(toColumn){\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after);\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\n\t\t\t}\n\t\t}else{\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\n\t\t}\n\t}\n\t\n\t//scroll to column in DOM\n\tscrollToColumn(field, position, ifVisible){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tvar column = this.columnManager.findColumn(field);\n\t\t\t\n\t\t\tif(column){\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible);\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\n\t\t\t}\n\t\t});\n\t}\n\t\n\t//////////// General Public Functions ////////////\n\t//redraw list without updating data\n\tredraw(force){\n\t\tthis.initGuard();\n\n\t\tthis.columnManager.redraw(force);\n\t\tthis.rowManager.redraw(force);\n\t}\n\t\n\tsetHeight(height){\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\n\t\tthis.element.style.height = this.options.height;\n\t\tthis.rowManager.initializeRenderer();\n\t\tthis.rowManager.redraw();\n\t}\n\t\n\t//////////////////// Event Bus ///////////////////\n\t\n\ton(key, callback){\n\t\tthis.externalEvents.subscribe(key, callback);\n\t}\n\t\n\toff(key, callback){\n\t\tthis.externalEvents.unsubscribe(key, callback);\n\t}\n\t\n\tdispatchEvent(){\n\t\tvar args = Array.from(arguments);\n\t\targs.shift();\n\t\t\n\t\tthis.externalEvents.dispatch(...arguments);\n\t}\n\n\t//////////////////// Alerts ///////////////////\n\n\talert(contents, type){\n\t\tthis.initGuard();\n\n\t\tthis.alertManager.alert(contents, type);\n\t}\n\n\tclearAlert(){\n\t\tthis.initGuard();\n\n\t\tthis.alertManager.clear();\n\t}\n\t\n\t////////////// Extension Management //////////////\n\tmodExists(plugin, required){\n\t\tif(this.modules[plugin]){\n\t\t\treturn true;\n\t\t}else{\n\t\t\tif(required){\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tmodule(key){\n\t\tvar mod = this.modules[key];\n\t\t\n\t\tif(!mod){\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\n\t\t}\n\t\t\n\t\treturn mod;\n\t}\n}\n\n//default setup options\nTabulator.defaultOptions = defaultOptions;\n\n//bind modules and static functionality\nnew ModuleBinder(Tabulator);\n\nexport default Tabulator;\n","export default {\n\n\tdebugEventsExternal:false, //flag to console log events\n\tdebugEventsInternal:false, //flag to console log events\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\n\tdebugInvalidComponentFuncs:true, //allow toggling of invalid component warnings\n\tdebugInitialization:true, //allow toggling of pre initialization function call warnings\n\tdebugDeprecation:true, //allow toggling of deprecation warnings\n\n\theight:false, //height of tabulator\n\tminHeight:false, //minimum height of tabulator\n\tmaxHeight:false, //maximum height of tabulator\n\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\n\n\tpopupContainer:false,\n\n\tcolumns:[],//store for colum header info\n\tcolumnDefaults:{}, //store column default props\n\n\tdata:false, //default starting data\n\n\tautoColumns:false, //build columns from data row structure\n\tautoColumnsDefinitions:false,\n\n\tnestedFieldSeparator:\".\", //separator for nested data\n\n\tfooterElement:false, //hold footer element\n\n\tindex:\"id\", //filed for row index\n\n\ttextDirection:\"auto\",\n\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\n\n\theaderVisible:true, //hide header\n\n\trenderVertical:\"virtual\",\n\trenderHorizontal:\"basic\",\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\n\n\tscrollToRowPosition:\"top\",\n\tscrollToRowIfVisible:true,\n\n\tscrollToColumnPosition:\"left\",\n\tscrollToColumnIfVisible:true,\n\n\trowFormatter:false,\n\trowFormatterPrint:null,\n\trowFormatterClipboard:null,\n\trowFormatterHtmlOutput:null,\n\n\trowHeight:null,\n\n\tplaceholder:false,\n\n\tdataLoader:true,\n\tdataLoaderLoading:false,\n\tdataLoaderError:false,\n\tdataLoaderErrorTimeout:3000,\n\n\tdataSendParams:{},\n\n\tdataReceiveParams:{},\n};\n","import Module from '../../core/Module.js';\nimport Helpers from '../../core/tools/Helpers.js';\n\nimport defaultAccessors from './defaults/accessors.js';\n\nclass Accessor extends Module{\n\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"]; //list of accessor types\n\n\t\tthis.registerColumnOption(\"accessor\");\n\t\tthis.registerColumnOption(\"accessorParams\");\n\t\tthis.registerColumnOption(\"accessorData\");\n\t\tthis.registerColumnOption(\"accessorDataParams\");\n\t\tthis.registerColumnOption(\"accessorDownload\");\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\n\t\tthis.registerColumnOption(\"accessorClipboard\");\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\n\t\tthis.registerColumnOption(\"accessorPrint\");\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\n\t}\n\n\tinitialize(){\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\n\t}\n\n\t//initialize column accessor\n\tinitializeColumn(column){\n\t\tvar match = false,\n\t\tconfig = {};\n\n\t\tthis.allowedTypes.forEach((type) => {\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\n\t\t\taccessor;\n\n\t\t\tif(column.definition[key]){\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\n\n\t\t\t\tif(accessor){\n\t\t\t\t\tmatch = true;\n\n\t\t\t\t\tconfig[key] = {\n\t\t\t\t\t\taccessor:accessor,\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif(match){\n\t\t\tcolumn.modules.accessor = config;\n\t\t}\n\t}\n\n\tlookupAccessor(value){\n\t\tvar accessor = false;\n\n\t\t//set column accessor\n\t\tswitch(typeof value){\n\t\t\tcase \"string\":\n\t\t\t\tif(Accessor.accessors[value]){\n\t\t\t\t\taccessor = Accessor.accessors[value];\n\t\t\t\t}else{\n\t\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"function\":\n\t\t\t\taccessor = value;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn accessor;\n\t}\n\n\t//apply accessor to row\n\ttransformRow(row, type){\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\n\t\trowComponent = row.getComponent();\n\n\t\t//clone data object with deep copy to isolate internal data from returned result\n\t\tvar data = Helpers.deepClone(row.data || {});\n\n\t\tthis.table.columnManager.traverse(function(column){\n\t\t\tvar value, accessor, params, colComponent;\n\n\t\t\tif(column.modules.accessor){\n\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\n\n\t\t\t\tif(accessor){\n\t\t\t\t\tvalue = column.getFieldValue(data);\n\n\t\t\t\t\tif(value != \"undefined\"){\n\t\t\t\t\t\tcolComponent = column.getComponent();\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colComponent, rowComponent) : accessor.params;\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colComponent, rowComponent));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn data;\n\t}\n}\n\n//load defaults\nAccessor.moduleName = \"accessor\";\nAccessor.accessors = defaultAccessors;\n\nexport default Accessor;","export default {};","function generateParamsList(data, prefix){\n\tvar output = [];\n\n\tprefix = prefix || \"\";\n\n\tif(Array.isArray(data)){\n\t\tdata.forEach((item, i) => {\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\n\t\t});\n\t}else if (typeof data === \"object\"){\n\t\tfor (var key in data){\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\n\t\t}\n\t}else{\n\t\toutput.push({key:prefix, value:data});\n\t}\n\n\treturn output;\n}\n\nfunction serializeParams(params){\n\tvar output = generateParamsList(params),\n\tencoded = [];\n\n\toutput.forEach(function(item){\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\n\t});\n\n\treturn encoded.join(\"&\");\n}\n\nexport default function(url, config, params){\n\tif(url){\n\t\tif(params && Object.keys(params).length){\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\n\t\t\t\tconfig.method = \"get\";\n\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn url;\n}","function generateParamsList(data, prefix){\n\tvar output = [];\n\n\tprefix = prefix || \"\";\n\n\tif(Array.isArray(data)){\n\t\tdata.forEach((item, i) => {\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\n\t\t});\n\t}else if (typeof data === \"object\"){\n\t\tfor (var key in data){\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\n\t\t}\n\t}else{\n\t\toutput.push({key:prefix, value:data});\n\t}\n\n\treturn output;\n}\n\nexport default {\n\t\"json\":{\n\t\theaders:{\n\t\t\t'Content-Type': 'application/json',\n\t\t},\n\t\tbody:function(url, config, params){\n\t\t\treturn JSON.stringify(params);\n\t\t},\n\t},\n\t\"form\":{\n\t\theaders:{\n\t\t},\n\t\tbody:function(url, config, params){\n\n\t\t\tvar output = generateParamsList(params),\n\t\t\tform = new FormData();\n\n\t\t\toutput.forEach(function(item){\n\t\t\t\tform.append(item.key, item.value);\n\t\t\t});\n\n\t\t\treturn form;\n\t\t},\n\t},\n};","import Module from '../../core/Module.js';\n\nimport defaultConfig from './defaults/config.js';\nimport defaultURLGenerator from './defaults/urlGenerator.js';\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\n\nclass Ajax extends Module{\n\t\n\tconstructor(table){\n\t\tsuper(table);\n\t\t\n\t\tthis.config = {}; //hold config object for ajax request\n\t\tthis.url = \"\"; //request URL\n\t\tthis.urlGenerator = false;\n\t\tthis.params = false; //request parameters\n\t\t\n\t\tthis.loaderPromise = false;\n\t\t\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\n\t\t\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\n\t\t\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\n\t}\n\t\n\t//initialize setup options\n\tinitialize(){\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\n\t\t\n\t\tif(this.table.options.ajaxURL){\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\n\t\t}\n\n\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\n\t\t\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\n\t\t\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\n\t}\n\t\n\trequestParams(data, config, silent, params){\n\t\tvar ajaxParams = this.table.options.ajaxParams;\n\t\t\n\t\tif(ajaxParams){\n\t\t\tif(typeof ajaxParams === \"function\"){\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\n\t\t\t}\n\t\t\t\n\t\t\tparams = Object.assign(params, ajaxParams);\n\t\t}\t\t\n\t\t\n\t\treturn params;\n\t}\n\t\n\trequestDataCheck(data, params, config, silent){\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\n\t}\n\t\n\trequestData(url, params, config, silent, previousData){\n\t\tvar ajaxConfig;\n\t\t\n\t\tif(!previousData && this.requestDataCheck(url)){\n\t\t\tif(url){\n\t\t\t\tthis.setUrl(url);\n\t\t\t}\n\t\t\t\n\t\t\tajaxConfig = this.generateConfig(config);\n\t\t\t\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\n\t\t}else{\n\t\t\treturn previousData;\n\t\t}\n\t}\n\t\n\tsetDefaultConfig(config = {}){\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\n\n\t\tif(typeof config == \"string\"){\n\t\t\tthis.config.method = config;\n\t\t}else{\n\t\t\tObject.assign(this.config, config);\n\t\t}\n\t}\n\t\n\t//load config object\n\tgenerateConfig(config = {}){\n\t\tvar ajaxConfig = Object.assign({}, this.config);\n\t\t\n\t\tif(typeof config == \"string\"){\n\t\t\tajaxConfig.method = config;\n\t\t}else{\n\t\t\tObject.assign(ajaxConfig, config);\n\t\t}\n\t\t\n\t\treturn ajaxConfig;\n\t}\n\t\n\t//set request url\n\tsetUrl(url){\n\t\tthis.url = url;\n\t}\n\t\n\t//get request url\n\tgetUrl(){\n\t\treturn this.url;\n\t}\n\t\n\t//send ajax request\n\tsendRequest(url, params, config){\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\n\t\t\treturn this.loaderPromise(url, config, params)\n\t\t\t\t.then((data)=>{\n\t\t\t\t\tif(this.table.options.ajaxResponse){\n\t\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\treturn data;\n\t\t\t\t});\n\t\t}else{\n\t\t\treturn Promise.reject();\n\t\t}\n\t}\n}\n\nAjax.moduleName = \"ajax\";\n\n//load defaults\nAjax.defaultConfig = defaultConfig;\nAjax.defaultURLGenerator = defaultURLGenerator;\nAjax.defaultLoaderPromise = defaultLoaderPromise;\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\n\nexport default Ajax;","export default {\n\tmethod: \"GET\",\n};","export default function(url, config, params){\n\tvar contentType;\n\n\treturn new Promise((resolve, reject) => {\n\t\t//set url\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\n\n\t\t//set body content if not GET request\n\t\tif(config.method.toUpperCase() != \"GET\"){\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\n\t\t\tif(contentType){\n\n\t\t\t\tfor(var key in contentType.headers){\n\t\t\t\t\tif(!config.headers){\n\t\t\t\t\t\tconfig.headers = {};\n\t\t\t\t\t}\n\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\n\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\n\t\t\t}\n\t\t}\n\n\t\tif(url){\n\t\t\t//configure headers\n\t\t\tif(typeof config.headers === \"undefined\"){\n\t\t\t\tconfig.headers = {};\n\t\t\t}\n\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\n\t\t\t\tconfig.headers.Accept = \"application/json\";\n\t\t\t}\n\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\n\t\t\t}\n\n\t\t\tif(typeof config.mode === \"undefined\"){\n\t\t\t\tconfig.mode = \"cors\";\n\t\t\t}\n\n\t\t\tif(config.mode == \"cors\"){\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\n\t\t\t\t}\n \n\t\t\t\tif(typeof config.credentials === \"undefined\"){\n\t\t\t\t\tconfig.credentials = 'same-origin';\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\n\t\t\t\t\tconfig.credentials = 'include';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//send request\n\t\t\tfetch(url, config)\n\t\t\t\t.then((response)=>{\n\t\t\t\t\tif(response.ok) {\n\t\t\t\t\t\tresponse.json()\n\t\t\t\t\t\t\t.then((data)=>{\n\t\t\t\t\t\t\t\tresolve(data);\n\t\t\t\t\t\t\t}).catch((error)=>{\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\n\t\t\t\t\t\treject(response);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch((error)=>{\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t}else{\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\n\t\t\tresolve([]);\n\t\t}\n\t});\n}","import Module from '../../core/Module.js';\n\nimport defaultPasteActions from './defaults/pasteActions.js';\nimport defaultPasteParsers from './defaults/pasteParsers.js';\n\nclass Clipboard extends Module{\n\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.mode = true;\n\t\tthis.pasteParser = function(){};\n\t\tthis.pasteAction = function(){};\n\t\tthis.customSelection = false;\n\t\tthis.rowRange = false;\n\t\tthis.blocked = true; //block copy actions not originating from this command\n\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRECATED - REMOVE in 5.0\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\n\n\t\tthis.registerColumnOption(\"clipboard\");\n\t\tthis.registerColumnOption(\"titleClipboard\");\n\t}\n\n\tinitialize(){\n\t\tthis.mode = this.table.options.clipboard;\n\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\n\n\t\tif(this.mode === true || this.mode === \"copy\"){\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\n\t\t\t\tvar plain, html, list;\n\n\t\t\t\tif(!this.blocked){\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\tif(this.customSelection){\n\t\t\t\t\t\tplain = this.customSelection;\n\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\tlist = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\n\n\t\t\t\t\t\thtml = this.table.modules.export.generateHTMLTable(list);\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\n\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\n\t\t\t\t\t\tif(html){\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\n\t\t\t\t\t\tif(html){\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\n\n\t\t\t\t\tthis.reset();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif(this.mode === true || this.mode === \"paste\"){\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\n\t\t\t\tthis.paste(e);\n\t\t\t});\n\t\t}\n\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\n\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\n\t}\n\n\treset(){\n\t\tthis.blocked = true;\n\t\tthis.customSelection = false;\n\t}\n\n\tgeneratePlainContent (list) {\n\t\tvar output = [];\n\n\t\tlist.forEach((row) => {\n\t\t\tvar rowData = [];\n\n\t\t\trow.columns.forEach((col) => {\n\t\t\t\tvar value = \"\";\n\n\t\t\t\tif(col){\n\n\t\t\t\t\tif(row.type === \"group\"){\n\t\t\t\t\t\tcol.value = col.component.getKey();\n\t\t\t\t\t}\n\n\t\t\t\t\tif(col.value === null){\n\t\t\t\t\t\tvalue = \"\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tswitch(typeof col.value){\n\t\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"undefined\":\n\t\t\t\t\t\t\t\tvalue = \"\";\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tvalue = col.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\trowData.push(value);\n\t\t\t});\n\n\t\t\toutput.push(rowData.join(\"\\t\"));\n\t\t});\n\n\t\treturn output.join(\"\\n\");\n\t}\n\n\tcopy (range, internal) {\n\t\tvar sel, textRange;\n\t\tthis.blocked = false;\n\t\tthis.customSelection = false;\n\n\t\tif (this.mode === true || this.mode === \"copy\") {\n\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\n\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\n\t\t\t\trange = document.createRange();\n\t\t\t\trange.selectNodeContents(this.table.element);\n\t\t\t\tsel = window.getSelection();\n\n\t\t\t\tif (sel.toString() && internal) {\n\t\t\t\t\tthis.customSelection = sel.toString();\n\t\t\t\t}\n\n\t\t\t\tsel.removeAllRanges();\n\t\t\t\tsel.addRange(range);\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\n\t\t\t\ttextRange = document.body.createTextRange();\n\t\t\t\ttextRange.moveToElementText(this.table.element);\n\t\t\t\ttextRange.select();\n\t\t\t}\n\n\t\t\tdocument.execCommand('copy');\n\n\t\t\tif (sel) {\n\t\t\t\tsel.removeAllRanges();\n\t\t\t}\n\t\t}\n\t}\n\n\t//PASTE EVENT HANDLING\n\tsetPasteAction(action){\n\n\t\tswitch(typeof action){\n\t\t\tcase \"string\":\n\t\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\n\n\t\t\t\tif(!this.pasteAction){\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"function\":\n\t\t\t\tthis.pasteAction = action;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetPasteParser(parser){\n\t\tswitch(typeof parser){\n\t\t\tcase \"string\":\n\t\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\n\n\t\t\t\tif(!this.pasteParser){\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"function\":\n\t\t\t\tthis.pasteParser = parser;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tpaste(e){\n\t\tvar data, rowData, rows;\n\n\t\tif(this.checkPaseOrigin(e)){\n\n\t\t\tdata = this.getPasteData(e);\n\n\t\t\trowData = this.pasteParser.call(this, data);\n\n\t\t\tif(rowData){\n\t\t\t\te.preventDefault();\n\n\t\t\t\tif(this.table.modExists(\"mutator\")){\n\t\t\t\t\trowData = this.mutateData(rowData);\n\t\t\t\t}\n\n\t\t\t\trows = this.pasteAction.call(this, rowData);\n\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\n\t\t\t}else{\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\n\t\t\t}\n\t\t}\n\t}\n\n\tmutateData(data){\n\t\tvar output = [];\n\n\t\tif(Array.isArray(data)){\n\t\t\tdata.forEach((row) => {\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\n\t\t\t});\n\t\t}else{\n\t\t\toutput = data;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\n\tcheckPaseOrigin(e){\n\t\tvar valid = true;\n\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\n\t\t\tvalid = false;\n\t\t}\n\n\t\treturn valid;\n\t}\n\n\tgetPasteData(e){\n\t\tvar data;\n\n\t\tif (window.clipboardData && window.clipboardData.getData) {\n\t\t\tdata = window.clipboardData.getData('Text');\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\n\t\t\tdata = e.clipboardData.getData('text/plain');\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\n\t\t}\n\n\t\treturn data;\n\t}\n}\n\nClipboard.moduleName = \"clipboard\";\n\n//load defaults\nClipboard.pasteActions = defaultPasteActions;\nClipboard.pasteParsers = defaultPasteParsers;\n\nexport default Clipboard;","export default {\n\treplace:function(rows){\n\t\treturn this.table.setData(rows);\n\t},\n\tupdate:function(rows){\n\t\treturn this.table.updateOrAddData(rows);\n\t},\n\tinsert:function(rows){\n\t\treturn this.table.addData(rows);\n\t},\n};","export default {\n\ttable:function(clipboard){\n\t\tvar data = [],\n\t\theaderFindSuccess = true,\n\t\tcolumns = this.table.columnManager.columns,\n\t\tcolumnMap = [],\n\t\trows = [];\n\n\t\t//get data from clipboard into array of columns and rows.\n\t\tclipboard = clipboard.split(\"\\n\");\n\n\t\tclipboard.forEach(function(row){\n\t\t\tdata.push(row.split(\"\\t\"));\n\t\t});\n\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\n\n\t\t\t//check if headers are present by title\n\t\t\tdata[0].forEach(function(value){\n\t\t\t\tvar column = columns.find(function(column){\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\n\t\t\t\t});\n\n\t\t\t\tif(column){\n\t\t\t\t\tcolumnMap.push(column);\n\t\t\t\t}else{\n\t\t\t\t\theaderFindSuccess = false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//check if column headers are present by field\n\t\t\tif(!headerFindSuccess){\n\t\t\t\theaderFindSuccess = true;\n\t\t\t\tcolumnMap = [];\n\n\t\t\t\tdata[0].forEach(function(value){\n\t\t\t\t\tvar column = columns.find(function(column){\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\n\t\t\t\t\t});\n\n\t\t\t\t\tif(column){\n\t\t\t\t\t\tcolumnMap.push(column);\n\t\t\t\t\t}else{\n\t\t\t\t\t\theaderFindSuccess = false;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif(!headerFindSuccess){\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//remove header row if found\n\t\t\tif(headerFindSuccess){\n\t\t\t\tdata.shift();\n\t\t\t}\n\n\t\t\tdata.forEach(function(item){\n\t\t\t\tvar row = {};\n\n\t\t\t\titem.forEach(function(value, i){\n\t\t\t\t\tif(columnMap[i]){\n\t\t\t\t\t\trow[columnMap[i].field] = value;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\trows.push(row);\n\t\t\t});\n\n\t\t\treturn rows;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}\n};","class CalcComponent{\n\tconstructor (row){\n\t\tthis._row = row;\n\n\t\treturn new Proxy(this, {\n\t\t\tget: function(target, name, receiver) {\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\n\t\t\t\t\treturn target[name];\n\t\t\t\t}else{\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tgetData(transform){\n\t\treturn this._row.getData(transform);\n\t}\n\n\tgetElement(){\n\t\treturn this._row.getElement();\n\t}\n\n\tgetTable(){\n\t\treturn this._row.table;\n\t}\n\n\tgetCells(){\n\t\tvar cells = [];\n\n\t\tthis._row.getCells().forEach(function(cell){\n\t\t\tcells.push(cell.getComponent());\n\t\t});\n\n\t\treturn cells;\n\t}\n\n\tgetCell(column){\n\t\tvar cell = this._row.getCell(column);\n\t\treturn cell ? cell.getComponent() : false;\n\t}\n\n\t_getSelf(){\n\t\treturn this._row;\n\t}\n}\n\nexport default CalcComponent;","export default {\n\t\"avg\":function(values, data, calcParams){\n\t\tvar output = 0,\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2;\n\n\t\tif(values.length){\n\t\t\toutput = values.reduce(function(sum, value){\n\t\t\t\treturn Number(sum) + Number(value);\n\t\t\t});\n\n\t\t\toutput = output / values.length;\n\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\n\t\t}\n\n\t\treturn parseFloat(output).toString();\n\t},\n\t\"max\":function(values, data, calcParams){\n\t\tvar output = null,\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\n\n\t\tvalues.forEach(function(value){\n\n\t\t\tvalue = Number(value);\n\n\t\t\tif(value > output || output === null){\n\t\t\t\toutput = value;\n\t\t\t}\n\t\t});\n\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\n\t},\n\t\"min\":function(values, data, calcParams){\n\t\tvar output = null,\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\n\n\t\tvalues.forEach(function(value){\n\n\t\t\tvalue = Number(value);\n\n\t\t\tif(value < output || output === null){\n\t\t\t\toutput = value;\n\t\t\t}\n\t\t});\n\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\n\t},\n\t\"sum\":function(values, data, calcParams){\n\t\tvar output = 0,\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\n\n\t\tif(values.length){\n\t\t\tvalues.forEach(function(value){\n\t\t\t\tvalue = Number(value);\n\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\n\t\t\t});\n\t\t}\n\n\t\treturn precision !== false ? output.toFixed(precision) : output;\n\t},\n\t\"concat\":function(values, data, calcParams){\n\t\tvar output = 0;\n\n\t\tif(values.length){\n\t\t\toutput = values.reduce(function(sum, value){\n\t\t\t\treturn String(sum) + String(value);\n\t\t\t});\n\t\t}\n\n\t\treturn output;\n\t},\n\t\"count\":function(values, data, calcParams){\n\t\tvar output = 0;\n\n\t\tif(values.length){\n\t\t\tvalues.forEach(function(value){\n\t\t\t\tif(value){\n\t\t\t\t\toutput ++;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn output;\n\t},\n};","import Module from '../../core/Module.js';\n\nimport CalcComponent from './CalcComponent.js';\n\nimport Cell from '../../core/cell/Cell.js';\nimport Column from '../../core/column/Column.js';\nimport Row from '../../core/row/Row.js';\n\nimport defaultCalculations from './defaults/calculations.js';\n\nclass ColumnCalcs extends Module{\n\t\n\tconstructor(table){\n\t\tsuper(table);\n\t\t\n\t\tthis.topCalcs = [];\n\t\tthis.botCalcs = [];\n\t\tthis.genColumn = false;\n\t\tthis.topElement = this.createElement();\n\t\tthis.botElement = this.createElement();\n\t\tthis.topRow = false;\n\t\tthis.botRow = false;\n\t\tthis.topInitialized = false;\n\t\tthis.botInitialized = false;\n\t\t\n\t\tthis.blocked = false;\n\t\tthis.recalcAfterBlock = false;\n\t\t\n\t\tthis.registerTableOption(\"columnCalcs\", true);\n\t\t\n\t\tthis.registerColumnOption(\"topCalc\");\n\t\tthis.registerColumnOption(\"topCalcParams\");\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\n\t\tthis.registerColumnOption(\"bottomCalc\");\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\n\t}\n\t\n\tcreateElement (){\n\t\tvar el = document.createElement(\"div\");\n\t\tel.classList.add(\"tabulator-calcs-holder\");\n\t\treturn el;\n\t}\n\t\n\tinitialize(){\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\n\t\t\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\n\t\tthis.subscribe(\"scrollbar-vertical\", this.adjustForScrollbar.bind(this));\n\t\t\n\t\tthis.subscribe(\"redraw-blocked\", this.blockRedraw.bind(this));\n\t\tthis.subscribe(\"redraw-restored\", this.restoreRedraw.bind(this));\n\n\t\tthis.subscribe(\"table-redrawing\", this.resizeHolderWidth.bind(this));\n\t\tthis.subscribe(\"column-resized\", this.resizeHolderWidth.bind(this));\n\t\tthis.subscribe(\"column-show\", this.resizeHolderWidth.bind(this));\n\t\tthis.subscribe(\"column-hide\", this.resizeHolderWidth.bind(this));\n\t\t\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\n\n\n\t\tthis.resizeHolderWidth();\n\t}\n\n\tresizeHolderWidth(){\n\t\tthis.topElement.style.minWidth = this.table.columnManager.headersElement.offsetWidth + \"px\";\n\t}\n\n\t\n\ttableRedraw(force){\n\t\tthis.recalc(this.table.rowManager.activeRows);\n\t\t\n\t\tif(force){\n\t\t\tthis.redraw();\n\t\t}\n\t}\n\t\n\tblockRedraw(){\n\t\tthis.blocked = true;\n\t\tthis.recalcAfterBlock = false;\n\t}\n\t\n\t\n\trestoreRedraw(){\n\t\tthis.blocked = false;\n\t\t\n\t\tif(this.recalcAfterBlock){\n\t\t\tthis.recalcAfterBlock = false;\n\t\t\tthis.recalcActiveRowsRefresh();\n\t\t}\n\t}\n\t\n\t///////////////////////////////////\n\t///////// Table Functions /////////\n\t///////////////////////////////////\n\tuserRecalc(){\n\t\tthis.recalc(this.table.rowManager.activeRows);\n\t}\n\t\n\t///////////////////////////////////\n\t///////// Internal Logic //////////\n\t///////////////////////////////////\n\t\n\tblockCheck(){\n\t\tif(this.blocked){\n\t\t\tthis.recalcAfterBlock = true;\n\t\t}\n\t\t\n\t\treturn this.blocked;\n\t}\n\t\n\tvisibleRows(viewable, rows){\n\t\tif(this.topRow){\n\t\t\trows.unshift(this.topRow);\n\t\t}\n\t\t\n\t\tif(this.botRow){\n\t\t\trows.push(this.botRow);\n\t\t}\n\t\t\n\t\treturn rows;\n\t}\n\t\n\trowsUpdated(row){\n\t\tif(this.table.options.groupBy){\n\t\t\tthis.recalcRowGroup(row);\n\t\t}else{\n\t\t\tthis.recalcActiveRows();\n\t\t}\n\t}\n\t\n\trecalcActiveRowsRefresh(){\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\n\t\t\tthis.recalcAll();\n\t\t}else{\n\t\t\tthis.recalcActiveRows();\n\t\t}\n\t}\n\t\n\trecalcActiveRows(){\n\t\tthis.recalc(this.table.rowManager.activeRows);\n\t}\n\t\n\tcellValueChanged(cell){\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\n\t\t\tif(this.table.options.groupBy){\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\n\t\t\t\t\tthis.recalcActiveRows();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthis.recalcActiveRows();\n\t\t\t}\n\t\t}\n\t}\n\t\n\tinitializeColumnCheck(column){\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\n\t\t\tthis.initializeColumn(column);\n\t\t}\n\t}\n\t\n\t//initialize column calcs\n\tinitializeColumn(column){\n\t\tvar def = column.definition;\n\t\t\n\t\tvar config = {\n\t\t\ttopCalcParams:def.topCalcParams || {},\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\n\t\t};\n\t\t\n\t\tif(def.topCalc){\n\t\t\t\n\t\t\tswitch(typeof def.topCalc){\n\t\t\t\tcase \"string\":\n\t\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\n\t\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"function\":\n\t\t\t\t\tconfig.topCalc = def.topCalc;\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(config.topCalc){\n\t\t\t\tcolumn.modules.columnCalcs = config;\n\t\t\t\tthis.topCalcs.push(column);\n\t\t\t\t\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\n\t\t\t\t\tthis.initializeTopRow();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif(def.bottomCalc){\n\t\t\tswitch(typeof def.bottomCalc){\n\t\t\t\tcase \"string\":\n\t\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\n\t\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc];\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"function\":\n\t\t\t\t\tconfig.botCalc = def.bottomCalc;\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(config.botCalc){\n\t\t\t\tcolumn.modules.columnCalcs = config;\n\t\t\t\tthis.botCalcs.push(column);\n\t\t\t\t\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\n\t\t\t\t\tthis.initializeBottomRow();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\t//dummy functions to handle being mock column manager\n\tregisterColumnField(){}\n\t\n\tremoveCalcs(){\n\t\tvar changed = false;\n\t\t\n\t\tif(this.topInitialized){\n\t\t\tthis.topInitialized = false;\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\n\t\t\tchanged = true;\n\t\t}\n\t\t\n\t\tif(this.botInitialized){\n\t\t\tthis.botInitialized = false;\n\t\t\tthis.footerRemove(this.botElement);\n\t\t\tchanged = true;\n\t\t}\n\t\t\n\t\tif(changed){\n\t\t\tthis.table.rowManager.adjustTableSize();\n\t\t}\n\t}\n\t\n\treinitializeCalcs(){\n\t\tif(this.topCalcs.length){\n\t\t\tthis.initializeTopRow();\n\t\t}\n\n\t\tif(this.botCalcs.length){\n\t\t\tthis.initializeBottomRow();\n\t\t}\n\t}\n\t\n\tinitializeTopRow(){\n\t\tif(!this.topInitialized){\n\t\t\tthis.table.columnManager.getContentsElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\n\t\t\tthis.topInitialized = true;\n\t\t}\n\t}\n\t\n\tinitializeBottomRow(){\n\t\tif(!this.botInitialized){\n\t\t\tthis.footerPrepend(this.botElement);\n\t\t\tthis.botInitialized = true;\n\t\t}\n\t}\n\t\n\tscrollHorizontal(left){\n\t\tif(this.botInitialized && this.botRow){\n\t\t\tthis.botElement.scrollLeft = left;\n\t\t}\n\t}\n\t\n\trecalc(rows){\n\t\tvar data, row;\n\t\t\n\t\tif(!this.blockCheck()){\n\t\t\tif(this.topInitialized || this.botInitialized){\n\t\t\t\tdata = this.rowsToData(rows);\n\t\t\t\t\n\t\t\t\tif(this.topInitialized){\n\t\t\t\t\tif(this.topRow){\n\t\t\t\t\t\tthis.topRow.deleteCells();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\trow = this.generateRow(\"top\", data);\n\t\t\t\t\tthis.topRow = row;\n\t\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\n\t\t\t\t\tthis.topElement.appendChild(row.getElement());\n\t\t\t\t\trow.initialize(true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(this.botInitialized){\n\t\t\t\t\tif(this.botRow){\n\t\t\t\t\t\tthis.botRow.deleteCells();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\trow = this.generateRow(\"bottom\", data);\n\t\t\t\t\tthis.botRow = row;\n\t\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\n\t\t\t\t\tthis.botElement.appendChild(row.getElement());\n\t\t\t\t\trow.initialize(true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.table.rowManager.adjustTableSize();\n\t\t\t\t\n\t\t\t\t//set resizable handles\n\t\t\t\tif(this.table.modExists(\"frozenColumns\")){\n\t\t\t\t\tthis.table.modules.frozenColumns.layout();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\trecalcRowGroup(row){\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\n\t}\n\t\n\trecalcAll(){\n\t\tif(this.topCalcs.length || this.botCalcs.length){\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\n\t\t\t\tthis.recalcActiveRows();\n\t\t\t}\n\t\t\t\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\n\t\t\t\t\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\n\t\t\t\t\n\t\t\t\tgroups.forEach((group) => {\n\t\t\t\t\tthis.recalcGroup(group);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\t\n\trecalcGroup(group){\n\t\tvar data, rowData;\n\t\t\n\t\tif(!this.blockCheck()){\n\t\t\tif(group){\n\t\t\t\tif(group.calcs){\n\t\t\t\t\tif(group.calcs.bottom){\n\t\t\t\t\t\tdata = this.rowsToData(group.rows);\n\t\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\n\t\t\t\t\t\t\n\t\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\n\t\t\t\t\t\tgroup.calcs.bottom.reinitialize();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(group.calcs.top){\n\t\t\t\t\t\tdata = this.rowsToData(group.rows);\n\t\t\t\t\t\trowData = this.generateRowData(\"top\", data);\n\t\t\t\t\t\t\n\t\t\t\t\t\tgroup.calcs.top.updateData(rowData);\n\t\t\t\t\t\tgroup.calcs.top.reinitialize();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//generate top stats row\n\tgenerateTopRow(rows){\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\n\t}\n\t//generate bottom stats row\n\tgenerateBottomRow(rows){\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\n\t}\n\t\n\trowsToData(rows){\n\t\tvar data = [];\n\t\t\n\t\trows.forEach((row) => {\n\t\t\tdata.push(row.getData());\n\t\t\t\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\n\t\t\t\t\tdata = data.concat(children);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn data;\n\t}\n\t\n\t//generate stats row\n\tgenerateRow(pos, data){\n\t\tvar rowData = this.generateRowData(pos, data),\n\t\trow;\n\t\t\n\t\tif(this.table.modExists(\"mutator\")){\n\t\t\tthis.table.modules.mutator.disable();\n\t\t}\n\t\t\n\t\trow = new Row(rowData, this, \"calc\");\n\t\t\n\t\tif(this.table.modExists(\"mutator\")){\n\t\t\tthis.table.modules.mutator.enable();\n\t\t}\n\t\t\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\n\t\t\n\t\trow.component = false;\n\t\t\n\t\trow.getComponent = () => {\n\t\t\tif(!row.component){\n\t\t\t\trow.component = new CalcComponent(row);\n\t\t\t}\n\t\t\t\n\t\t\treturn row.component;\n\t\t};\n\t\t\n\t\trow.generateCells = () => {\n\t\t\t\n\t\t\tvar cells = [];\n\t\t\t\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\n\t\t\t\t\n\t\t\t\t//set field name of mock column\n\t\t\t\tthis.genColumn.setField(column.getField());\n\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\n\t\t\t\t\n\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\n\t\t\t\t\tthis.genColumn.modules.format = {\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\n\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\n\t\t\t\t\t};\n\t\t\t\t}else{\n\t\t\t\t\tthis.genColumn.modules.format = {\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\n\t\t\t\t\t\tparams:{}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//ensure css class definition is replicated to calculation cell\n\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\n\t\t\t\t\n\t\t\t\t//generate cell and assign to correct column\n\t\t\t\tvar cell = new Cell(this.genColumn, row);\n\t\t\t\tcell.getElement();\n\t\t\t\tcell.column = column;\n\t\t\t\tcell.setWidth();\n\t\t\t\t\n\t\t\t\tcolumn.cells.push(cell);\n\t\t\t\tcells.push(cell);\n\t\t\t\t\n\t\t\t\tif(!column.visible){\n\t\t\t\t\tcell.hide();\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\trow.cells = cells;\n\t\t};\n\t\t\n\t\treturn row;\n\t}\n\t\n\t//generate stats row\n\tgenerateRowData(pos, data){\n\t\tvar rowData = {},\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\n\t\tparams, paramKey;\n\t\t\n\t\tcalcs.forEach(function(column){\n\t\t\tvar values = [];\n\t\t\t\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\n\t\t\t\tdata.forEach(function(item){\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tparamKey = type + \"Params\";\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\n\t\t\t\t\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn rowData;\n\t}\n\t\n\thasTopCalcs(){\n\t\treturn\t!!(this.topCalcs.length);\n\t}\n\t\n\thasBottomCalcs(){\n\t\treturn\t!!(this.botCalcs.length);\n\t}\n\t\n\t//handle table redraw\n\tredraw(){\n\t\tif(this.topRow){\n\t\t\tthis.topRow.normalizeHeight(true);\n\t\t}\n\t\tif(this.botRow){\n\t\t\tthis.botRow.normalizeHeight(true);\n\t\t}\n\t}\n\t\n\t//return the calculated\n\tgetResults(){\n\t\tvar results = {},\n\t\tgroups;\n\t\t\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\n\t\t\t\n\t\t\tgroups.forEach((group) => {\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\n\t\t\t});\n\t\t}else{\n\t\t\tresults = {\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\n\t\t\t};\n\t\t}\n\t\t\n\t\treturn results;\n\t}\n\t\n\t//get results from a group\n\tgetGroupResults(group){\n\t\tvar groupObj = group._getSelf(),\n\t\tsubGroups = group.getSubGroups(),\n\t\tsubGroupResults = {},\n\t\tresults = {};\n\t\t\n\t\tsubGroups.forEach((subgroup) => {\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\n\t\t});\n\t\t\n\t\tresults = {\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\n\t\t\tgroups: subGroupResults,\n\t\t};\n\t\t\n\t\treturn results;\n\t}\n\t\n\tadjustForScrollbar(width){\n\t\tif(this.botRow){\n\t\t\tif(this.table.rtl){\n\t\t\t\tthis.botElement.style.paddingLeft = width + \"px\";\n\t\t\t}else{\n\t\t\t\tthis.botElement.style.paddingRight = width + \"px\";\n\t\t\t}\n\t\t}\n\t}\n}\n\nColumnCalcs.moduleName = \"columnCalcs\";\n\n//load defaults\nColumnCalcs.calculations = defaultCalculations;\n\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\n\nimport Row from '../../core/row/Row.js';\n\nimport RowComponent from '../../core/row/RowComponent.js';\n\nclass DataTree extends Module{\n\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.indent = 10;\n\t\tthis.field = \"\";\n\t\tthis.collapseEl = null;\n\t\tthis.expandEl = null;\n\t\tthis.branchEl = null;\n\t\tthis.elementField = false;\n\n\t\tthis.startOpen = function(){};\n\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//selecting a parent row selects its children\n\n\t\t//register component functions\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\n\t}\n\n\tinitialize(){\n\t\tif(this.table.options.dataTree){\n\t\t\tvar dummyEl = null,\n\t\t\toptions = this.table.options;\n\n\t\t\tthis.field = options.dataTreeChildField;\n\t\t\tthis.indent = options.dataTreeChildIndent;\n\n\t\t\tif(this.options(\"movableRows\")){\n\t\t\t\tconsole.warn(\"The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior\");\n\t\t\t}\n\n\t\t\tif(options.dataTreeBranchElement){\n\n\t\t\t\tif(options.dataTreeBranchElement === true){\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\n\t\t\t\t}else{\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(options.dataTreeCollapseElement){\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\n\t\t\t\t}else{\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\n\t\t\t\tthis.collapseEl.tabIndex = 0;\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\n\t\t\t}\n\n\t\t\tif(options.dataTreeExpandElement){\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\n\t\t\t\t}else{\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\n\t\t\t\tthis.expandEl.tabIndex = 0;\n\t\t\t\tthis.expandEl.innerHTML = \"\";\n\t\t\t}\n\n\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\n\t\t\t\tcase \"boolean\":\n\t\t\t\t\tthis.startOpen = function(row, index){\n\t\t\t\t\t\treturn options.dataTreeStartExpanded;\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"function\":\n\t\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.startOpen = function(row, index){\n\t\t\t\t\t\treturn options.dataTreeStartExpanded[index];\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\n\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\n\t\t}\n\t}\n\n\ttableRedrawing(force){\n\t\tvar rows;\n\n\t\tif(force){\n\t\t\trows = this.table.rowManager.getRows();\n\t\t\t\n\t\t\trows.forEach((row) => {\n\t\t\t\tthis.reinitializeRowChildren(row);\n\t\t\t});\n\t\t}\n\t}\n\n\tinitializeElementField(){\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\n\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\n\t}\n\t\n\tgetRowChildren(row){\n\t\treturn this.getTreeChildren(row, true);\n\t}\n\n\tcolumnMoving(){\n\t\tvar rows = [];\n\n\t\tthis.table.rowManager.rows.forEach((row) => {\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\n\t\t});\n\n\t\treturn rows;\n\t}\n\n\trowDataChanged(row, visible, updatedData){\n\t\tif(this.redrawNeeded(updatedData)){\n\t\t\tthis.initializeRow(row);\n\n\t\t\tif(visible){\n\t\t\t\tthis.layoutRow(row);\n\t\t\t\tthis.refreshData(true);\n\t\t\t}\n\t\t}\n\t}\n\n\tcellValueChanged(cell){\n\t\tvar field = cell.column.getField();\n\n\t\tif(field === this.elementField){\n\t\t\tthis.layoutRow(cell.row);\n\t\t}\n\t}\n\n\tinitializeRow(row){\n\t\tvar childArray = row.getData()[this.field];\n\t\tvar isArray = Array.isArray(childArray);\n\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\n\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\n\t\t}\n\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\n\t\t}\n\n\t\trow.modules.dataTree = {\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\n\t\t\tchildren:children,\n\t\t};\n\t}\n\n\treinitializeRowChildren(row){\n\t\tvar children = this.getTreeChildren(row, false, true);\n\n\t\tchildren.forEach(function(child){\n\t\t\tchild.reinitialize(true);\n\t\t});\n\t}\n\n\tlayoutRow(row){\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\n\t\tel = cell.getElement(),\n\t\tconfig = row.modules.dataTree;\n\n\t\tif(config.branchEl){\n\t\t\tif(config.branchEl.parentNode){\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\n\t\t\t}\n\t\t\tconfig.branchEl = false;\n\t\t}\n\n\t\tif(config.controlEl){\n\t\t\tif(config.controlEl.parentNode){\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\n\t\t\t}\n\t\t\tconfig.controlEl = false;\n\t\t}\n\n\t\tthis.generateControlElement(row, el);\n\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\n\n\t\tif(config.index){\n\t\t\tif(this.branchEl){\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\n\n\t\t\t\tif(this.table.rtl){\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\n\t\t\t\t}else{\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\n\t\t\t\t}\n\t\t\t}else{\n\n\t\t\t\tif(this.table.rtl){\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\n\t\t\t\t}else{\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tgenerateControlElement(row, el){\n\t\tvar config = row.modules.dataTree,\n\t\toldControl = config.controlEl;\n\n\t\tel = el || row.getCells()[0].getElement();\n\n\t\tif(config.children !== false){\n\n\t\t\tif(config.open){\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\tthis.collapseRow(row);\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\tthis.expandRow(row);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\n\t\t\t\te.stopPropagation();\n\t\t\t});\n\n\t\t\tif(oldControl && oldControl.parentNode === el){\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\n\t\t\t}else{\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetRows(rows){\n\t\tvar output = [];\n\n\t\trows.forEach((row, i) => {\n\t\t\tvar config, children;\n\n\t\t\toutput.push(row);\n\n\t\t\tif(row instanceof Row){\n\n\t\t\t\trow.create();\n\n\t\t\t\tconfig = row.modules.dataTree.children;\n\n\t\t\t\tif(!config.index && config.children !== false){\n\t\t\t\t\tchildren = this.getChildren(row);\n\n\t\t\t\t\tchildren.forEach((child) => {\n\t\t\t\t\t\tchild.create();\n\t\t\t\t\t\toutput.push(child);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn output;\n\t}\n\n\tgetChildren(row, allChildren){\n\t\tvar config = row.modules.dataTree,\n\t\tchildren = [],\n\t\toutput = [];\n\n\t\tif(config.children !== false && (config.open || allChildren)){\n\t\t\tif(!Array.isArray(config.children)){\n\t\t\t\tconfig.children = this.generateChildren(row);\n\t\t\t}\n\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\n\t\t\t}else{\n\t\t\t\tchildren = config.children;\n\t\t\t}\n\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\n\t\t\t\tthis.table.modules.sort.sort(children);\n\t\t\t}\n\n\t\t\tchildren.forEach((child) => {\n\t\t\t\toutput.push(child);\n\n\t\t\t\tvar subChildren = this.getChildren(child);\n\n\t\t\t\tsubChildren.forEach((sub) => {\n\t\t\t\t\toutput.push(sub);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treturn output;\n\t}\n\n\tgenerateChildren(row){\n\t\tvar children = [];\n\n\t\tvar childArray = row.getData()[this.field];\n\n\t\tif(!Array.isArray(childArray)){\n\t\t\tchildArray = [childArray];\n\t\t}\n\n\t\tchildArray.forEach((childData) => {\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\n\n\t\t\tchildRow.create();\n\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\n\t\t\tchildRow.modules.dataTree.parent = row;\n\n\t\t\tif(childRow.modules.dataTree.children){\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\n\t\t\t}\n\t\t\tchildren.push(childRow);\n\t\t});\n\n\t\treturn children;\n\t}\n\n\texpandRow(row, silent){\n\t\tvar config = row.modules.dataTree;\n\n\t\tif(config.children !== false){\n\t\t\tconfig.open = true;\n\n\t\t\trow.reinitialize();\n\n\t\t\tthis.refreshData(true);\n\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\n\t\t}\n\t}\n\n\tcollapseRow(row){\n\t\tvar config = row.modules.dataTree;\n\n\t\tif(config.children !== false){\n\t\t\tconfig.open = false;\n\n\t\t\trow.reinitialize();\n\n\t\t\tthis.refreshData(true);\n\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\n\t\t}\n\t}\n\n\ttoggleRow(row){\n\t\tvar config = row.modules.dataTree;\n\n\t\tif(config.children !== false){\n\t\t\tif(config.open){\n\t\t\t\tthis.collapseRow(row);\n\t\t\t}else{\n\t\t\t\tthis.expandRow(row);\n\t\t\t}\n\t\t}\n\t}\n\n\tisRowExpanded(row){\n\t\treturn row.modules.dataTree.open;\n\t}\n\n\tgetTreeParent(row){\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\n\t}\n\n\tgetTreeParentRoot(row){\n\t\treturn row.modules.dataTree && row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\n\t}\n\n\tgetFilteredTreeChildren(row){\n\t\tvar config = row.modules.dataTree,\n\t\toutput = [], children;\n\n\t\tif(config.children){\n\n\t\t\tif(!Array.isArray(config.children)){\n\t\t\t\tconfig.children = this.generateChildren(row);\n\t\t\t}\n\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\n\t\t\t}else{\n\t\t\t\tchildren = config.children;\n\t\t\t}\n\n\t\t\tchildren.forEach((childRow) => {\n\t\t\t\tif(childRow instanceof Row){\n\t\t\t\t\toutput.push(childRow);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn output;\n\t}\n\n\trowDelete(row){\n\t\tvar parent = row.modules.dataTree.parent,\n\t\tchildIndex;\n\n\t\tif(parent){\n\t\t\tchildIndex = this.findChildIndex(row, parent);\n\n\t\t\tif(childIndex !== false){\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\n\t\t\t}\n\n\t\t\tif(!parent.data[this.field].length){\n\t\t\t\tdelete parent.data[this.field];\n\t\t\t}\n\n\t\t\tthis.initializeRow(parent);\n\t\t\tthis.layoutRow(parent);\n\t\t}\n\n\t\tthis.refreshData(true);\n\t}\n\n\taddTreeChildRow(row, data, top, index){\n\t\tvar childIndex = false;\n\n\t\tif(typeof data === \"string\"){\n\t\t\tdata = JSON.parse(data);\n\t\t}\n\n\t\tif(!Array.isArray(row.data[this.field])){\n\t\t\trow.data[this.field] = [];\n\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\n\t\t}\n\n\t\tif(typeof index !== \"undefined\"){\n\t\t\tchildIndex = this.findChildIndex(index, row);\n\n\t\t\tif(childIndex !== false){\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\n\t\t\t}\n\t\t}\n\n\t\tif(childIndex === false){\n\t\t\tif(top){\n\t\t\t\trow.data[this.field].unshift(data);\n\t\t\t}else{\n\t\t\t\trow.data[this.field].push(data);\n\t\t\t}\n\t\t}\n\n\t\tthis.initializeRow(row);\n\t\tthis.layoutRow(row);\n\n\t\tthis.refreshData(true);\n\t}\n\n\tfindChildIndex(subject, parent){\n\t\tvar match = false;\n\n\t\tif(typeof subject == \"object\"){\n\n\t\t\tif(subject instanceof Row){\n\t\t\t\t//subject is row element\n\t\t\t\tmatch = subject.data;\n\t\t\t}else if(subject instanceof RowComponent){\n\t\t\t\t//subject is public row component\n\t\t\t\tmatch = subject._getSelf().data;\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\n\t\t\t\tif(parent.modules.dataTree){\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\n\t\t\t\t\t});\n\n\t\t\t\t\tif(match){\n\t\t\t\t\t\tmatch = match.data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(subject === null){\n\t\t\t\tmatch = false;\n\t\t\t}\n\n\t\t}else if(typeof subject == \"undefined\"){\n\t\t\tmatch = false;\n\t\t}else{\n\t\t\t//subject should be treated as the index of the row\n\t\t\tmatch = parent.data[this.field].find((row) => {\n\t\t\t\treturn row.data[this.table.options.index] == subject;\n\t\t\t});\n\t\t}\n\n\t\tif(match){\n\n\t\t\tif(Array.isArray(parent.data[this.field])){\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\n\t\t\t}\n\n\t\t\tif(match == -1){\n\t\t\t\tmatch = false;\n\t\t\t}\n\t\t}\n\n\t\t//catch all for any other type of input\n\n\t\treturn match;\n\t}\n\n\tgetTreeChildren(row, component, recurse){\n\t\tvar config = row.modules.dataTree,\n\t\toutput = [];\n\n\t\tif(config.children){\n\n\t\t\tif(!Array.isArray(config.children)){\n\t\t\t\tconfig.children = this.generateChildren(row);\n\t\t\t}\n\n\t\t\tconfig.children.forEach((childRow) => {\n\t\t\t\tif(childRow instanceof Row){\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\n\n\t\t\t\t\tif(recurse){\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn output;\n\t}\n\n\tgetChildField(){\n\t\treturn this.field;\n\t}\n\n\tredrawNeeded(data){\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\n\t}\n}\n\nDataTree.moduleName = \"dataTree\";\n\nexport default DataTree;","import csv from './downloaders/csv.js';\nimport json from './downloaders/json.js';\nimport pdf from './downloaders/pdf.js';\nimport xlsx from './downloaders/xlsx.js';\nimport html from './downloaders/html.js';\nimport jsonLines from './downloaders/jsonLines.js';\n\nexport default {\n\tcsv:csv,\n\tjson:json,\n\tjsonLines:jsonLines,\n\tpdf:pdf,\n\txlsx:xlsx,\n\thtml:html,\n};","export default function(list, options = {}, setFileContents){\n\tvar delimiter = options.delimiter ? options.delimiter : \",\",\n\tfileContents = [],\n\theaders = [];\n\n\tlist.forEach((row) => {\n\t\tvar item = [];\n\n\t\tswitch(row.type){\n\t\t\tcase \"group\":\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"calc\":\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"header\":\n\t\t\t\trow.columns.forEach((col, i) => {\n\t\t\t\t\tif(col && col.depth === 1){\n\t\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tbreak;\n\n\t\t\tcase \"row\":\n\t\t\t\trow.columns.forEach((col) => {\n\n\t\t\t\t\tif(col){\n\n\t\t\t\t\t\tswitch(typeof col.value){\n\t\t\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"undefined\":\n\t\t\t\t\t\t\t\tcol.value = \"\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tfileContents.push(item.join(delimiter));\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tif(headers.length){\n\t\tfileContents.unshift(headers.join(delimiter));\n\t}\n\n\tfileContents = fileContents.join(\"\\n\");\n\n\tif(options.bom){\n\t\tfileContents = \"\\ufeff\" + fileContents;\n\t}\n\n\tsetFileContents(fileContents, \"text/csv\");\n}\n","export default function(list, options, setFileContents){\n\tvar fileContents = [];\n\n\tlist.forEach((row) => {\n\t\tvar item = {};\n\n\t\tswitch(row.type){\n\t\t\tcase \"header\":\n\t\t\t\tbreak;\n\n\t\t\tcase \"group\":\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"calc\":\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"row\":\n\t\t\t\trow.columns.forEach((col) => {\n\t\t\t\t\tif(col){\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tfileContents.push(item);\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\n\n\tsetFileContents(fileContents, \"application/json\");\n}","export default function (list, options, setFileContents) {\n\tconst fileContents = [];\n\n\tlist.forEach((row) => {\n\t\tconst item = {};\n\n\t\tswitch (row.type) {\n\t\t\tcase \"header\":\n\t\t\t\tbreak;\n\n\t\t\tcase \"group\":\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"calc\":\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\n\t\t\t\tbreak;\n\n\t\t\tcase \"row\":\n\t\t\t\trow.columns.forEach((col) => {\n\t\t\t\t\tif (col) {\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tfileContents.push(JSON.stringify(item));\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\n}","export default function(list, options = {}, setFileContents){\n\tvar header = [],\n\tbody = [],\n\tautoTableParams = {},\n\trowGroupStyles = options.rowGroupStyles || {\n\t\tfontStyle: \"bold\",\n\t\tfontSize: 12,\n\t\tcellPadding: 6,\n\t\tfillColor: 220,\n\t},\n\trowCalcStyles = options.rowCalcStyles || {\n\t\tfontStyle: \"bold\",\n\t\tfontSize: 10,\n\t\tcellPadding: 4,\n\t\tfillColor: 232,\n\t},\n\tjsPDFParams = options.jsPDF || {},\n\ttitle = options.title ? options.title : \"\";\n\n\tif(!jsPDFParams.orientation){\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\n\t}\n\n\tif(!jsPDFParams.unit){\n\t\tjsPDFParams.unit = \"pt\";\n\t}\n\n\t//parse row list\n\tlist.forEach((row) => {\n\t\tswitch(row.type){\n\t\t\tcase \"header\":\n\t\t\t\theader.push(parseRow(row));\n\t\t\t\tbreak;\n\n\t\t\tcase \"group\":\n\t\t\t\tbody.push(parseRow(row, rowGroupStyles));\n\t\t\t\tbreak;\n\n\t\t\tcase \"calc\":\n\t\t\t\tbody.push(parseRow(row, rowCalcStyles));\n\t\t\t\tbreak;\n\n\t\t\tcase \"row\":\n\t\t\t\tbody.push(parseRow(row));\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tfunction parseRow(row, styles){\n\t\tvar rowData = [];\n\n\t\trow.columns.forEach((col) =>{\n\t\t\tvar cell;\n\n\t\t\tif(col){\n\t\t\t\tswitch(typeof col.value){\n\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"undefined\":\n\t\t\t\t\t\tcol.value = \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcell = {\n\t\t\t\t\tcontent:col.value,\n\t\t\t\t\tcolSpan:col.width,\n\t\t\t\t\trowSpan:col.height,\n\t\t\t\t};\n\n\t\t\t\tif(styles){\n\t\t\t\t\tcell.styles = styles;\n\t\t\t\t}\n\n\t\t\t\trowData.push(cell);\n\t\t\t}\n\t\t});\n\n\t\treturn rowData;\n\t}\n\n\n\t//configure PDF\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\n\n\tif(options.autoTable){\n\t\tif(typeof options.autoTable === \"function\"){\n\t\t\tautoTableParams = options.autoTable(doc) || {};\n\t\t}else{\n\t\t\tautoTableParams = options.autoTable;\n\t\t}\n\t}\n\n\tif(title){\n\t\tautoTableParams.didDrawPage = function(data) {\n\t\t\tdoc.text(title, 40, 30);\n\t\t};\n\t}\n\n\tautoTableParams.head = header;\n\tautoTableParams.body = body;\n\n\tdoc.autoTable(autoTableParams);\n\n\tif(options.documentProcessing){\n\t\toptions.documentProcessing(doc);\n\t}\n\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\n}\n","import CoreFeature from '../../../../core/CoreFeature.js';\n\nexport default function(list, options, setFileContents){\n\tvar self = this,\n\tsheetName = options.sheetName || \"Sheet1\",\n\tworkbook = XLSX.utils.book_new(),\n\ttableFeatures = new CoreFeature(this),\n\tcompression = 'compress' in options ? options.compress : true,\n\toutput;\n\n\tworkbook.SheetNames = [];\n\tworkbook.Sheets = {};\n\n\tfunction generateSheet(){\n\t\tvar rows = [],\n\t\tmerges = [],\n\t\tworksheet = {},\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 }};\n\n\t\t//parse row list\n\t\tlist.forEach((row, i) => {\n\t\t\tvar rowData = [];\n\n\t\t\trow.columns.forEach(function(col, j){\n\n\t\t\t\tif(col){\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\n\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\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}});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\trowData.push(\"\");\n\t\t\t\t}\n\t\t\t});\n\n\t\t\trows.push(rowData);\n\t\t});\n\n\t\t//convert rows to worksheet\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\n\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\n\n\t\tif(merges.length){\n\t\t\tworksheet[\"!merges\"] = merges;\n\t\t}\n\n\t\treturn worksheet;\n\t}\n\n\tif(options.sheetOnly){\n\t\tsetFileContents(generateSheet());\n\t\treturn;\n\t}\n\n\tif(options.sheets){\n\t\tfor(var sheet in options.sheets){\n\n\t\t\tif(options.sheets[sheet] === true){\n\t\t\t\tworkbook.SheetNames.push(sheet);\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\n\t\t\t}else{\n\n\t\t\t\tworkbook.SheetNames.push(sheet);\n\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\n\t\t\t\t\ttype:\"xlsx\",\n\t\t\t\t\toptions:{sheetOnly:true},\n\t\t\t\t\tactive:self.active,\n\t\t\t\t\tintercept:function(data){\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}else{\n\t\tworkbook.SheetNames.push(sheetName);\n\t\tworkbook.Sheets[sheetName] = generateSheet();\n\t}\n\n\tif(options.documentProcessing){\n\t\tworkbook = options.documentProcessing(workbook);\n\t}\n\n\t//convert workbook to binary array\n\tfunction s2ab(s) {\n\t\tvar buf = new ArrayBuffer(s.length);\n\t\tvar view = new Uint8Array(buf);\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\n\t\treturn buf;\n\t}\n\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary', compression });\n\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\n}","export default function(list, options, setFileContents){\n\tif(this.modExists(\"export\", true)){\n\t\tsetFileContents(this.modules.export.generateHTMLTable(list), \"text/html\");\n\t}\n}","import Module from '../../core/Module.js';\n\nimport defaultDownloaders from './defaults/downloaders.js';\n\nclass Download extends Module{\n\n\tconstructor(table){\n\t\tsuper(table);\n\n\t\tthis.registerTableOption(\"downloadEncoder\", function(data, mimeType){\n\t\t\treturn new Blob([data],{type:mimeType});\n\t\t}); //function to manipulate download data\n\t\tthis.registerTableOption(\"downloadReady\", undefined); //warn of function deprecation\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\n\n\t\tthis.registerColumnOption(\"download\");\n\t\tthis.registerColumnOption(\"titleDownload\");\n\t}\n\n\tinitialize(){\n\t\tthis.deprecatedOptionsCheck();\n\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\n\t}\n\n\tdeprecatedOptionsCheck(){\n\t\tthis.deprecationCheck(\"downloadReady\", \"downloadEncoder\");\n\t}\t\n\n\t///////////////////////////////////\n\t///////// Table Functions /////////\n\t///////////////////////////////////\n\n\tdownloadToTab(type, filename, options, active){\n\t\tthis.download(type, filename, options, active, true);\n\t}\n\n\t///////////////////////////////////\n\t///////// Internal Logic //////////\n\t///////////////////////////////////\n\n\t//trigger file download\n\tdownload(type, filename, options, range, interceptCallback){\n\t\tvar downloadFunc = false;\n\n\t\tfunction buildLink(data, mime){\n\t\t\tif(interceptCallback){\n\t\t\t\tif(interceptCallback === true){\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\n\t\t\t\t}else{\n\t\t\t\t\tinterceptCallback(data);\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\n\t\t\t}\n\t\t}\n\n\t\tif(typeof type == \"function\"){\n\t\t\tdownloadFunc = type;\n\t\t}else{\n\t\t\tif(Download.downloaders[type]){\n\t\t\t\tdownloadFunc = Download.downloaders[type];\n\t\t\t}else{\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\n\t\t\t}\n\t\t}\n\n\t\tif(downloadFunc){\n\t\t\tvar list = this.generateExportList(range);\n\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\n\t\t}\n\t}\n\n\tgenerateExportList(range){\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\n\n\t\t//assign group header formatter\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\n\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\n\t\t\tgroupHeader = [groupHeader];\n\t\t}\n\n\t\tlist.forEach((row) => {\n\t\t\tvar group;\n\n\t\t\tif(row.type === \"group\"){\n\t\t\t\tgroup = row.columns[0];\n\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn list;\n\t}\n\n\ttriggerDownload(data, mime, type, filename, newTab){\n\t\tvar element = document.createElement('a'),\n\t\tblob = this.table.options.downloadEncoder(data, mime);\n\n\t\tif(blob){\n\t\t\tif(newTab){\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\n\t\t\t}else{\n\t\t\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\n\t\t\t\t\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\n\t\t\t\t}else{\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\n\n\t\t\t\t\t//set file title\n\t\t\t\t\telement.setAttribute('download', filename);\n\n\t\t\t\t\t//trigger download\n\t\t\t\t\telement.style.display = 'none';\n\t\t\t\t\tdocument.body.appendChild(element);\n\t\t\t\t\telement.click();\n\n\t\t\t\t\t//remove temporary link element\n\t\t\t\t\tdocument.body.removeChild(element);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\n\t\t}\n\t}\n\n\tcommsReceived(table, action, data){\n\t\tswitch(action){\n\t\t\tcase \"intercept\":\n\t\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\n\t\t\t\tbreak;\n\t\t}\n\t}\n}\n\nDownload.moduleName = \"download\";\n\n//load defaults\nDownload.downloaders = defaultDownloaders;\n\nexport default Download;","export default function maskInput(el, options){\n\tvar mask = options.mask,\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\";\n\n\tfunction fillSymbols(index){\n\t\tvar symbol = mask[index];\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\n\t\t\tel.value = el.value + \"\" + symbol;\n\t\t\tfillSymbols(index+1);\n\t\t}\n\t}\n\n\tel.addEventListener(\"keydown\", (e) => {\n\t\tvar index = el.value.length,\n\t\tchar = e.key;\n\n\t\tif(e.keyCode > 46 && !e.ctrlKey && !e.metaKey){\n\t\t\tif(index >= mask.length){\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopPropagation();\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\tswitch(mask[index]){\n\t\t\t\t\tcase maskLetter:\n\t\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase maskNumber:\n\t\t\t\t\t\tif(isNaN(char)){\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase maskWildcard:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif(char !== mask[index]){\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t});\n\n\tel.addEventListener(\"keyup\", (e) => {\n\t\tif(e.keyCode > 46){\n\t\t\tif(options.maskAutoFill){\n\t\t\t\tfillSymbols(el.value.length);\n\t\t\t}\n\t\t}\n\t});\n\n\n\tif(!el.placeholder){\n\t\tel.placeholder = mask;\n\t}\n\n\tif(options.maskAutoFill){\n\t\tfillSymbols(el.value.length);\n\t}\n}","import maskInput from './inputMask.js';\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\n\nexport default class Edit{\n\tconstructor(editor, cell, onRendered, success, cancel, editorParams){\n\t\tthis.edit = editor;\n\t\tthis.table = editor.table;\n\t\tthis.cell = cell;\n\t\tthis.params = this._initializeParams(editorParams);\n\t\t\n\t\tthis.data = [];\n\t\tthis.displayItems = [];\n\t\tthis.currentItems = [];\n\t\tthis.focusedItem = null;\n\t\t\n\t\tthis.input = this._createInputElement();\n\t\tthis.listEl = this._createListElement();\n\t\t\n\t\tthis.initialValues = null; \n\t\t\n\t\tthis.isFilter = !cell._getSelf;\n\t\t\n\t\tthis.filterTimeout = null;\n\t\tthis.filtered = false;\n\t\tthis.typing = false;\n\t\t\n\t\tthis.values = []; \n\t\tthis.popup = null; \n\t\t\n\t\tthis.listIteration = 0;\n\t\t\n\t\tthis.lastAction=\"\";\n\t\tthis.filterTerm=\"\";\n\t\t\n\t\tthis.blurable = true;\n\t\t\n\t\tthis.actions = {\n\t\t\tsuccess:success,\n\t\t\tcancel:cancel\n\t\t};\n\t\t\n\t\tthis._deprecatedOptionsCheck();\n\t\tthis._initializeValue();\n\t\t\n\t\tonRendered(this._onRendered.bind(this));\n\t}\n\t\n\t_deprecatedOptionsCheck(){\n\t\tif(this.params.listItemFormatter){\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\n\t\t}\n\t\t\n\t\tif(this.params.sortValuesList){\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\n\t\t}\n\t\t\n\t\tif(this.params.searchFunc){\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\n\t\t}\n\t\t\n\t\tif(this.params.searchingPlaceholder){\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\n\t\t}\n\t}\n\t\n\t_initializeValue(){\n\t\tvar initialValue = this.cell.getValue();\n\t\t\n\t\tif(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\n\t\t\tinitialValue = this.params.defaultValue;\n\t\t}\n\t\t\n\t\tthis.initialValues = this.params.multiselect ? initialValue : [initialValue];\n\t\t\n\t\tif(this.isFilter){\n\t\t\tthis.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\n\t\t\tthis.headerFilterInitialListGen(); \n\t\t}\n\t}\n\t\n\t_onRendered(){\n\t\tvar cellEl = this.cell.getElement();\n\t\t\n\t\tfunction clickStop(e){\n\t\t\te.stopPropagation();\n\t\t}\t\n\t\n\t\tif(!this.isFilter){\n\t\t\tthis.input.style.height = \"100%\";\n\t\t\tthis.input.focus({preventScroll: true});\n\t\t}\n\t\t\n\t\t\n\t\tcellEl.addEventListener(\"click\", clickStop);\n\t\t\n\t\tsetTimeout(() => {\n\t\t\tcellEl.removeEventListener(\"click\", clickStop);\n\t\t}, 1000);\n\t\t\n\t\tthis.input.addEventListener(\"mousedown\", this._preventPopupBlur.bind(this));\n\t}\n\t\n\t_createListElement(){\n\t\tvar listEl = document.createElement(\"div\");\n\t\tlistEl.classList.add(\"tabulator-edit-list\");\n\t\t\n\t\tlistEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\n\t\tlistEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\n\t\t\n\t\treturn listEl;\n\t}\n\t\n\t_setListWidth(){\n\t\tvar element = this.isFilter ? this.input : this.cell.getElement();\n\t\t\n\t\tthis.listEl.style.minWidth = element.offsetWidth + \"px\";\n\t\t\n\t\tif(this.params.maxWidth){\n\t\t\tif(this.params.maxWidth === true){\n\t\t\t\tthis.listEl.style.maxWidth = element.offsetWidth + \"px\";\n\t\t\t}else if(typeof this.params.maxWidth === \"number\"){\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth + \"px\";\n\t\t\t}else{\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\t_createInputElement(){\n\t\tvar attribs = this.params.elementAttributes;\n\t\tvar input = document.createElement(\"input\");\n\t\t\n\t\tinput.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\n\t\t\n\t\tinput.style.padding = \"4px\";\n\t\tinput.style.width = \"100%\";\n\t\tinput.style.boxSizing = \"border-box\";\n\t\t\n\t\tif(!this.params.autocomplete){\n\t\t\tinput.style.cursor = \"default\";\n\t\t\tinput.style.caretColor = \"transparent\";\n\t\t\t// input.readOnly = (this.edit.currentCell != false);\n\t\t}\n\t\t\n\t\tif(attribs && typeof attribs == \"object\"){\n\t\t\tfor (let key in attribs){\n\t\t\t\tif(key.charAt(0) == \"+\"){\n\t\t\t\t\tkey = key.slice(1);\n\t\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\n\t\t\t\t}else{\n\t\t\t\t\tinput.setAttribute(key, attribs[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(this.params.mask){\n\t\t\tmaskInput(input, this.params);\n\t\t}\n\t\t\n\t\tthis._bindInputEvents(input);\n\t\t\n\t\treturn input;\n\t}\n\t\n\t_initializeParams(params){\n\t\tvar valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\n\t\tvalueCheck;\n\t\t\n\t\tparams = Object.assign({}, params);\n\t\t\n\t\tparams.verticalNavigation = params.verticalNavigation || \"editor\";\n\t\tparams.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\n\t\tparams.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\n\t\tparams.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\n\t\t\n\t\tparams.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\n\t\t\n\t\tvalueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\n\t\t\n\t\tif(!valueCheck){\n\t\t\tconsole.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\");\n\t\t}else if(valueCheck > 1){\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\");\n\t\t}\n\t\t\n\t\tif(params.autocomplete){\n\t\t\tif(params.multiselect){\n\t\t\t\tparams.multiselect = false;\n\t\t\t\tconsole.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\");\n\t\t\t}\n\t\t}else{\n\t\t\tif(params.freetext){\n\t\t\t\tparams.freetext = false;\n\t\t\t\tconsole.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\n\t\t\t}\n\t\t\t\n\t\t\tif(params.filterFunc){\n\t\t\t\tparams.filterFunc = false;\n\t\t\t\tconsole.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\n\t\t\t}\n\t\t\t\n\t\t\tif(params.filterRemote){\n\t\t\t\tparams.filterRemote = false;\n\t\t\t\tconsole.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\n\t\t\t}\n\t\t\t\n\t\t\tif(params.mask){\n\t\t\t\tparams.mask = false;\n\t\t\t\tconsole.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\n\t\t\t}\n\t\t\t\n\t\t\tif(params.allowEmpty){\n\t\t\t\tparams.allowEmpty = false;\n\t\t\t\tconsole.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\n\t\t\t}\n\t\t\t\n\t\t\tif(params.listOnEmpty){\n\t\t\t\tparams.listOnEmpty = false;\n\t\t\t\tconsole.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(params.filterRemote && !(typeof params.valuesLookup === \"function\" || params.valuesURL)){\n\t\t\tparams.filterRemote = false;\n\t\t\tconsole.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\n\t\t}\n\t\treturn params;\n\t}\n\t//////////////////////////////////////\n\t////////// Event Handling ////////////\n\t//////////////////////////////////////\n\t\n\t_bindInputEvents(input){\n\t\tinput.addEventListener(\"focus\", this._inputFocus.bind(this));\n\t\tinput.addEventListener(\"click\", this._inputClick.bind(this));\n\t\tinput.addEventListener(\"blur\", this._inputBlur.bind(this));\n\t\tinput.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\n\t\tinput.addEventListener(\"search\", this._inputSearch.bind(this));\n\t\t\n\t\tif(this.params.autocomplete){\n\t\t\tinput.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\n\t\t}\n\t}\n\t\n\t\n\t_inputFocus(e){\n\t\tthis.rebuildOptionsList();\n\t}\n\t\n\t_filter(){\n\t\tif(this.params.filterRemote){\n\t\t\tclearTimeout(this.filterTimeout);\n\t\t\t\n\t\t\tthis.filterTimeout = setTimeout(() => {\n\t\t\t\tthis.rebuildOptionsList();\n\t\t\t}, this.params.filterDelay);\n\t\t}else{\n\t\t\tthis._filterList();\n\t\t}\n\t}\n\t\n\t_inputClick(e){\n\t\te.stopPropagation();\n\t}\n\t\n\t_inputBlur(e){\n\t\tif(this.blurable){\n\t\t\tif(this.popup){\n\t\t\t\tthis.popup.hide();\n\t\t\t}else{\n\t\t\t\tthis._resolveValue(true);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t_inputSearch(){\n\t\tthis._clearChoices();\n\t}\n\t\n\t_inputKeyDown(e){\n\t\tswitch(e.keyCode){\n\t\t\t\n\t\t\tcase 38: //up arrow\n\t\t\t\tthis._keyUp(e);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 40: //down arrow\n\t\t\t\tthis._keyDown(e);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 37: //left arrow\n\t\t\tcase 39: //right arrow\n\t\t\t\tthis._keySide(e);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 13: //enter\n\t\t\t\tthis._keyEnter();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 27: //escape\n\t\t\t\tthis._keyEsc();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 36: //home\n\t\t\tcase 35: //end\n\t\t\t\tthis._keyHomeEnd(e);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 9: //tab\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\tthis._keySelectLetter(e);\n\t\t}\n\t}\n\t\n\t_inputKeyUp(e){\n\t\tswitch(e.keyCode){\n\t\t\tcase 38: //up arrow\n\t\t\tcase 37: //left arrow\n\t\t\tcase 39: //up arrow\n\t\t\tcase 40: //right arrow\n\t\t\tcase 13: //enter\n\t\t\tcase 27: //escape\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\tthis._keyAutoCompLetter(e);\n\t\t}\n\t}\n\t\n\t_preventPopupBlur(){\n\t\tif(this.popup){\n\t\t\tthis.popup.blockHide();\n\t\t}\n\t\t\n\t\tsetTimeout(() =>{\n\t\t\tif(this.popup){\n\t\t\t\tthis.popup.restoreHide();\n\t\t\t}\n\t\t}, 10);\n\t}\n\t\n\t_preventBlur(){\n\t\tthis.blurable = false;\n\t\t\n\t\tsetTimeout(() =>{\n\t\t\tthis.blurable = true;\n\t\t}, 10);\n\t}\n\t\n\t//////////////////////////////////////\n\t//////// Keyboard Navigation /////////\n\t//////////////////////////////////////\n\t\n\t_keyUp(e){\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\n\t\t\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\n\t\t\te.stopImmediatePropagation();\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\tif(index > 0){\n\t\t\t\tthis._focusItem(this.displayItems[index - 1]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t_keyDown(e){\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\n\t\t\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\n\t\t\te.stopImmediatePropagation();\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t\t\n\t\t\tif(index < this.displayItems.length - 1){\n\t\t\t\tif(index == -1){\n\t\t\t\t\tthis._focusItem(this.displayItems[0]);\n\t\t\t\t}else{\n\t\t\t\t\tthis._focusItem(this.displayItems[index + 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t_keySide(e){\n\t\tif(!this.params.autocomplete){\n\t\t\te.stopImmediatePropagation();\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\t\n\t_keyEnter(e){\n\t\tif(this.params.autocomplete && this.lastAction === \"typing\"){\n\t\t\tthis._resolveValue(true);\n\t\t}else{\n\t\t\tif(this.focusedItem){\n\t\t\t\tthis._chooseItem(this.focusedItem);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t_keyEsc(e){\n\t\tthis._cancel();\n\t}\n\t\n\t_keyHomeEnd(e){\n\t\tif(this.params.autocomplete){\n\t\t\t//prevent table navigation while using input element\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\t}\n\t\n\t_keySelectLetter(e){\n\t\tif(!this.params.autocomplete){\n\t\t\t// if(this.edit.currentCell === false){\n\t\t\te.preventDefault();\n\t\t\t// }\n\t\t\t\n\t\t\tif(e.keyCode >= 38 && e.keyCode <= 90){\n\t\t\t\tthis._scrollToValue(e.keyCode);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t_keyAutoCompLetter(e){\n\t\tthis._filter();\n\t\tthis.lastAction = \"typing\";\n\t\tthis.typing = true;\n\t}\n\t\n\t\n\t_scrollToValue(char){\n\t\tclearTimeout(this.filterTimeout);\n\t\t\n\t\tvar character = String.fromCharCode(char).toLowerCase();\n\t\tthis.filterTerm += character.toLowerCase();\n\t\t\n\t\tvar match = this.displayItems.find((item) => {\n\t\t\treturn typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\n\t\t});\n\t\t\n\t\tif(match){\n\t\t\tthis._focusItem(match);\n\t\t}\n\t\t\n\t\tthis.filterTimeout = setTimeout(() => {\n\t\t\tthis.filterTerm = \"\";\n\t\t}, 800);\n\t}\n\t\n\t_focusItem(item){\n\t\tthis.lastAction = \"focus\";\n\t\t\n\t\tif(this.focusedItem && this.focusedItem.element){\n\t\t\tthis.focusedItem.element.classList.remove(\"focused\");\n\t\t}\n\t\t\n\t\tthis.focusedItem = item;\n\t\t\n\t\tif(item && item.element){\n\t\t\titem.element.classList.add(\"focused\");\n\t\t\titem.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\n\t\t}\n\t}\n\t\n\t\n\t//////////////////////////////////////\n\t/////// Data List Generation /////////\n\t//////////////////////////////////////\n\theaderFilterInitialListGen(){\n\t\tthis._generateOptions(true);\n\t}\n\t\n\trebuildOptionsList(){\n\t\tthis._generateOptions()\n\t\t\t.then(this._sortOptions.bind(this))\n\t\t\t.then(this._buildList.bind(this))\n\t\t\t.then(this._showList.bind(this))\n\t\t\t.catch((e) => {\n\t\t\t\tif(!Number.isInteger(e)){\n\t\t\t\t\tconsole.error(\"List generation error\", e);\n\t\t\t\t}\n\t\t\t});\n\t}\n\t\n\t_filterList(){\n\t\tthis._buildList(this._filterOptions());\n\t\tthis._showList();\n\t}\n\t\n\t_generateOptions(silent){\n\t\tvar values = [];\n\t\tvar iteration = ++ this.listIteration;\n\t\t\n\t\tthis.filtered = false;\n\t\t\n\t\tif(this.params.values){\n\t\t\tvalues = this.params.values;\n\t\t}else if (this.params.valuesURL){\n\t\t\tvalues = this._ajaxRequest(this.params.valuesURL, this.input.value);\n\t\t}else{\n\t\t\tif(typeof this.params.valuesLookup === \"function\"){\n\t\t\t\tvalues = this.params.valuesLookup(this.cell, this.input.value);\n\t\t\t}else if(this.params.valuesLookup){\n\t\t\t\tvalues = this._uniqueColumnValues(this.params.valuesLookupField);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(values instanceof Promise){\n\t\t\tif(!silent){\n\t\t\t\tthis._addPlaceholder(this.params.placeholderLoading);\n\t\t\t}\n\t\t\t\n\t\t\treturn values.then()\n\t\t\t\t.then((responseValues) => {\n\t\t\t\t\tif(this.listIteration === iteration){\n\t\t\t\t\t\treturn this._parseList(responseValues);\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn Promise.reject(iteration);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}else{\n\t\t\treturn Promise.resolve(this._parseList(values));\n\t\t}\n\t}\n\t\n\t_addPlaceholder(contents){\n\t\tvar placeholder = document.createElement(\"div\");\n\t\t\n\t\tif(typeof contents === \"function\"){\n\t\t\tcontents = contents(this.cell.getComponent(), this.listEl);\n\t\t}\n\t\t\n\t\tif(contents){\n\t\t\tthis._clearList();\n\t\t\t\n\t\t\tif(contents instanceof HTMLElement){\n\t\t\t\tplaceholder = contents;\n\t\t\t}else{\n\t\t\t\tplaceholder.classList.add(\"tabulator-edit-list-placeholder\");\n\t\t\t\tplaceholder.innerHTML = contents;\n\t\t\t}\n\t\t\t\n\t\t\tthis.listEl.appendChild(placeholder);\n\t\t\t\n\t\t\tthis._showList();\n\t\t}\n\t}\n\t\n\t_ajaxRequest(url, term){\n\t\tvar params = this.params.filterRemote ? {term:term} : {};\n\t\turl = urlBuilder(url, {}, params);\n\t\t\n\t\treturn fetch(url)\n\t\t\t.then((response)=>{\n\t\t\t\tif(response.ok) {\n\t\t\t\t\treturn response.json()\n\t\t\t\t\t\t.catch((error)=>{\n\t\t\t\t\t\t\tconsole.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\n\t\t\t\t\t\t\treturn Promise.reject(error);\n\t\t\t\t\t\t});\n\t\t\t\t}else{\n\t\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\n\t\t\t\t\treturn Promise.reject(response);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch((error)=>{\n\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \", error);\n\t\t\t\treturn Promise.reject(error);\n\t\t\t});\n\t}\n\t\n\t_uniqueColumnValues(field){\n\t\tvar output = {},\n\t\tdata = this.table.getData(this.params.valuesLookup),\n\t\tcolumn;\n\t\t\n\t\tif(field){\n\t\t\tcolumn = this.table.columnManager.getColumnByField(field);\n\t\t}else{\n\t\t\tcolumn = this.cell.getColumn()._getSelf();\n\t\t}\n\t\t\n\t\tif(column){\n\t\t\tdata.forEach((row) => {\n\t\t\t\tvar val = column.getFieldValue(row);\n\t\t\t\t\n\t\t\t\tif(val !== null && typeof val !== \"undefined\" && val !== \"\"){\n\t\t\t\t\toutput[val] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}else{\n\t\t\tconsole.warn(\"unable to find matching column to create select lookup list:\", field);\n\t\t\toutput = [];\n\t\t}\n\t\t\n\t\treturn Object.keys(output);\n\t}\n\t\n\t\n\t_parseList(inputValues){\n\t\tvar data = [];\n\t\t\n\t\tif(!Array.isArray(inputValues)){\n\t\t\tinputValues = Object.entries(inputValues).map(([key, value]) => {\n\t\t\t\treturn {\n\t\t\t\t\tlabel:value,\n\t\t\t\t\tvalue:key,\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\t\n\t\tinputValues.forEach((value) => {\n\t\t\tif(typeof value !== \"object\"){\n\t\t\t\tvalue = {\n\t\t\t\t\tlabel:value,\n\t\t\t\t\tvalue:value,\n\t\t\t\t};\n\t\t\t}\n\t\t\t\n\t\t\tthis._parseListItem(value, data, 0);\n\t\t});\n\t\t\n\t\tif(!this.currentItems.length && this.params.freetext){\n\t\t\tthis.input.value = this.initialValues;\n\t\t\tthis.typing = true;\n\t\t\tthis.lastAction = \"typing\";\n\t\t}\n\t\t\n\t\tthis.data = data;\n\t\t\n\t\treturn data; \n\t}\n\t\n\t_parseListItem(option, data, level){\n\t\tvar item = {};\n\t\t\n\t\tif(option.options){\n\t\t\titem = this._parseListGroup(option, level + 1);\n\t\t}else{\n\t\t\titem = {\n\t\t\t\tlabel:option.label,\n\t\t\t\tvalue:option.value,\n\t\t\t\titemParams:option.itemParams,\n\t\t\t\telementAttributes: option.elementAttributes,\n\t\t\t\telement:false,\n\t\t\t\tselected:false,\n\t\t\t\tvisible:true,\n\t\t\t\tlevel:level,\n\t\t\t\toriginal:option,\n\t\t\t};\n\t\t\t\n\t\t\tif(this.initialValues && this.initialValues.indexOf(option.value) > -1){\n\t\t\t\tthis._chooseItem(item, true);\n\t\t\t}\n\t\t}\n\t\t\n\t\tdata.push(item);\n\t}\n\t\n\t_parseListGroup(option, level){\n\t\tvar item = {\n\t\t\tlabel:option.label,\n\t\t\tgroup:true,\n\t\t\titemParams:option.itemParams,\n\t\t\telementAttributes:option.elementAttributes,\n\t\t\telement:false,\n\t\t\tvisible:true,\n\t\t\tlevel:level,\n\t\t\toptions:[],\n\t\t\toriginal:option,\n\t\t};\n\t\t\n\t\toption.options.forEach((child) => {\n\t\t\tthis._parseListItem(child, item.options, level);\n\t\t});\n\t\t\n\t\treturn item;\n\t}\n\t\n\t_sortOptions(options){\n\t\tvar sorter;\n\t\t\n\t\tif(this.params.sort){\n\t\t\tsorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\n\t\t\t\n\t\t\tthis._sortGroup(sorter, options);\n\t\t}\n\t\t\n\t\treturn options;\n\t}\n\t\n\t_sortGroup(sorter, options){\n\t\toptions.sort((a,b) => {\n\t\t\treturn sorter(a.label, b.label, a.value, b.value, a.original, b.original);\n\t\t});\n\t\t\n\t\toptions.forEach((option) => {\n\t\t\tif(option.group){\n\t\t\t\tthis._sortGroup(sorter, option.options);\n\t\t\t}\n\t\t});\n\t}\n\t\n\t_defaultSortFunction(as, bs){\n\t\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\n\t\tvar emptyAlign = 0;\n\t\t\n\t\tif(this.params.sort === \"desc\"){\n\t\t\t[as, bs] = [bs, as];\n\t\t}\n\t\t\n\t\t//handle empty values\n\t\tif(!as && as!== 0){\n\t\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\n\t\t}else if(!bs && bs!== 0){\n\t\t\temptyAlign = 1;\n\t\t}else{\n\t\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\n\t\t\ta = String(as).toLowerCase();\n\t\t\tb = String(bs).toLowerCase();\n\t\t\tif(a === b) return 0;\n\t\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\n\t\t\ta = a.match(rx);\n\t\t\tb = b.match(rx);\n\t\t\tL = a.length > b.length ? b.length : a.length;\n\t\t\twhile(i < L){\n\t\t\t\ta1= a[i];\n\t\t\t\tb1= b[i++];\n\t\t\t\tif(a1 !== b1){\n\t\t\t\t\tif(isFinite(a1) && isFinite(b1)){\n\t\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\n\t\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\n\t\t\t\t\t\treturn a1 - b1;\n\t\t\t\t\t}\n\t\t\t\t\telse return a1 > b1 ? 1 : -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn a.length > b.length;\n\t\t}\n\t\t\n\t\treturn emptyAlign;\n\t}\n\t\n\t_filterOptions(){\n\t\tvar filterFunc = this.params.filterFunc || this._defaultFilterFunc,\n\t\tterm = this.input.value;\n\t\t\n\t\tif(term){\n\t\t\tthis.filtered = true;\n\t\t\t\n\t\t\tthis.data.forEach((item) => {\n\t\t\t\tthis._filterItem(filterFunc, term, item);\n\t\t\t});\n\t\t}else{\n\t\t\tthis.filtered = false;\n\t\t}\n\t\t\n\t\treturn this.data;\n\t}\n\t\n\t_filterItem(func, term, item){\n\t\tvar matches = false;\n\t\t\n\t\tif(!item.group){\n\t\t\titem.visible = func(term, item.label, item.value, item.original);\n\t\t}else{\n\t\t\titem.options.forEach((option) => {\n\t\t\t\tif(this._filterItem(func, term, option)){\n\t\t\t\t\tmatches = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\titem.visible = matches;\n\t\t}\n\t\t\n\t\treturn item.visible;\n\t}\n\t\n\t_defaultFilterFunc(term, label, value, item){\n\t\tterm = String(term).toLowerCase();\n\t\t\n\t\tif(label !== null && typeof label !== \"undefined\"){\n\t\t\tif(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase().indexOf(term) > -1){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}\n\t\n\t//////////////////////////////////////\n\t/////////// Display List /////////////\n\t//////////////////////////////////////\n\t\n\t_clearList(){\n\t\twhile(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\n\t\t\n\t\tthis.displayItems = [];\n\t}\n\t\n\t_buildList(data){\n\t\tthis._clearList();\n\t\t\n\t\tdata.forEach((option) => {\n\t\t\tthis._buildItem(option);\n\t\t});\n\t\t\n\t\tif(!this.displayItems.length){\n\t\t\tthis._addPlaceholder(this.params.placeholderEmpty);\n\t\t} \n\t}\n\t\n\t_buildItem(item){\n\t\tvar el = item.element,\n\t\tcontents;\n\t\t\n\t\tif(!this.filtered || item.visible){\n\t\t\t\n\t\t\tif(!el){\n\t\t\t\tel = document.createElement(\"div\");\n\t\t\t\tel.tabIndex = 0;\n\t\t\t\t\n\t\t\t\tcontents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\n\t\t\t\t\n\t\t\t\tif(contents instanceof HTMLElement){\n\t\t\t\t\tel.appendChild(contents);\n\t\t\t\t}else{\n\t\t\t\t\tel.innerHTML = contents;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(item.group){\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-group\");\n\t\t\t\t}else{\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-item\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tel.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\n\t\t\t\t\n\t\t\t\tif(item.elementAttributes && typeof item.elementAttributes == \"object\"){\n\t\t\t\t\tfor (let key in item.elementAttributes){\n\t\t\t\t\t\tif(key.charAt(0) == \"+\"){\n\t\t\t\t\t\t\tkey = key.slice(1);\n\t\t\t\t\t\t\tel.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tel.setAttribute(key, item.elementAttributes[key]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(item.group){\n\t\t\t\t\tel.addEventListener(\"click\", this._groupClick.bind(this, item));\n\t\t\t\t}else{\n\t\t\t\t\tel.addEventListener(\"click\", this._itemClick.bind(this, item));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tel.addEventListener(\"mousedown\", this._preventBlur.bind(this));\n\t\t\t\t\n\t\t\t\titem.element = el;\n\t\t\t}\n\t\t\t\n\t\t\tthis._styleItem(item);\n\t\t\t\n\t\t\tthis.listEl.appendChild(el);\n\t\t\t\n\t\t\tif(item.group){\n\t\t\t\titem.options.forEach((option) => {\n\t\t\t\t\tthis._buildItem(option);\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tthis.displayItems.push(item);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t_showList(){\n\t\tvar startVis = this.popup && this.popup.isVisible();\n\t\t\n\t\tif(this.input.parentNode){\n\t\t\tif(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\n\t\t\t\tif(this.popup){\n\t\t\t\t\tthis.popup.hide(true);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tthis._setListWidth();\n\t\t\t\n\t\t\tif(!this.popup){\n\t\t\t\tthis.popup = this.edit.popup(this.listEl);\n\t\t\t}\n\t\t\t\n\t\t\tthis.popup.show(this.cell.getElement(), \"bottom\");\n\t\t\t\n\t\t\tif(!startVis){\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.popup.hideOnBlur(this._resolveValue.bind(this, true));\n\t\t\t\t}, 10);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t_styleItem(item){\n\t\tif(item && item.element){\n\t\t\tif(item.selected){\n\t\t\t\titem.element.classList.add(\"active\");\n\t\t\t}else{\n\t\t\t\titem.element.classList.remove(\"active\");\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//////////////////////////////////////\n\t///////// User Interaction ///////////\n\t//////////////////////////////////////\n\t\n\t_itemClick(item, e){\n\t\te.stopPropagation();\n\t\t\n\t\tthis._chooseItem(item);\n\t}\n\t\n\t_groupClick(item, e){\n\t\te.stopPropagation();\n\t}\n\t\n\t\n\t//////////////////////////////////////\n\t////// Current Item Management ///////\n\t//////////////////////////////////////\n\t\n\t_cancel(){\n\t\tthis.popup.hide(true);\n\t\tthis.actions.cancel();\n\t}\n\t\n\t_clearChoices(){\n\t\tthis.typing = true;\n\t\t\n\t\tthis.currentItems.forEach((item) => {\n\t\t\titem.selected = false;\n\t\t\tthis._styleItem(item);\n\t\t});\n\t\t\n\t\tthis.currentItems = [];\n\t\t\n\t\tthis.focusedItem = null;\n\t}\n\t\n\t_chooseItem(item, silent){\n\t\tvar index;\n\t\t\n\t\tthis.typing = false;\n\t\t\n\t\tif(this.params.multiselect){\n\t\t\tindex = this.currentItems.indexOf(item);\n\t\t\t\n\t\t\tif(index > -1){\n\t\t\t\tthis.currentItems.splice(index, 1);\n\t\t\t\titem.selected = false;\n\t\t\t}else{\n\t\t\t\tthis.currentItems.push(item);\n\t\t\t\titem.selected = true;\n\t\t\t}\n\t\t\t\n\t\t\tthis.input.value = this.currentItems.map(item => item.label).join(\",\");\n\t\t\t\n\t\t\tthis._styleItem(item);\n\t\t\t\n\t\t}else{\n\t\t\tthis.currentItems = [item];\n\t\t\titem.selected = true;\n\t\t\t\n\t\t\tthis.input.value = item.label;\n\t\t\t\n\t\t\tthis._styleItem(item);\n\t\t\t\n\t\t\tif(!silent){\n\t\t\t\tthis._resolveValue();\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis._focusItem(item);\n\t}\n\t\n\t_resolveValue(blur){\n\t\tvar output, initialValue;\n\n\t\tif(this.popup){\n\t\t\tthis.popup.hide(true);\n\t\t}\n\t\t\n\t\tif(this.params.multiselect){\n\t\t\toutput = this.currentItems.map(item => item.value);\n\t\t}else{\n\t\t\tif(blur && this.params.autocomplete && this.typing){\n\t\t\t\tif(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\n\t\t\t\t\toutput = this.input.value;\n\t\t\t\t}else{\n\t\t\t\t\tthis.actions.cancel();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(this.currentItems[0]){\n\t\t\t\t\toutput = this.currentItems[0].value;\n\t\t\t\t}else{\n\t\t\t\t\tinitialValue = Array.isArray(this.initialValues) ? this.initialValues[0] : this.initialValues;\n\t\t\t\t\t\n\t\t\t\t\tif(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\n\t\t\t\t\t\toutput = initialValue;\n\t\t\t\t\t}else{\n\t\t\t\t\t\toutput = this.params.emptyValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(output === \"\"){\n\t\t\toutput = this.params.emptyValue;\n\t\t}\n\t\t\n\t\tthis.actions.success(output);\n\t\t\n\t\tif(this.isFilter){\n\t\t\tthis.initialValues = output && !Array.isArray(output) ? [output] : output;\n\t\t\tthis.currentItems = [];\n\t\t}\n\t}\n\t\n}\n","import input from './editors/input.js';\nimport textarea from './editors/textarea.js';\nimport number from './editors/number.js';\nimport range from './editors/range.js';\nimport date from './editors/date.js';\nimport time from './editors/time.js';\nimport datetime from './editors/datetime.js';\nimport select from './editors/select.js';\nimport list from './editors/list.js';\nimport autocomplete from './editors/autocomplete.js';\nimport star from './editors/star.js';\nimport progress from './editors/progress.js';\nimport tickCross from './editors/tickCross.js';\n\nexport default {\n\tinput:input,\n\ttextarea:textarea,\n\tnumber:number,\n\trange:range,\n\tdate:date,\n\ttime:time,\n\tdatetime:datetime,\n\tselect:select,\n\tlist:list,\n\tautocomplete:autocomplete,\n\tstar:star,\n\tprogress:progress,\n\ttickCross:tickCross,\n};","import maskInput from '../../inputMask.js';\n\n//input element\nexport default function(cell, onRendered, success, cancel, editorParams){\n\t//create and style input\n\tvar cellValue = cell.getValue(),\n\tinput = document.createElement(\"input\");\n\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\n\n\tinput.style.padding = \"4px\";\n\tinput.style.width = \"100%\";\n\tinput.style.boxSizing = \"border-box\";\n\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\n\t\tfor (let key in editorParams.elementAttributes){\n\t\t\tif(key.charAt(0) == \"+\"){\n\t\t\t\tkey = key.slice(1);\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\n\t\t\t}else{\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\n\t\t\t}\n\t\t}\n\t}\n\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\n\n\tonRendered(function(){\n\t\tif(cell._getSelf){\n\t\t\tinput.focus({preventScroll: true});\n\t\t\tinput.style.height = \"100%\";\n\n\t\t\tif(editorParams.selectContents){\n\t\t\t\tinput.select();\n\t\t\t}\n\t\t}\n\t});\n\n\tfunction onChange(e){\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\n\t\t\tif(success(input.value)){\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\n\t\t\t}\n\t\t}else{\n\t\t\tcancel();\n\t\t}\n\t}\n\n\t//submit new value on blur or change\n\tinput.addEventListener(\"change\", onChange);\n\tinput.addEventListener(\"blur\", onChange);\n\n\t//submit new value on enter\n\tinput.addEventListener(\"keydown\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\t// case 9:\n\t\t\tcase 13:\n\t\t\t\tonChange(e);\n\t\t\t\tbreak;\n\n\t\t\tcase 27:\n\t\t\t\tcancel();\n\t\t\t\tbreak;\n\n\t\t\tcase 35:\n\t\t\tcase 36:\n\t\t\t\te.stopPropagation();\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tif(editorParams.mask){\n\t\tmaskInput(input, editorParams);\n\t}\n\n\treturn input;\n}","import maskInput from '../../inputMask.js';\n\n//resizable text area element\nexport default function(cell, onRendered, success, cancel, editorParams){\n\tvar cellValue = cell.getValue(),\n\tvertNav = editorParams.verticalNavigation || \"hybrid\",\n\tvalue = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\n\tinput = document.createElement(\"textarea\"),\n\tscrollHeight = 0;\n\n\t//create and style input\n\tinput.style.display = \"block\";\n\tinput.style.padding = \"2px\";\n\tinput.style.height = \"100%\";\n\tinput.style.width = \"100%\";\n\tinput.style.boxSizing = \"border-box\";\n\tinput.style.whiteSpace = \"pre-wrap\";\n\tinput.style.resize = \"none\";\n\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\n\t\tfor (let key in editorParams.elementAttributes){\n\t\t\tif(key.charAt(0) == \"+\"){\n\t\t\t\tkey = key.slice(1);\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\n\t\t\t}else{\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\n\t\t\t}\n\t\t}\n\t}\n\n\tinput.value = value;\n\n\tonRendered(function(){\n\t\tif(cell._getSelf){\n\t\t\tinput.focus({preventScroll: true});\n\t\t\tinput.style.height = \"100%\";\n\n\t\t\tinput.scrollHeight;\n\t\t\tinput.style.height = input.scrollHeight + \"px\";\n\t\t\tcell.getRow().normalizeHeight();\n\n\t\t\tif(editorParams.selectContents){\n\t\t\t\tinput.select();\n\t\t\t}\n\t\t}\n\t});\n\n\tfunction onChange(e){\n\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\n\n\t\t\tif(success(input.value)){\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\n\t\t\t}\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tcell.getRow().normalizeHeight();\n\t\t\t},300);\n\t\t}else{\n\t\t\tcancel();\n\t\t}\n\t}\n\n\t//submit new value on blur or change\n\tinput.addEventListener(\"change\", onChange);\n\tinput.addEventListener(\"blur\", onChange);\n\n\tinput.addEventListener(\"keyup\", function(){\n\n\t\tinput.style.height = \"\";\n\n\t\tvar heightNow = input.scrollHeight;\n\n\t\tinput.style.height = heightNow + \"px\";\n\n\t\tif(heightNow != scrollHeight){\n\t\t\tscrollHeight = heightNow;\n\t\t\tcell.getRow().normalizeHeight();\n\t\t}\n\t});\n\n\tinput.addEventListener(\"keydown\", function(e){\n\n\t\tswitch(e.keyCode){\n\n\t\t\tcase 13:\n\t\t\t\tif(e.shiftKey && editorParams.shiftEnterSubmit){\n\t\t\t\t\tonChange(e);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 27:\n\t\t\t\tcancel();\n\t\t\t\tbreak;\n\n\t\t\tcase 38: //up arrow\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\n\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 40: //down arrow\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\n\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 35:\n\t\t\tcase 36:\n\t\t\t\te.stopPropagation();\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tif(editorParams.mask){\n\t\tmaskInput(input, editorParams);\n\t}\n\n\treturn input;\n}","import maskInput from '../../inputMask.js';\n\n//input element with type of number\nexport default function(cell, onRendered, success, cancel, editorParams){\n\tvar cellValue = cell.getValue(),\n\tvertNav = editorParams.verticalNavigation || \"editor\",\n\tinput = document.createElement(\"input\");\n\n\tinput.setAttribute(\"type\", \"number\");\n\n\tif(typeof editorParams.max != \"undefined\"){\n\t\tinput.setAttribute(\"max\", editorParams.max);\n\t}\n\n\tif(typeof editorParams.min != \"undefined\"){\n\t\tinput.setAttribute(\"min\", editorParams.min);\n\t}\n\n\tif(typeof editorParams.step != \"undefined\"){\n\t\tinput.setAttribute(\"step\", editorParams.step);\n\t}\n\n\t//create and style input\n\tinput.style.padding = \"4px\";\n\tinput.style.width = \"100%\";\n\tinput.style.boxSizing = \"border-box\";\n\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\n\t\tfor (let key in editorParams.elementAttributes){\n\t\t\tif(key.charAt(0) == \"+\"){\n\t\t\t\tkey = key.slice(1);\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\n\t\t\t}else{\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\n\t\t\t}\n\t\t}\n\t}\n\n\tinput.value = cellValue;\n\n\tvar blurFunc = function(e){\n\t\tonChange();\n\t};\n\n\tonRendered(function () {\n\t\tif(cell._getSelf){\n\t\t\t//submit new value on blur\n\t\t\tinput.removeEventListener(\"blur\", blurFunc);\n\n\t\t\tinput.focus({preventScroll: true});\n\t\t\tinput.style.height = \"100%\";\n\n\t\t\t//submit new value on blur\n\t\t\tinput.addEventListener(\"blur\", blurFunc);\n\n\t\t\tif(editorParams.selectContents){\n\t\t\t\tinput.select();\n\t\t\t}\n\t\t}\n\t});\n\n\tfunction onChange(){\n\t\tvar value = input.value;\n\n\t\tif(!isNaN(value) && value !==\"\"){\n\t\t\tvalue = Number(value);\n\t\t}\n\n\t\tif(value !== cellValue){\n\t\t\tif(success(value)){\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\n\t\t\t}\n\t\t}else{\n\t\t\tcancel();\n\t\t}\n\t}\n\n\t//submit new value on enter\n\tinput.addEventListener(\"keydown\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\tcase 13:\n\t\t\t// case 9:\n\t\t\t\tonChange();\n\t\t\t\tbreak;\n\n\t\t\tcase 27:\n\t\t\t\tcancel();\n\t\t\t\tbreak;\n\n\t\t\tcase 38: //up arrow\n\t\t\tcase 40: //down arrow\n\t\t\t\tif(vertNav == \"editor\"){\n\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 35:\n\t\t\tcase 36:\n\t\t\t\te.stopPropagation();\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tif(editorParams.mask){\n\t\tmaskInput(input, editorParams);\n\t}\n\n\treturn input;\n}","//input element with type of number\nexport default function(cell, onRendered, success, cancel, editorParams){\n\tvar cellValue = cell.getValue(),\n\tinput = document.createElement(\"input\");\n\t\n\tinput.setAttribute(\"type\", \"range\");\n\t\n\tif (typeof editorParams.max != \"undefined\") {\n\t\tinput.setAttribute(\"max\", editorParams.max);\n\t}\n\t\n\tif (typeof editorParams.min != \"undefined\") {\n\t\tinput.setAttribute(\"min\", editorParams.min);\n\t}\n\t\n\tif (typeof editorParams.step != \"undefined\") {\n\t\tinput.setAttribute(\"step\", editorParams.step);\n\t}\n\t\n\t//create and style input\n\tinput.style.padding = \"4px\";\n\tinput.style.width = \"100%\";\n\tinput.style.boxSizing = \"border-box\";\n\t\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\n\t\tfor (let key in editorParams.elementAttributes){\n\t\t\tif(key.charAt(0) == \"+\"){\n\t\t\t\tkey = key.slice(1);\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\n\t\t\t}else{\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tinput.value = cellValue;\n\t\n\tonRendered(function () {\n\t\tif(cell._getSelf){\n\t\t\tinput.focus({preventScroll: true});\n\t\t\tinput.style.height = \"100%\";\n\t\t}\n\t});\n\t\n\tfunction onChange(){\n\t\tvar value = input.value;\n\t\t\n\t\tif(!isNaN(value) && value !==\"\"){\n\t\t\tvalue = Number(value);\n\t\t}\n\t\t\n\t\tif(value != cellValue){\n\t\t\tif(success(value)){\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\n\t\t\t}\n\t\t}else{\n\t\t\tcancel();\n\t\t}\n\t}\n\t\n\t//submit new value on blur\n\tinput.addEventListener(\"blur\", function(e){\n\t\tonChange();\n\t});\n\t\n\t//submit new value on enter\n\tinput.addEventListener(\"keydown\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\tcase 13:\n\t\t\t// case 9:\n\t\t\t\tonChange();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 27:\n\t\t\t\tcancel();\n\t\t\t\tbreak;\n\t\t}\n\t});\n\t\n\treturn input;\n}","//input element\nexport default function(cell, onRendered, success, cancel, editorParams){\n\tvar inputFormat = editorParams.format,\n\tvertNav = editorParams.verticalNavigation || \"editor\",\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null;\n\t\n\t//create and style input\n\tvar cellValue = cell.getValue(),\n\tinput = document.createElement(\"input\");\n\t\n\tfunction convertDate(value){\n\t\tvar newDatetime;\n\t\t\n\t\tif(DT.isDateTime(value)){\n\t\t\tnewDatetime = value;\n\t\t}else if(inputFormat === \"iso\"){\n\t\t\tnewDatetime = DT.fromISO(String(value));\n\t\t}else{\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\n\t\t}\n\t\t\n\t\treturn newDatetime.toFormat(\"yyyy-MM-dd\");\n\t}\n\t\n\tinput.type = \"date\";\n\tinput.style.padding = \"4px\";\n\tinput.style.width = \"100%\";\n\tinput.style.boxSizing = \"border-box\";\n\n\tif(editorParams.max){\n\t\tinput.setAttribute(\"max\", inputFormat ? convertDate(editorParams.max) : editorParams.max);\n\t}\n\n\tif(editorParams.min){\n\t\tinput.setAttribute(\"min\", inputFormat ? convertDate(editorParams.min) : editorParams.min);\n\t}\n\t\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\n\t\tfor (let key in editorParams.elementAttributes){\n\t\t\tif(key.charAt(0) == \"+\"){\n\t\t\t\tkey = key.slice(1);\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\n\t\t\t}else{\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\n\t\n\tif(inputFormat){\n\t\tif(DT){\t\t\n\t\t\tcellValue = convertDate(cellValue);\t\t\t\n\t\t}else{\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'format' param is dependant on luxon.js\");\n\t\t}\n\t}\n\t\n\tinput.value = cellValue;\n\t\n\tonRendered(function(){\n\t\tif(cell._getSelf){\n\t\t\tinput.focus({preventScroll: true});\n\t\t\tinput.style.height = \"100%\";\n\t\t\t\n\t\t\tif(editorParams.selectContents){\n\t\t\t\tinput.select();\n\t\t\t}\n\t\t}\n\t});\n\t\n\tfunction onChange(){\n\t\tvar value = input.value,\n\t\tluxDate;\n\t\t\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\n\t\t\t\n\t\t\tif(value && inputFormat){\n\t\t\t\tluxDate = DT.fromFormat(String(value), \"yyyy-MM-dd\");\n\n\t\t\t\tswitch(inputFormat){\n\t\t\t\t\tcase true:\n\t\t\t\t\t\tvalue = luxDate;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"iso\":\n\t\t\t\t\t\tvalue = luxDate.toISO();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvalue = luxDate.toFormat(inputFormat);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(success(value)){\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\n\t\t\t}\n\t\t}else{\n\t\t\tcancel();\n\t\t}\n\t}\n\t\n\t//submit new value on blur\n\tinput.addEventListener(\"blur\", function(e) {\n\t\tif (e.relatedTarget || e.rangeParent || e.explicitOriginalTarget !== input) {\n\t\t\tonChange(); // only on a \"true\" blur; not when focusing browser's date/time picker\n\t\t}\n\t});\n\t\n\t//submit new value on enter\n\tinput.addEventListener(\"keydown\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\t// case 9:\n\t\t\tcase 13:\n\t\t\t\tonChange();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 27:\n\t\t\t\tcancel();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 35:\n\t\t\tcase 36:\n\t\t\t\te.stopPropagation();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 38: //up arrow\n\t\t\tcase 40: //down arrow\n\t\t\t\tif(vertNav == \"editor\"){\n\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t});\n\t\n\treturn input;\n}\n","//input element\nexport default function(cell, onRendered, success, cancel, editorParams){\n\tvar inputFormat = editorParams.format,\n\tvertNav = editorParams.verticalNavigation || \"editor\",\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \n\tnewDatetime;\n\t\n\t//create and style input\n\tvar cellValue = cell.getValue(),\n\tinput = document.createElement(\"input\");\n\t\n\tinput.type = \"time\";\n\tinput.style.padding = \"4px\";\n\tinput.style.width = \"100%\";\n\tinput.style.boxSizing = \"border-box\";\n\t\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\n\t\tfor (let key in editorParams.elementAttributes){\n\t\t\tif(key.charAt(0) == \"+\"){\n\t\t\t\tkey = key.slice(1);\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\n\t\t\t}else{\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\n\t\n\tif(inputFormat){\n\t\tif(DT){\n\t\t\tif(DT.isDateTime(cellValue)){\n\t\t\t\tnewDatetime = cellValue;\n\t\t\t}else if(inputFormat === \"iso\"){\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\n\t\t\t}else{\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\n\t\t\t}\n\t\t\t\n\t\t\tcellValue = newDatetime.toFormat(\"hh:mm\");\n\t\t\t\n\t\t}else{\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'format' param is dependant on luxon.js\");\n\t\t}\n\t}\n\t\n\tinput.value = cellValue;\n\t\n\tonRendered(function(){\n\t\tif(cell._getSelf){\n\t\t\tinput.focus({preventScroll: true});\n\t\t\tinput.style.height = \"100%\";\n\t\t\t\n\t\t\tif(editorParams.selectContents){\n\t\t\t\tinput.select();\n\t\t\t}\n\t\t}\n\t});\n\t\n\tfunction onChange(){\n\t\tvar value = input.value,\n\t\tluxTime;\n\t\t\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\n\t\t\t\n\t\t\tif(value && inputFormat){\n\t\t\t\tluxTime = DT.fromFormat(String(value), \"hh:mm\");\n\n\t\t\t\tswitch(inputFormat){\n\t\t\t\t\tcase true:\n\t\t\t\t\t\tvalue = luxTime;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"iso\":\n\t\t\t\t\t\tvalue = luxTime.toISO();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvalue = luxTime.toFormat(inputFormat);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(success(value)){\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\n\t\t\t}\n\t\t}else{\n\t\t\tcancel();\n\t\t}\n\t}\n\t\n\t//submit new value on blur\n\tinput.addEventListener(\"blur\", function(e) {\n\t\tif (e.relatedTarget || e.rangeParent || e.explicitOriginalTarget !== input) {\n\t\t\tonChange(); // only on a \"true\" blur; not when focusing browser's date/time picker\n\t\t}\n\t});\n\t\n\t//submit new value on enter\n\tinput.addEventListener(\"keydown\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\t// case 9:\n\t\t\tcase 13:\n\t\t\t\tonChange();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 27:\n\t\t\t\tcancel();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 35:\n\t\t\tcase 36:\n\t\t\t\te.stopPropagation();\n\t\t\t\tbreak;\n\n\t\t\tcase 38: //up arrow\n\t\t\tcase 40: //down arrow\n\t\t\t\tif(vertNav == \"editor\"){\n\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t});\n\t\n\treturn input;\n}\n","//input element\nexport default function(cell, onRendered, success, cancel, editorParams){\n\tvar inputFormat = editorParams.format,\n\tvertNav = editorParams.verticalNavigation || \"editor\",\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \n\tnewDatetime;\n\t\n\t//create and style input\n\tvar cellValue = cell.getValue(),\n\tinput = document.createElement(\"input\");\n\t\n\tinput.type = \"datetime-local\";\n\tinput.style.padding = \"4px\";\n\tinput.style.width = \"100%\";\n\tinput.style.boxSizing = \"border-box\";\n\t\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\n\t\tfor (let key in editorParams.elementAttributes){\n\t\t\tif(key.charAt(0) == \"+\"){\n\t\t\t\tkey = key.slice(1);\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\n\t\t\t}else{\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\n\t\n\tif(inputFormat){\n\t\tif(DT){\n\t\t\tif(DT.isDateTime(cellValue)){\n\t\t\t\tnewDatetime = cellValue;\n\t\t\t}else if(inputFormat === \"iso\"){\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\n\t\t\t}else{\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\n\t\t\t}\n\t\t\t\n\t\t\tcellValue = newDatetime.toFormat(\"yyyy-MM-dd\") + \"T\" + newDatetime.toFormat(\"hh:mm\");\n\t\t}else{\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'format' param is dependant on luxon.js\");\n\t\t}\n\t}\n\t\n\tinput.value = cellValue;\n\t\n\tonRendered(function(){\n\t\tif(cell._getSelf){\n\t\t\tinput.focus({preventScroll: true});\n\t\t\tinput.style.height = \"100%\";\n\t\t\t\n\t\t\tif(editorParams.selectContents){\n\t\t\t\tinput.select();\n\t\t\t}\n\t\t}\n\t});\n\t\n\tfunction onChange(){\n\t\tvar value = input.value,\n\t\tluxDateTime;\n\t\t\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\n\n\t\t\tif(value && inputFormat){\n\t\t\t\tluxDateTime = DT.fromISO(String(value));\n\n\t\t\t\tswitch(inputFormat){\n\t\t\t\t\tcase true:\n\t\t\t\t\t\tvalue = luxDateTime;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"iso\":\n\t\t\t\t\t\tvalue = luxDateTime.toISO();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvalue = luxDateTime.toFormat(inputFormat);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(success(value)){\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\n\t\t\t}\n\t\t}else{\n\t\t\tcancel();\n\t\t}\n\t}\n\t\n\t//submit new value on blur\n\tinput.addEventListener(\"blur\", function(e) {\n\t\tif (e.relatedTarget || e.rangeParent || e.explicitOriginalTarget !== input) {\n\t\t\tonChange(); // only on a \"true\" blur; not when focusing browser's date/time picker\n\t\t}\n\t});\n\t\n\t//submit new value on enter\n\tinput.addEventListener(\"keydown\", function(e){\n\t\tswitch(e.keyCode){\n\t\t\t// case 9:\n\t\t\tcase 13:\n\t\t\t\tonChange();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 27:\n\t\t\t\tcancel();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 35:\n\t\t\tcase 36:\n\t\t\t\te.stopPropagation();\n\t\t\t\tbreak;\n\n\t\t\tcase 38: //up arrow\n\t\t\tcase 40: //down arrow\n\t\t\t\tif(vertNav == \"editor\"){\n\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t});\n\t\n\treturn input;\n}\n","import List from '../../List.js';\n\nexport default function(cell, onRendered, success, cancel, editorParams){\n\n\tthis.deprecationMsg(\"The select editor has been deprecated, please use the new list editor\");\n\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\n\n\treturn list.input;\n}","import List from '../../List.js';\n\nexport default function(cell, onRendered, success, cancel, editorParams){\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\n\n\treturn list.input;\n}","import List from '../../List.js';\n\nexport default function(cell, onRendered, success, cancel, editorParams){\n\n\tthis.deprecationMsg(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\n\n\teditorParams.autocomplete = true;\n\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\n\n\treturn list.input;\n}","//star rating\nexport default function(cell, onRendered, success, cancel, editorParams){\n\tvar self = this,\n\telement = cell.getElement(),\n\tvalue = cell.getValue(),\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\n\tstars = [],\n\tstarsHolder = document.createElement(\"div\"),\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\n\n\n\t//change star type\n\tfunction starChange(val){\n\t\tstars.forEach(function(star, i){\n\t\t\tif(i < val){\n\t\t\t\tif(self.table.browser == \"ie\"){\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\n\t\t\t\t}else{\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\n\t\t\t\t}\n\n\t\t\t\tstar.innerHTML = '