[ { "kind": "file", "static": true, "variation": null, "name": "src/array.js", "memberof": null, "longname": "src/array.js", "access": null, "description": null, "lineNumber": 5, "content": "/**\n * Array utilities\n */\n\nimport Str from './string';\n\nexport default {\n has: function(arr, val, caseSensitive){\n let sCase = caseSensitive===undefined ? false : caseSensitive;\n for (var i=0; i2){\n return yr;\n }\n let y;\n //>50 belong to 1900\n if(yr <= 99 && yr>50){\n y = '19' + yr;\n }\n //<50 belong to 2000\n if(yr<50 || yr === '00'){\n y = '20' + yr;\n }\n return y;\n}\n\nfunction mmm2mm(mmm){\n if(mmm === undefined){\n return 0;\n }\n let mondigit;\n let MONTH_NAMES = [\n 'january','february','march','april','may','june','july',\n 'august','september','october','november','december',\n 'jan','feb','mar','apr','may','jun','jul','aug','sep','oct',\n 'nov','dec'\n ];\n for(let m_i=0; m_i < MONTH_NAMES.length; m_i++){\n let month_name = MONTH_NAMES[m_i];\n if (mmm.toLowerCase() === month_name){\n mondigit = m_i+1;\n break;\n }\n }\n if(mondigit > 11 || mondigit < 23){\n mondigit = mondigit - 12;\n }\n if(mondigit < 1 || mondigit > 12){\n return 0;\n }\n return mondigit;\n}\n" }, { "kind": "function", "static": true, "variation": null, "name": "y2kDate", "memberof": "src/date.js", "longname": "src/date.js~y2kDate", "access": null, "export": false, "importPath": "tablefilter/src/date.js", "importStyle": null, "description": null, "lineNumber": 128, "undocument": true, "params": [ { "name": "yr", "types": [ "*" ] } ], "return": { "types": [ "*" ] }, "generator": false }, { "kind": "function", "static": true, "variation": null, "name": "mmm2mm", "memberof": "src/date.js", "longname": "src/date.js~mmm2mm", "access": null, "export": false, "importPath": "tablefilter/src/date.js", "importStyle": null, "description": null, "lineNumber": 147, "undocument": true, "params": [ { "name": "mmm", "types": [ "*" ] } ], "return": { "types": [ "*" ] }, "generator": false }, { "kind": "file", "static": true, "variation": null, "name": "src/dom.js", "memberof": null, "longname": "src/dom.js", "access": null, "description": null, "lineNumber": 5, "content": "/**\n * DOM utilities\n */\n\nexport default {\n\n /**\n * Returns text + text of children of given node\n * @param {NodeElement} node\n * @return {String}\n */\n getText(node){\n let s = node.textContent || node.innerText ||\n node.innerHTML.replace(/<[^<>]+>/g, '');\n s = s.replace(/^\\s+/, '').replace(/\\s+$/, '');\n return s;\n },\n\n /**\n * Returns the first text node contained in the supplied node\n * @param {NodeElement} node node\n * @return {String}\n */\n getFirstTextNode(node){\n for(let i=0; i 1){\n for(let i=0; i {\n this.events[evt] = this.events[evt] || [];\n this.events[evt].push(fn);\n });\n }\n\n /**\n * Unsubscribe to an event\n * @param {Array} evts Collection of event names\n * @param {Function} fn Function invoked when event is emitted\n */\n off(evts, fn) {\n evts.forEach((evt)=> {\n if(evt in this.events) {\n this.events[evt].splice(this.events[evt].indexOf(fn), 1);\n }\n });\n }\n\n /**\n * Emit an event\n * @param {String} evt Event name followed by any other argument passed to\n * the invoked function\n */\n emit(evt /*, args...*/) {\n if(evt in this.events) {\n for(let i = 0; i < this.events[evt].length; i++) {\n this.events[evt][i].apply(this, [].slice.call(arguments, 1));\n }\n }\n }\n}\n" }, { "kind": "class", "static": true, "variation": null, "name": "Emitter", "memberof": "src/emitter.js", "longname": "src/emitter.js~Emitter", "access": null, "export": true, "importPath": "tablefilter/src/emitter.js", "importStyle": "{Emitter}", "description": "Event emitter class", "lineNumber": 4, "interface": false }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/emitter.js~Emitter", "longname": "src/emitter.js~Emitter#constructor", "access": null, "description": null, "lineNumber": 5, "undocument": true, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "events", "memberof": "src/emitter.js~Emitter", "longname": "src/emitter.js~Emitter#events", "access": null, "description": "Events object", "lineNumber": 10, "type": { "nullable": null, "types": [ "Object" ], "spread": false, "description": null } }, { "kind": "method", "static": false, "variation": null, "name": "on", "memberof": "src/emitter.js~Emitter", "longname": "src/emitter.js~Emitter#on", "access": null, "description": "Subscribe to an event", "lineNumber": 18, "params": [ { "nullable": null, "types": [ "Array" ], "spread": false, "optional": false, "name": "evts", "description": "Collection of event names" }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "fn", "description": "Function invoked when event is emitted" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "off", "memberof": "src/emitter.js~Emitter", "longname": "src/emitter.js~Emitter#off", "access": null, "description": "Unsubscribe to an event", "lineNumber": 30, "params": [ { "nullable": null, "types": [ "Array" ], "spread": false, "optional": false, "name": "evts", "description": "Collection of event names" }, { "nullable": null, "types": [ "Function" ], "spread": false, "optional": false, "name": "fn", "description": "Function invoked when event is emitted" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "emit", "memberof": "src/emitter.js~Emitter", "longname": "src/emitter.js~Emitter#emit", "access": null, "description": "Emit an event", "lineNumber": 43, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "evt", "description": "Event name followed by any other argument passed to\nthe invoked function" } ], "generator": false }, { "kind": "file", "static": true, "variation": null, "name": "src/event.js", "memberof": null, "longname": "src/event.js", "access": null, "description": null, "lineNumber": 5, "content": "/**\n * DOM event utilities\n */\n\nexport default {\n add(obj, type, func, capture){\n if(obj.addEventListener){\n obj.addEventListener(type, func, capture);\n }\n else if(obj.attachEvent){\n obj.attachEvent('on'+type, func);\n } else {\n obj['on'+type] = func;\n }\n },\n remove(obj, type, func, capture){\n if(obj.detachEvent){\n obj.detachEvent('on'+type,func);\n }\n else if(obj.removeEventListener){\n obj.removeEventListener(type, func, capture);\n } else {\n obj['on'+type] = null;\n }\n },\n stop(evt){\n if(!evt){\n evt = window.event;\n }\n if(evt.stopPropagation){\n evt.stopPropagation();\n } else {\n evt.cancelBubble = true;\n }\n },\n cancel(evt){\n if(!evt){\n evt = window.event;\n }\n if(evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n },\n target(evt){\n return (evt && evt.target) || (window.event && window.event.srcElement);\n },\n keyCode(evt){\n return evt.charCode ? evt.charCode :\n (evt.keyCode ? evt.keyCode: (evt.which ? evt.which : 0));\n }\n};\n" }, { "kind": "file", "static": true, "variation": null, "name": "src/extensions/advancedGrid/adapterEzEditTable.js", "memberof": null, "longname": "src/extensions/advancedGrid/adapterEzEditTable.js", "access": null, "description": null, "lineNumber": 1, "content": "import Dom from '../../dom';\n\nexport default class AdapterEzEditTable {\n /**\n * Adapter module for ezEditTable, an external library providing advanced\n * grid features (selection and edition):\n * http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus\n *\n * @param {Object} tf TableFilter instance\n */\n constructor(tf, cfg){\n // ezEditTable config\n this.initialized = false;\n this.desc = cfg.description || 'ezEditTable adapter';\n this.filename = cfg.filename || 'ezEditTable.js';\n this.vendorPath = cfg.vendor_path;\n this.loadStylesheet = Boolean(cfg.load_stylesheet);\n this.stylesheet = cfg.stylesheet || this.vendorPath + 'ezEditTable.css';\n this.stylesheetName = cfg.stylesheet_name || 'ezEditTableCss';\n this.err = 'Failed to instantiate EditTable object.\\n\"ezEditTable\" ' +\n 'dependency not found.';\n // Enable the ezEditTable's scroll into view behaviour if grid layout on\n cfg.scroll_into_view = cfg.scroll_into_view===false ?\n false : tf.gridLayout;\n\n this._ezEditTable = null;\n this.cfg = cfg;\n this.tf = tf;\n this.emitter = tf.emitter;\n }\n\n /**\n * Conditionally load ezEditTable library and set advanced grid\n * @return {[type]} [description]\n */\n init(){\n var tf = this.tf;\n if(window.EditTable){\n this._setAdvancedGrid();\n } else {\n var path = this.vendorPath + this.filename;\n tf.import(this.filename, path, ()=> { this._setAdvancedGrid(); });\n }\n if(this.loadStylesheet && !tf.isImported(this.stylesheet, 'link')){\n tf.import(this.stylesheetName, this.stylesheet, null, 'link');\n }\n\n // TODO: hack to prevent ezEditTable enter key event hijaking.\n // Needs to be fixed in the vendor's library\n this.emitter.on(['filter-focus', 'filter-blur'],\n ()=> this._toggleForInputFilter());\n }\n\n /**\n * Instantiate ezEditTable component for advanced grid features\n */\n _setAdvancedGrid(){\n var tf = this.tf;\n\n //start row for EditTable constructor needs to be calculated\n var startRow,\n cfg = this.cfg,\n thead = Dom.tag(tf.tbl, 'thead');\n\n //if thead exists and startRow not specified, startRow is calculated\n //automatically by EditTable\n if(thead.length > 0 && !cfg.startRow){\n startRow = undefined;\n }\n //otherwise startRow config property if any or TableFilter refRow\n else{\n startRow = cfg.startRow || tf.refRow;\n }\n\n cfg.base_path = cfg.base_path || tf.basePath + 'ezEditTable/';\n var editable = cfg.editable;\n var selectable = cfg.selection;\n\n if(selectable){\n cfg.default_selection = cfg.default_selection || 'row';\n }\n //CSS Styles\n cfg.active_cell_css = cfg.active_cell_css || 'ezETSelectedCell';\n\n var _lastValidRowIndex = 0;\n var _lastRowIndex = 0;\n\n if(selectable){\n //Row navigation needs to be calculated according to TableFilter's\n //validRowsIndex array\n var onAfterSelection = function(et, selectedElm, e){\n var slc = et.Selection;\n //Next valid filtered row needs to be selected\n var doSelect = function(nextRowIndex){\n if(et.defaultSelection === 'row'){\n slc.SelectRowByIndex(nextRowIndex);\n } else {\n et.ClearSelections();\n var cellIndex = selectedElm.cellIndex,\n row = tf.tbl.rows[nextRowIndex];\n if(et.defaultSelection === 'both'){\n slc.SelectRowByIndex(nextRowIndex);\n }\n if(row){\n slc.SelectCell(row.cells[cellIndex]);\n }\n }\n //Table is filtered\n if(tf.validRowsIndex.length !== tf.getRowsNb()){\n var r = tf.tbl.rows[nextRowIndex];\n if(r){\n r.scrollIntoView(false);\n }\n if(cell){\n if(cell.cellIndex === (tf.getCellsNb()-1) &&\n tf.gridLayout){\n tf.tblCont.scrollLeft = 100000000;\n }\n else if(cell.cellIndex===0 && tf.gridLayout){\n tf.tblCont.scrollLeft = 0;\n } else {\n cell.scrollIntoView(false);\n }\n }\n }\n };\n\n //table is not filtered\n if(!tf.validRowsIndex){\n return;\n }\n var validIndexes = tf.validRowsIndex,\n validIdxLen = validIndexes.length,\n row = et.defaultSelection !== 'row' ?\n selectedElm.parentNode : selectedElm,\n //cell for default_selection = 'both' or 'cell'\n cell = selectedElm.nodeName==='TD' ? selectedElm : null,\n keyCode = e !== undefined ? et.Event.GetKey(e) : 0,\n isRowValid = validIndexes.indexOf(row.rowIndex) !== -1,\n nextRowIndex,\n paging = tf.feature('paging'),\n //pgup/pgdown keys\n d = (keyCode === 34 || keyCode === 33 ?\n (paging && paging.pagingLength || et.nbRowsPerPage) :1);\n\n //If next row is not valid, next valid filtered row needs to be\n //calculated\n if(!isRowValid){\n //Selection direction up/down\n if(row.rowIndex>_lastRowIndex){\n //last row\n if(row.rowIndex >= validIndexes[validIdxLen-1]){\n nextRowIndex = validIndexes[validIdxLen-1];\n } else {\n var calcRowIndex = (_lastValidRowIndex + d);\n if(calcRowIndex > (validIdxLen-1)){\n nextRowIndex = validIndexes[validIdxLen-1];\n } else {\n nextRowIndex = validIndexes[calcRowIndex];\n }\n }\n } else{\n //first row\n if(row.rowIndex <= validIndexes[0]){\n nextRowIndex = validIndexes[0];\n } else {\n var v = validIndexes[_lastValidRowIndex - d];\n nextRowIndex = v ? v : validIndexes[0];\n }\n }\n _lastRowIndex = row.rowIndex;\n doSelect(nextRowIndex);\n } else {\n //If filtered row is valid, special calculation for\n //pgup/pgdown keys\n if(keyCode!==34 && keyCode!==33){\n _lastValidRowIndex = validIndexes.indexOf(row.rowIndex);\n _lastRowIndex = row.rowIndex;\n } else {\n if(keyCode === 34){ //pgdown\n //last row\n if((_lastValidRowIndex + d) <= (validIdxLen-1)){\n nextRowIndex = validIndexes[\n _lastValidRowIndex + d];\n } else {\n nextRowIndex = [validIdxLen-1];\n }\n } else { //pgup\n //first row\n if((_lastValidRowIndex - d) <= validIndexes[0]){\n nextRowIndex = validIndexes[0];\n } else {\n nextRowIndex = validIndexes[\n _lastValidRowIndex - d];\n }\n }\n _lastRowIndex = nextRowIndex;\n _lastValidRowIndex = validIndexes.indexOf(nextRowIndex);\n doSelect(nextRowIndex);\n }\n }\n };\n\n //Page navigation has to be enforced whenever selected row is out of\n //the current page range\n var onBeforeSelection = function(et, selectedElm){\n var row = et.defaultSelection !== 'row' ?\n selectedElm.parentNode : selectedElm;\n if(tf.paging){\n if(tf.feature('paging').nbPages > 1){\n var paging = tf.feature('paging');\n //page length is re-assigned in case it has changed\n et.nbRowsPerPage = paging.pagingLength;\n var validIndexes = tf.validRowsIndex,\n validIdxLen = validIndexes.length,\n pagingEndRow = parseInt(paging.startPagingRow, 10) +\n parseInt(paging.pagingLength, 10);\n var rowIndex = row.rowIndex;\n\n if((rowIndex === validIndexes[validIdxLen-1]) &&\n paging.currentPageNb!==paging.nbPages){\n paging.setPage('last');\n }\n else if((rowIndex == validIndexes[0]) &&\n paging.currentPageNb!==1){\n paging.setPage('first');\n }\n else if(rowIndex > validIndexes[pagingEndRow-1] &&\n rowIndex < validIndexes[validIdxLen-1]){\n paging.setPage('next');\n }\n else if(\n rowIndex < validIndexes[paging.startPagingRow] &&\n rowIndex > validIndexes[0]){\n paging.setPage('previous');\n }\n }\n }\n };\n\n //Selected row needs to be visible when paging is activated\n if(tf.paging){\n tf.feature('paging').onAfterChangePage = function(paging){\n var advGrid = paging.tf.extension('advancedGrid');\n var et = advGrid._ezEditTable;\n var slc = et.Selection;\n var row = slc.GetActiveRow();\n if(row){\n row.scrollIntoView(false);\n }\n var cell = slc.GetActiveCell();\n if(cell){\n cell.scrollIntoView(false);\n }\n };\n }\n\n //Rows navigation when rows are filtered is performed with the\n //EditTable row selection callback events\n if(cfg.default_selection==='row'){\n var fnB = cfg.on_before_selected_row;\n cfg.on_before_selected_row = function(){\n onBeforeSelection(arguments[0], arguments[1], arguments[2]);\n if(fnB){\n fnB.call(\n null, arguments[0], arguments[1], arguments[2]);\n }\n };\n var fnA = cfg.on_after_selected_row;\n cfg.on_after_selected_row = function(){\n onAfterSelection(arguments[0], arguments[1], arguments[2]);\n if(fnA){\n fnA.call(\n null, arguments[0], arguments[1], arguments[2]);\n }\n };\n } else {\n var fnD = cfg.on_before_selected_cell;\n cfg.on_before_selected_cell = function(){\n onBeforeSelection(arguments[0], arguments[1], arguments[2]);\n if(fnD){\n fnD.call(\n null, arguments[0], arguments[1], arguments[2]);\n }\n };\n var fnC = cfg.on_after_selected_cell;\n cfg.on_after_selected_cell = function(){\n onAfterSelection(arguments[0], arguments[1], arguments[2]);\n if(fnC){\n fnC.call(\n null, arguments[0], arguments[1], arguments[2]);\n }\n };\n }\n }\n if(editable){\n //Added or removed rows, TF rows number needs to be re-calculated\n var fnE = cfg.on_added_dom_row;\n cfg.on_added_dom_row = function(){\n tf.nbFilterableRows++;\n if(!tf.paging){\n tf.emitter.emit('rows-changed', tf, this);\n //tf.feature('rowsCounter').refresh();\n } else {\n tf.nbRows++;\n tf.nbVisibleRows++;\n tf.nbFilterableRows++;\n tf.paging=false;\n tf.feature('paging').destroy();\n tf.feature('paging').reset();\n }\n if(tf.alternateRows){\n tf.feature('alternateRows').init();\n }\n if(fnE){\n fnE.call(null, arguments[0], arguments[1], arguments[2]);\n }\n };\n if(cfg.actions && cfg.actions['delete']){\n var fnF = cfg.actions['delete'].on_after_submit;\n cfg.actions['delete'].on_after_submit = function(){\n tf.nbFilterableRows--;\n if(!tf.paging){\n // tf.feature('rowsCounter').refresh();\n tf.emitter.emit('rows-changed', tf, this);\n } else {\n tf.nbRows--;\n tf.nbVisibleRows--;\n tf.nbFilterableRows--;\n tf.paging=false;\n tf.feature('paging').destroy();\n tf.feature('paging').reset(false);\n }\n if(tf.alternateRows){\n tf.feature('alternateRows').init();\n }\n if(fnF){\n fnF.call(null, arguments[0], arguments[1]);\n }\n };\n }\n }\n\n try{\n this._ezEditTable = new EditTable(tf.id, cfg, startRow);\n this._ezEditTable.Init();\n } catch(e) { throw new Error(this.err); }\n\n this.initialized = true;\n }\n\n /**\n * Reset advanced grid when previously removed\n */\n reset(){\n var ezEditTable = this._ezEditTable;\n if(ezEditTable){\n if(this.cfg.selection){\n ezEditTable.Selection.Set();\n }\n if(this.cfg.editable){\n ezEditTable.Editable.Set();\n }\n }\n }\n\n /**\n * Toggle behaviour\n */\n toggle(){\n var ezEditTable = this._ezEditTable;\n if(ezEditTable.editable){\n ezEditTable.Editable.Remove();\n } else {\n ezEditTable.Editable.Set();\n }\n if(ezEditTable.selection){\n ezEditTable.Selection.Remove();\n } else {\n ezEditTable.Selection.Set();\n }\n }\n\n _toggleForInputFilter(){\n var tf = this.tf;\n if(!tf.activeFlt){\n return;\n }\n var colIndex = tf.activeFlt.getAttribute('ct');\n var filterType = tf.getFilterType(colIndex);\n if(filterType === tf.fltTypeInp){\n this.toggle();\n }\n }\n\n /**\n * Remove advanced grid\n */\n destroy(){\n var ezEditTable = this._ezEditTable;\n if(ezEditTable){\n if(this.cfg.selection){\n ezEditTable.Selection.ClearSelections();\n ezEditTable.Selection.Remove();\n }\n if(this.cfg.editable){\n ezEditTable.Editable.Remove();\n }\n }\n\n this.emitter.off(['filter-focus', 'filter-blur'],\n ()=> this._toggleForInputFilter());\n this.initialized = false;\n }\n}\n" }, { "kind": "class", "static": true, "variation": null, "name": "AdapterEzEditTable", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "access": null, "export": true, "importPath": "tablefilter/src/extensions/advancedGrid/adapterEzEditTable.js", "importStyle": "AdapterEzEditTable", "description": null, "lineNumber": 3, "undocument": true, "interface": false }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#constructor", "access": null, "description": "Adapter module for ezEditTable, an external library providing advanced\ngrid features (selection and edition):\nhttp://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus", "lineNumber": 11, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#initialized", "access": null, "description": null, "lineNumber": 13, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "member", "static": false, "variation": null, "name": "desc", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#desc", "access": null, "description": null, "lineNumber": 14, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "filename", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#filename", "access": null, "description": null, "lineNumber": 15, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "vendorPath", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#vendorPath", "access": null, "description": null, "lineNumber": 16, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "loadStylesheet", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#loadStylesheet", "access": null, "description": null, "lineNumber": 17, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "stylesheet", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#stylesheet", "access": null, "description": null, "lineNumber": 18, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "stylesheetName", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#stylesheetName", "access": null, "description": null, "lineNumber": 19, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "err", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#err", "access": null, "description": null, "lineNumber": 20, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "_ezEditTable", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_ezEditTable", "access": null, "description": null, "lineNumber": 26, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "cfg", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#cfg", "access": null, "description": null, "lineNumber": 27, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "tf", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#tf", "access": null, "description": null, "lineNumber": 28, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "emitter", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#emitter", "access": null, "description": null, "lineNumber": 29, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#init", "access": null, "description": "Conditionally load ezEditTable library and set advanced grid", "lineNumber": 36, "params": [], "return": { "nullable": null, "types": [ "[type]" ], "spread": false, "description": "[description]" }, "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "_setAdvancedGrid", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_setAdvancedGrid", "access": null, "description": "Instantiate ezEditTable component for advanced grid features", "lineNumber": 57, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "_ezEditTable", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_ezEditTable", "access": null, "description": null, "lineNumber": 345, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#initialized", "access": null, "description": null, "lineNumber": 349, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "reset", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#reset", "access": null, "description": "Reset advanced grid when previously removed", "lineNumber": 355, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "toggle", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#toggle", "access": null, "description": "Toggle behaviour", "lineNumber": 370, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "_toggleForInputFilter", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_toggleForInputFilter", "access": null, "description": null, "lineNumber": 384, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#destroy", "access": null, "description": "Remove advanced grid", "lineNumber": 399, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable", "longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#initialized", "access": null, "description": null, "lineNumber": 413, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "file", "static": true, "variation": null, "name": "src/extensions/advancedGrid/advancedGrid.js", "memberof": null, "longname": "src/extensions/advancedGrid/advancedGrid.js", "access": null, "description": null, "lineNumber": 1, "content": "import AdapterEzEditTable from './adapterEzEditTable';\n\nexport default AdapterEzEditTable;" }, { "kind": "file", "static": true, "variation": null, "name": "src/extensions/colOps/colOps.js", "memberof": null, "longname": "src/extensions/colOps/colOps.js", "access": null, "description": null, "lineNumber": 1, "content": "import Dom from '../../dom';\nimport Str from '../../string';\nimport Types from '../../types';\n\nexport default class ColOps{\n\n /**\n * Column calculations\n * @param {Object} tf TableFilter instance\n */\n constructor(tf, opts) {\n\n //calls function before col operation\n this.onBeforeOperation = Types.isFn(opts.on_before_operation) ?\n opts.on_before_operation : null;\n //calls function after col operation\n this.onAfterOperation = Types.isFn(opts.on_after_operation) ?\n opts.on_after_operation : null;\n\n this.opts = opts;\n this.tf = tf;\n }\n\n init(){\n // subscribe to events\n this.tf.emitter.on(['after-filtering'], ()=> this.calc());\n\n this.calc();\n }\n\n /**\n * Calculates columns' values\n * Configuration options are stored in 'opts' property\n * - 'id' contains ids of elements showing result (array)\n * - 'col' contains the columns' indexes (array)\n * - 'operation' contains operation type (array, values: 'sum', 'mean',\n * 'min', 'max', 'median', 'q1', 'q3')\n * - 'write_method' array defines which method to use for displaying the\n * result (innerHTML, setValue, createTextNode) - default: 'innerHTML'\n * - 'tot_row_index' defines in which row results are displayed\n * (integers array)\n *\n * - changes made by Nuovella:\n * (1) optimized the routine (now it will only process each column once),\n * (2) added calculations for the median, lower and upper quartile.\n */\n calc() {\n var tf = this.tf;\n if(!tf.hasGrid()){\n return;\n }\n\n if(this.onBeforeOperation){\n this.onBeforeOperation.call(null, tf);\n }\n\n var opts = this.opts,\n labelId = opts.id,\n colIndex = opts.col,\n operation = opts.operation,\n outputType = opts.write_method,\n totRowIndex = opts.tot_row_index,\n excludeRow = opts.exclude_row,\n decimalPrecision = Types.isUndef(opts.decimal_precision) ?\n 2 : opts.decimal_precision;\n\n //nuovella: determine unique list of columns to operate on\n var ucolIndex = [],\n ucolMax = 0;\n ucolIndex[ucolMax] = colIndex[0];\n\n for(var ii=1; ii maxValue ?\n parseFloat( cvalue ): maxValue;\n }\n }\n }\n }//for j\n if(meanFlag===1){\n meanValue = sumValue/nbvalues;\n }\n if(medFlag===1){\n var aux = 0;\n if(nbvalues%2 === 1){\n aux = Math.floor(nbvalues/2);\n medValue = theList[aux];\n } else{\n medValue =\n (theList[nbvalues/2] + theList[((nbvalues/2)-1)])/2;\n }\n }\n var posa;\n if(q1Flag===1){\n posa=0.0;\n posa = Math.floor(nbvalues/4);\n if(4*posa == nbvalues){\n q1Value = (theList[posa-1] + theList[posa])/2;\n } else {\n q1Value = theList[posa];\n }\n }\n if (q3Flag===1){\n posa=0.0;\n var posb=0.0;\n posa = Math.floor(nbvalues/4);\n if (4*posa === nbvalues){\n posb = 3*posa;\n q3Value = (theList[posb] + theList[posb-1])/2;\n } else {\n q3Value = theList[nbvalues-posa-1];\n }\n }\n\n for(var i=0; i<=mThisCol; i++){\n switch( opsThisCol[i] ){\n case 'mean':\n result=meanValue;\n break;\n case 'sum':\n result=sumValue;\n break;\n case 'min':\n result=minValue;\n break;\n case 'max':\n result=maxValue;\n break;\n case 'median':\n result=medValue;\n break;\n case 'q1':\n result=q1Value;\n break;\n case 'q3':\n result=q3Value;\n break;\n }\n\n var precision = !isNaN(decThisCol[i]) ? decThisCol[i] : 2;\n\n //if outputType is defined\n if(oTypeThisCol && result){\n result = result.toFixed( precision );\n\n if(Dom.id(labThisCol[i])){\n switch( Str.lower(oTypeThisCol) ){\n case 'innerhtml':\n if (isNaN(result) || !isFinite(result) ||\n nbvalues===0){\n Dom.id(labThisCol[i]).innerHTML = '.';\n } else{\n Dom.id(labThisCol[i]).innerHTML= result;\n }\n break;\n case 'setvalue':\n Dom.id( labThisCol[i] ).value = result;\n break;\n case 'createtextnode':\n var oldnode = Dom.id(labThisCol[i])\n .firstChild;\n var txtnode = Dom.text(result);\n Dom.id(labThisCol[i])\n .replaceChild(txtnode, oldnode);\n break;\n }//switch\n }\n } else {\n try{\n if(isNaN(result) || !isFinite(result) ||\n nbvalues===0){\n Dom.id(labThisCol[i]).innerHTML = '.';\n } else {\n Dom.id(labThisCol[i]).innerHTML =\n result.toFixed(precision);\n }\n } catch(e) {}//catch\n }//else\n }//for i\n\n // row(s) with result are always visible\n var totRow = totRowIndex && totRowIndex[ucol] ?\n rows[totRowIndex[ucol]] : null;\n if(totRow){\n totRow.style.display = '';\n }\n }//for ucol\n }//if typeof\n\n if(this.onAfterOperation){\n this.onAfterOperation.call(null, tf);\n }\n }\n\n destroy(){\n // unsubscribe to events\n this.tf.emitter.off(['after-filtering'], ()=> this.calc());\n }\n\n}\n" }, { "kind": "class", "static": true, "variation": null, "name": "ColOps", "memberof": "src/extensions/colOps/colOps.js", "longname": "src/extensions/colOps/colOps.js~ColOps", "access": null, "export": true, "importPath": "tablefilter/src/extensions/colOps/colOps.js", "importStyle": "ColOps", "description": null, "lineNumber": 5, "undocument": true, "interface": false }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/extensions/colOps/colOps.js~ColOps", "longname": "src/extensions/colOps/colOps.js~ColOps#constructor", "access": null, "description": "Column calculations", "lineNumber": 11, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "onBeforeOperation", "memberof": "src/extensions/colOps/colOps.js~ColOps", "longname": "src/extensions/colOps/colOps.js~ColOps#onBeforeOperation", "access": null, "description": null, "lineNumber": 14, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onAfterOperation", "memberof": "src/extensions/colOps/colOps.js~ColOps", "longname": "src/extensions/colOps/colOps.js~ColOps#onAfterOperation", "access": null, "description": null, "lineNumber": 17, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "opts", "memberof": "src/extensions/colOps/colOps.js~ColOps", "longname": "src/extensions/colOps/colOps.js~ColOps#opts", "access": null, "description": null, "lineNumber": 20, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "tf", "memberof": "src/extensions/colOps/colOps.js~ColOps", "longname": "src/extensions/colOps/colOps.js~ColOps#tf", "access": null, "description": null, "lineNumber": 21, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/extensions/colOps/colOps.js~ColOps", "longname": "src/extensions/colOps/colOps.js~ColOps#init", "access": null, "description": null, "lineNumber": 24, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "calc", "memberof": "src/extensions/colOps/colOps.js~ColOps", "longname": "src/extensions/colOps/colOps.js~ColOps#calc", "access": null, "description": "Calculates columns' values\nConfiguration options are stored in 'opts' property\n- 'id' contains ids of elements showing result (array)\n- 'col' contains the columns' indexes (array)\n- 'operation' contains operation type (array, values: 'sum', 'mean',\n 'min', 'max', 'median', 'q1', 'q3')\n- 'write_method' array defines which method to use for displaying the\n result (innerHTML, setValue, createTextNode) - default: 'innerHTML'\n- 'tot_row_index' defines in which row results are displayed\n (integers array)\n\n- changes made by Nuovella:\n(1) optimized the routine (now it will only process each column once),\n(2) added calculations for the median, lower and upper quartile.", "lineNumber": 47, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/extensions/colOps/colOps.js~ColOps", "longname": "src/extensions/colOps/colOps.js~ColOps#destroy", "access": null, "description": null, "lineNumber": 316, "undocument": true, "params": [], "generator": false }, { "kind": "file", "static": true, "variation": null, "name": "src/extensions/colsVisibility/colsVisibility.js", "memberof": null, "longname": "src/extensions/colsVisibility/colsVisibility.js", "access": null, "description": null, "lineNumber": 1, "content": "import Dom from '../../dom';\nimport Types from '../../types';\nimport Event from '../../event';\n\nexport default class ColsVisibility{\n\n /**\n * Columns Visibility extension\n * @param {Object} tf TableFilter instance\n * @param {Object} f Config\n */\n constructor(tf, f){\n\n // Configuration object\n var cfg = tf.config();\n\n this.initialized = false;\n this.name = f.name;\n this.desc = f.description || 'Columns visibility manager';\n\n //show/hide cols span element\n this.spanEl = null;\n //show/hide cols button element\n this.btnEl = null;\n //show/hide cols container div element\n this.contEl = null;\n\n //tick to hide or show column\n this.tickToHide = f.tick_to_hide===false ? false : true;\n //enables/disables cols manager generation\n this.manager = f.manager===false ? false : true;\n //only if external headers\n this.headersTbl = f.headers_table || false;\n //only if external headers\n this.headersIndex = f.headers_index || 1;\n //id of container element\n this.contElTgtId = f.container_target_id || null;\n //alternative headers text\n this.headersText = f.headers_text || null;\n //id of button container element\n this.btnTgtId = f.btn_target_id || null;\n //defines show/hide cols text\n this.btnText = f.btn_text || 'Columns▼';\n //defines show/hide cols button innerHtml\n this.btnHtml = f.btn_html || null;\n //defines css class for show/hide cols button\n this.btnCssClass = f.btn_css_class || 'colVis';\n //defines close link text\n this.btnCloseText = f.btn_close_text || 'Close';\n //defines close button innerHtml\n this.btnCloseHtml = f.btn_close_html || null;\n //defines css class for close button\n this.btnCloseCssClass = f.btn_close_css_class || this.btnCssClass;\n this.stylesheet = f.stylesheet || 'colsVisibility.css';\n //span containing show/hide cols button\n this.prfx = 'colVis_';\n //defines css class span containing show/hide cols\n this.spanCssClass = f.span_css_class || 'colVisSpan';\n this.prfxCont = this.prfx + 'Cont_';\n //defines css class div containing show/hide cols\n this.contCssClass = f.cont_css_class || 'colVisCont';\n //defines css class for cols list (ul)\n this.listCssClass = cfg.list_css_class ||'cols_checklist';\n //defines css class for list item (li)\n this.listItemCssClass = cfg.checklist_item_css_class ||\n 'cols_checklist_item';\n //defines css class for selected list item (li)\n this.listSlcItemCssClass = cfg.checklist_selected_item_css_class ||\n 'cols_checklist_slc_item';\n //text preceding columns list\n this.text = f.text || (this.tickToHide ? 'Hide: ' : 'Show: ');\n this.atStart = f.at_start || null;\n this.enableHover = Boolean(f.enable_hover);\n //enables select all option\n this.enableTickAll = Boolean(f.enable_tick_all);\n //text preceding columns list\n this.tickAllText = f.tick_all_text || 'Select all:';\n\n //array containing hidden columns indexes\n this.hiddenCols = [];\n this.tblHasColTag = (Dom.tag(tf.tbl,'col').length > 0);\n\n //callback invoked just after cols manager is loaded\n this.onLoaded = Types.isFn(f.on_loaded) ? f.on_loaded : null;\n //calls function before cols manager is opened\n this.onBeforeOpen = Types.isFn(f.on_before_open) ?\n f.on_before_open : null;\n //calls function after cols manager is opened\n this.onAfterOpen = Types.isFn(f.on_after_open) ? f.on_after_open : null;\n //calls function before cols manager is closed\n this.onBeforeClose = Types.isFn(f.on_before_close) ?\n f.on_before_close : null;\n //calls function after cols manager is closed\n this.onAfterClose = Types.isFn(f.on_after_close) ?\n f.on_after_close : null;\n\n //callback before col is hidden\n this.onBeforeColHidden = Types.isFn(f.on_before_col_hidden) ?\n f.on_before_col_hidden : null;\n //callback after col is hidden\n this.onAfterColHidden = Types.isFn(f.on_after_col_hidden) ?\n f.on_after_col_hidden : null;\n //callback before col is displayed\n this.onBeforeColDisplayed = Types.isFn(f.on_before_col_displayed) ?\n f.on_before_col_displayed : null;\n //callback after col is displayed\n this.onAfterColDisplayed = Types.isFn(f.on_after_col_displayed) ?\n f.on_after_col_displayed : null;\n\n //Grid layout compatibility\n if(tf.gridLayout){\n this.headersTbl = tf.feature('gridLayout').headTbl; //headers table\n this.headersIndex = 0; //headers index\n this.onAfterColDisplayed = function(){};\n this.onAfterColHidden = function(){};\n }\n\n //Loads extension stylesheet\n tf.import(f.name+'Style', tf.stylePath + this.stylesheet, null, 'link');\n\n this.tf = tf;\n }\n\n toggle(){\n var contDisplay = this.contEl.style.display;\n var onBeforeOpen = this.onBeforeOpen;\n var onBeforeClose = this.onBeforeClose;\n var onAfterOpen = this.onAfterOpen;\n var onAfterClose = this.onAfterClose;\n\n if(onBeforeOpen && contDisplay !== 'inline'){\n onBeforeOpen.call(null, this);\n }\n if(onBeforeClose && contDisplay === 'inline'){\n onBeforeClose.call(null, this);\n }\n\n this.contEl.style.display = contDisplay === 'inline' ?\n 'none' : 'inline';\n\n if(onAfterOpen && contDisplay !== 'inline'){\n onAfterOpen.call(null, this);\n }\n if(onAfterClose && contDisplay === 'inline'){\n onAfterClose.call(null, this);\n }\n }\n\n checkItem(lbl){\n var li = lbl.parentNode;\n if(!li || !lbl){\n return;\n }\n var isChecked = lbl.firstChild.checked;\n var colIndex = lbl.firstChild.getAttribute('id').split('_')[1];\n colIndex = parseInt(colIndex, 10);\n if(isChecked){\n Dom.addClass(li, this.listSlcItemCssClass);\n } else {\n Dom.removeClass(li, this.listSlcItemCssClass);\n }\n\n var hide = false;\n if((this.tickToHide && isChecked) || (!this.tickToHide && !isChecked)){\n hide = true;\n }\n this.setHidden(colIndex, hide);\n }\n\n init(){\n if(!this.manager){\n return;\n }\n this.buildBtn();\n this.buildManager();\n\n this.initialized = true;\n }\n\n /**\n * Build main button UI\n */\n buildBtn(){\n if(this.btnEl){\n return;\n }\n var tf = this.tf;\n var span = Dom.create('span', ['id', this.prfx+tf.id]);\n span.className = this.spanCssClass;\n\n //Container element (rdiv or custom element)\n if(!this.btnTgtId){\n tf.setToolbar();\n }\n var targetEl = !this.btnTgtId ? tf.rDiv : Dom.id(this.btnTgtId);\n\n if(!this.btnTgtId){\n var firstChild = targetEl.firstChild;\n firstChild.parentNode.insertBefore(span, firstChild);\n } else {\n targetEl.appendChild(span);\n }\n\n if(!this.btnHtml){\n var btn = Dom.create('a', ['href','javascript:;']);\n btn.className = this.btnCssClass;\n btn.title = this.desc;\n\n btn.innerHTML = this.btnText;\n span.appendChild(btn);\n if(!this.enableHover){\n Event.add(btn, 'click', (evt)=> { this.toggle(evt); });\n } else {\n Event.add(btn, 'mouseover', (evt)=> { this.toggle(evt); });\n }\n } else { //Custom html\n span.innerHTML = this.btnHtml;\n var colVisEl = span.firstChild;\n if(!this.enableHover){\n Event.add(colVisEl, 'click', (evt)=> { this.toggle(evt); });\n } else {\n Event.add(colVisEl, 'mouseover', (evt)=> { this.toggle(evt); });\n }\n }\n\n this.spanEl = span;\n this.btnEl = this.spanEl.firstChild;\n\n if(this.onLoaded){\n this.onLoaded.call(null, this);\n }\n }\n\n /**\n * Build columns manager UI\n */\n buildManager(){\n var tf = this.tf;\n\n var container = !this.contElTgtId ?\n Dom.create('div', ['id', this.prfxCont+tf.id]) :\n Dom.id(this.contElTgtId);\n container.className = this.contCssClass;\n\n //Extension description\n var extNameLabel = Dom.create('p');\n extNameLabel.innerHTML = this.text;\n container.appendChild(extNameLabel);\n\n //Headers list\n var ul = Dom.create('ul' ,['id', 'ul'+this.name+'_'+tf.id]);\n ul.className = this.listCssClass;\n\n var tbl = this.headersTbl ? this.headersTbl : tf.tbl;\n var headerIndex = this.headersTbl ?\n this.headersIndex : tf.getHeadersRowIndex();\n var headerRow = tbl.rows[headerIndex];\n\n //Tick all option\n if(this.enableTickAll){\n var li = Dom.createCheckItem(\n 'col__'+tf.id, this.tickAllText, this.tickAllText);\n Dom.addClass(li, this.listItemCssClass);\n ul.appendChild(li);\n li.check.checked = !this.tickToHide;\n\n Event.add(li.check, 'click', ()=> {\n for(var h = 0; h < headerRow.cells.length; h++){\n var itm = Dom.id('col_'+h+'_'+tf.id);\n if(itm && li.check.checked !== itm.checked){\n itm.click();\n itm.checked = li.check.checked;\n }\n }\n });\n }\n\n for(var i = 0; i < headerRow.cells.length; i++){\n var cell = headerRow.cells[i];\n var cellText = this.headersText && this.headersText[i] ?\n this.headersText[i] : this._getHeaderText(cell);\n var liElm = Dom.createCheckItem(\n 'col_'+i+'_'+tf.id, cellText, cellText);\n Dom.addClass(liElm, this.listItemCssClass);\n if(!this.tickToHide){\n Dom.addClass(liElm, this.listSlcItemCssClass);\n }\n ul.appendChild(liElm);\n if(!this.tickToHide){\n liElm.check.checked = true;\n }\n\n Event.add(liElm.check, 'click', (evt)=> {\n var elm = Event.target(evt);\n var lbl = elm.parentNode;\n this.checkItem(lbl);\n });\n }\n\n //separator\n var p = Dom.create('p', ['align','center']);\n var btn;\n //Close link\n if(!this.btnCloseHtml){\n btn = Dom.create('a', ['href','javascript:;']);\n btn.className = this.btnCloseCssClass;\n btn.innerHTML = this.btnCloseText;\n Event.add(btn, 'click', (evt)=> { this.toggle(evt); });\n p.appendChild(btn);\n } else {\n p.innerHTML = this.btnCloseHtml;\n btn = p.firstChild;\n Event.add(btn, 'click', (evt)=> { this.toggle(evt); });\n }\n\n container.appendChild(ul);\n container.appendChild(p);\n\n this.btnEl.parentNode.insertBefore(container, this.btnEl);\n this.contEl = container;\n\n if(this.atStart){\n var a = this.atStart;\n for(var k=0; k';\n this.icnCollapseHtml = '\"Collapse';\n this.defaultText = 'Toggle filters';\n\n //id of container element\n this.targetId = f.target_id || null;\n //enables/disables expand/collapse icon\n this.enableIcon = f.enable_icon===false ? false : true;\n this.btnText = f.btn_text || '';\n\n //defines expand/collapse filters text\n this.collapseBtnHtml = this.enableIcon ?\n this.icnCollapseHtml + this.btnText :\n this.btnText || this.defaultText;\n this.expandBtnHtml = this.enableIcon ?\n this.icnExpandHtml + this.btnText :\n this.btnText || this.defaultText;\n\n //defines expand/collapse filters button innerHtml\n this.btnHtml = f.btn_html || null;\n //defines css class for expand/collapse filters button\n this.btnCssClass = f.btn_css_class || 'btnExpClpFlt';\n //defines css class span containing expand/collapse filters\n this.contCssClass = f.cont_css_class || 'expClpFlt';\n this.filtersRowIndex = !Types.isUndef(f.filters_row_index) ?\n f.filters_row_index : tf.getFiltersRowIndex();\n\n this.visibleAtStart = !Types.isUndef(f.visible_at_start) ?\n Boolean(f.visible_at_start) : true;\n\n // Prefix\n this.prfx = 'fltsVis_';\n\n //callback before filters row is shown\n this.onBeforeShow = Types.isFn(f.on_before_show) ?\n f.on_before_show : null;\n //callback after filters row is shown\n this.onAfterShow = Types.isFn(f.on_after_show) ?\n f.on_after_show : null;\n //callback before filters row is hidden\n this.onBeforeHide = Types.isFn(f.on_before_hide) ?\n f.on_before_hide : null;\n //callback after filters row is hidden\n this.onAfterHide = Types.isFn(f.on_after_hide) ? f.on_after_hide : null;\n\n //Loads extension stylesheet\n tf.import(f.name+'Style', tf.stylePath + this.stylesheet, null, 'link');\n\n this.tf = tf;\n }\n\n /**\n * Initialise extension\n */\n init(){\n if(this.initialized){\n return;\n }\n\n this.buildUI();\n this.initialized = true;\n }\n\n /**\n * Build UI elements\n */\n buildUI(){\n let tf = this.tf;\n let span = Dom.create('span',['id', this.prfx+tf.id]);\n span.className = this.contCssClass;\n\n //Container element (rdiv or custom element)\n if(!this.targetId){\n tf.setToolbar();\n }\n let targetEl = !this.targetId ? tf.rDiv : Dom.id(this.targetId);\n\n if(!this.targetId){\n let firstChild = targetEl.firstChild;\n firstChild.parentNode.insertBefore(span, firstChild);\n } else {\n targetEl.appendChild(span);\n }\n\n let btn;\n if(!this.btnHtml){\n btn = Dom.create('a', ['href', 'javascript:void(0);']);\n btn.className = this.btnCssClass;\n btn.title = this.btnText || this.defaultText;\n btn.innerHTML = this.collapseBtnHtml;\n span.appendChild(btn);\n } else { //Custom html\n span.innerHTML = this.btnHtml;\n btn = span.firstChild;\n }\n\n Event.add(btn, 'click', ()=> this.toggle());\n\n this.contEl = span;\n this.btnEl = btn;\n\n if(!this.visibleAtStart){\n this.toggle();\n }\n }\n\n /**\n * Toggle filters visibility\n */\n toggle(){\n let tf = this.tf;\n let tbl = tf.gridLayout? tf.feature('gridLayout').headTbl : tf.tbl;\n let fltRow = tbl.rows[this.filtersRowIndex];\n let fltRowDisplay = fltRow.style.display;\n\n if(this.onBeforeShow && fltRowDisplay !== ''){\n this.onBeforeShow.call(this, this);\n }\n if(this.onBeforeHide && fltRowDisplay === ''){\n this.onBeforeHide.call(null, this);\n }\n\n fltRow.style.display = fltRowDisplay==='' ? 'none' : '';\n if(this.enableIcon && !this.btnHtml){\n this.btnEl.innerHTML = fltRowDisplay === '' ?\n this.expandBtnHtml : this.collapseBtnHtml;\n }\n\n if(this.onAfterShow && fltRowDisplay !== ''){\n this.onAfterShow.call(null, this);\n }\n if(this.onAfterHide && fltRowDisplay === ''){\n this.onAfterHide.call(null, this);\n }\n }\n\n /**\n * Destroy the UI\n */\n destroy(){\n if(!this.btnEl && !this.contEl){\n return;\n }\n\n this.btnEl.innerHTML = '';\n Dom.remove(this.btnEl);\n this.btnEl = null;\n\n this.contEl.innerHTML = '';\n Dom.remove(this.contEl);\n this.contEl = null;\n this.initialized = false;\n }\n\n}\n" }, { "kind": "class", "static": true, "variation": null, "name": "FiltersVisibility", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "access": null, "export": true, "importPath": "tablefilter/src/extensions/filtersVisibility/filtersVisibility.js", "importStyle": "FiltersVisibility", "description": null, "lineNumber": 5, "undocument": true, "interface": false }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#constructor", "access": null, "description": "Filters Row Visibility extension", "lineNumber": 12, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "f", "description": "Config" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#initialized", "access": null, "description": null, "lineNumber": 14, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "member", "static": false, "variation": null, "name": "name", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#name", "access": null, "description": null, "lineNumber": 15, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "desc", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#desc", "access": null, "description": null, "lineNumber": 16, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "stylesheet", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#stylesheet", "access": null, "description": null, "lineNumber": 19, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "icnExpand", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpand", "access": null, "description": null, "lineNumber": 20, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "icnCollapse", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapse", "access": null, "description": null, "lineNumber": 21, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "contEl", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contEl", "access": null, "description": null, "lineNumber": 24, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnEl", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl", "access": null, "description": null, "lineNumber": 26, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "icnExpandHtml", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpandHtml", "access": null, "description": null, "lineNumber": 28, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "icnCollapseHtml", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapseHtml", "access": null, "description": null, "lineNumber": 30, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "defaultText", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#defaultText", "access": null, "description": null, "lineNumber": 32, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "member", "static": false, "variation": null, "name": "targetId", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#targetId", "access": null, "description": null, "lineNumber": 35, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "enableIcon", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#enableIcon", "access": null, "description": null, "lineNumber": 37, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnText", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnText", "access": null, "description": null, "lineNumber": 38, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "collapseBtnHtml", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#collapseBtnHtml", "access": null, "description": null, "lineNumber": 41, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "expandBtnHtml", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#expandBtnHtml", "access": null, "description": null, "lineNumber": 44, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnHtml", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnHtml", "access": null, "description": null, "lineNumber": 49, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnCssClass", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnCssClass", "access": null, "description": null, "lineNumber": 51, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "contCssClass", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contCssClass", "access": null, "description": null, "lineNumber": 53, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "filtersRowIndex", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#filtersRowIndex", "access": null, "description": null, "lineNumber": 54, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "visibleAtStart", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#visibleAtStart", "access": null, "description": null, "lineNumber": 57, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "prfx", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#prfx", "access": null, "description": null, "lineNumber": 61, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onBeforeShow", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onBeforeShow", "access": null, "description": null, "lineNumber": 64, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onAfterShow", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onAfterShow", "access": null, "description": null, "lineNumber": 67, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onBeforeHide", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onBeforeHide", "access": null, "description": null, "lineNumber": 70, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onAfterHide", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onAfterHide", "access": null, "description": null, "lineNumber": 73, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "tf", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#tf", "access": null, "description": null, "lineNumber": 78, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#init", "access": null, "description": "Initialise extension", "lineNumber": 84, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#initialized", "access": null, "description": null, "lineNumber": 90, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "buildUI", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#buildUI", "access": null, "description": "Build UI elements", "lineNumber": 96, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "contEl", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contEl", "access": null, "description": null, "lineNumber": 128, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnEl", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl", "access": null, "description": null, "lineNumber": 129, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "toggle", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#toggle", "access": null, "description": "Toggle filters visibility", "lineNumber": 139, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#destroy", "access": null, "description": "Destroy the UI", "lineNumber": 169, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "btnEl", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl", "access": null, "description": null, "lineNumber": 176, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "contEl", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contEl", "access": null, "description": null, "lineNumber": 180, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility", "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#initialized", "access": null, "description": null, "lineNumber": 181, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "file", "static": true, "variation": null, "name": "src/extensions/sort/adapterSortabletable.js", "memberof": null, "longname": "src/extensions/sort/adapterSortabletable.js", "access": null, "description": null, "lineNumber": 1, "content": "import Types from '../../types';\nimport Dom from '../../dom';\nimport Event from '../../event';\nimport DateHelper from '../../date';\nimport Helpers from '../../helpers';\n\nexport default class AdapterSortableTable{\n\n /**\n * SortableTable Adapter module\n * @param {Object} tf TableFilter instance\n */\n constructor(tf, opts){\n this.initialized = false;\n this.name = opts.name;\n this.desc = opts.description || 'Sortable table';\n\n //indicates if tables was sorted\n this.sorted = false;\n\n this.sortTypes = Types.isArray(opts.types) ? opts.types : [];\n this.sortColAtStart = Types.isArray(opts.sort_col_at_start) ?\n opts.sort_col_at_start : null;\n this.asyncSort = Boolean(opts.async_sort);\n this.triggerIds = Types.isArray(opts.trigger_ids) ?\n opts.trigger_ids : [];\n\n // edit .sort-arrow.descending / .sort-arrow.ascending in\n // tablefilter.css to reflect any path change\n this.imgPath = opts.images_path || tf.themesPath;\n this.imgBlank = opts.image_blank || 'blank.png';\n this.imgClassName = opts.image_class_name || 'sort-arrow';\n this.imgAscClassName = opts.image_asc_class_name || 'ascending';\n this.imgDescClassName = opts.image_desc_class_name ||'descending';\n //cell attribute storing custom key\n this.customKey = opts.custom_key || 'data-tf-sortKey';\n\n // callback invoked after sort is loaded and instanciated\n this.onSortLoaded = Types.isFn(opts.on_sort_loaded) ?\n opts.on_sort_loaded : null;\n // callback invoked before table is sorted\n this.onBeforeSort = Types.isFn(opts.on_before_sort) ?\n opts.on_before_sort : null;\n // callback invoked after table is sorted\n this.onAfterSort = Types.isFn(opts.on_after_sort) ?\n opts.on_after_sort : null;\n\n this.tf = tf;\n this.emitter = tf.emitter;\n }\n\n init(){\n let tf = this.tf;\n let adpt = this;\n\n // SortableTable class sanity check (sortabletable.js)\n if(Types.isUndef(SortableTable)){\n throw new Error('SortableTable class not found.');\n }\n\n this.overrideSortableTable();\n this.setSortTypes();\n\n //Column sort at start\n let sortColAtStart = adpt.sortColAtStart;\n if(sortColAtStart){\n this.stt.sort(sortColAtStart[0], sortColAtStart[1]);\n }\n\n if(this.onSortLoaded){\n this.onSortLoaded.call(null, tf, this);\n }\n\n /*** SortableTable callbacks ***/\n this.stt.onbeforesort = function(){\n if(adpt.onBeforeSort){\n adpt.onBeforeSort.call(null, tf, adpt.stt.sortColumn);\n }\n\n /*** sort behaviour for paging ***/\n if(tf.paging){\n tf.feature('paging').disable();\n }\n };\n\n this.stt.onsort = function(){\n adpt.sorted = true;\n\n //sort behaviour for paging\n if(tf.paging){\n let paginator = tf.feature('paging');\n // recalculate valid rows index as sorting may have change it\n tf.getValidRows(true);\n paginator.enable();\n paginator.setPage(paginator.getPage());\n }\n\n if(adpt.onAfterSort){\n adpt.onAfterSort.call(null, tf, adpt.stt.sortColumn);\n }\n\n adpt.emitter.emit('column-sorted', tf, adpt.stt.sortColumn);\n };\n\n this.initialized = true;\n }\n\n /**\n * Sort specified column\n * @param {Number} colIdx Column index\n * @param {Boolean} desc Optional: descending manner\n */\n sortByColumnIndex(colIdx, desc){\n this.stt.sort(colIdx, desc);\n }\n\n overrideSortableTable(){\n let adpt = this,\n tf = this.tf;\n\n /**\n * Overrides headerOnclick method in order to handle th event\n * @param {Object} e [description]\n */\n SortableTable.prototype.headerOnclick = function(evt){\n if(!adpt.initialized){\n return;\n }\n\n // find Header element\n let el = evt.target || evt.srcElement;\n\n while(el.tagName !== 'TD' && el.tagName !== 'TH'){\n el = el.parentNode;\n }\n\n this.sort(\n SortableTable.msie ?\n SortableTable.getCellIndex(el) : el.cellIndex\n );\n };\n\n /**\n * Overrides getCellIndex IE returns wrong cellIndex when columns are\n * hidden\n * @param {Object} oTd TD element\n * @return {Number} Cell index\n */\n SortableTable.getCellIndex = function(oTd){\n let cells = oTd.parentNode.cells,\n l = cells.length, i;\n for (i = 0; cells[i] != oTd && i < l; i++){}\n return i;\n };\n\n /**\n * Overrides initHeader in order to handle filters row position\n * @param {Array} oSortTypes\n */\n SortableTable.prototype.initHeader = function(oSortTypes){\n let stt = this;\n if (!stt.tHead){\n if(tf.gridLayout){\n stt.tHead = tf.feature('gridLayout').headTbl.tHead;\n } else {\n return;\n }\n }\n\n stt.headersRow = tf.headersRow;\n let cells = stt.tHead.rows[stt.headersRow].cells;\n stt.sortTypes = oSortTypes || [];\n let l = cells.length;\n let img, c;\n\n for (let i = 0; i < l; i++) {\n c = cells[i];\n if (stt.sortTypes[i] !== null && stt.sortTypes[i] !== 'None'){\n c.style.cursor = 'pointer';\n img = Dom.create('img',\n ['src', adpt.imgPath + adpt.imgBlank]);\n c.appendChild(img);\n if (stt.sortTypes[i] !== null){\n c.setAttribute( '_sortType', stt.sortTypes[i]);\n }\n Event.add(c, 'click', stt._headerOnclick);\n } else {\n c.setAttribute('_sortType', oSortTypes[i]);\n c._sortType = 'None';\n }\n }\n stt.updateHeaderArrows();\n };\n\n /**\n * Overrides updateHeaderArrows in order to handle arrows indicators\n */\n SortableTable.prototype.updateHeaderArrows = function(){\n let stt = this;\n let cells, l, img;\n\n // external headers\n if(adpt.asyncSort && adpt.triggerIds.length > 0){\n let triggers = adpt.triggerIds;\n cells = [];\n l = triggers.length;\n for(let j=0; j 0){\n let triggers = this.triggerIds;\n for(let j=0; j {\n let elm = evt.target;\n if(!this.tf.sort){\n return;\n }\n this.stt.asyncSort(triggers.indexOf(elm.id));\n });\n trigger.setAttribute('_sortType', _sortTypes[j]);\n }\n }\n }\n }\n\n /**\n * Destroy sort\n */\n destroy(){\n let tf = this.tf;\n this.sorted = false;\n this.initialized = false;\n this.stt.destroy();\n\n let ids = tf.getFiltersId();\n for (let idx = 0; idx < ids.length; idx++){\n let header = tf.getHeaderElement(idx);\n let img = Dom.tag(header, 'img');\n\n if(img.length === 1){\n header.removeChild(img[0]);\n }\n }\n }\n\n}\n\n//Converters\nfunction usNumberConverter(s){\n return Helpers.removeNbFormat(s, 'us');\n}\nfunction euNumberConverter(s){\n return Helpers.removeNbFormat(s, 'eu');\n}\nfunction dateConverter(s, format){\n return DateHelper.format(s, format);\n}\nfunction dmyDateConverter(s){\n return dateConverter(s, 'DMY');\n}\nfunction mdyDateConverter(s){\n return dateConverter(s, 'MDY');\n}\nfunction ymdDateConverter(s){\n return dateConverter(s, 'YMD');\n}\nfunction ddmmmyyyyDateConverter(s){\n return dateConverter(s, 'DDMMMYYYY');\n}\n\nfunction ipAddress(value){\n let vals = value.split('.');\n for (let x in vals) {\n let val = vals[x];\n while (3 > val.length){\n val = '0'+val;\n }\n vals[x] = val;\n }\n return vals.join('.');\n}\n\nfunction sortIP(a,b){\n let aa = ipAddress(a.value.toLowerCase());\n let bb = ipAddress(b.value.toLowerCase());\n if (aa==bb){\n return 0;\n } else if (aa\n this.processRow(rowIndex, arrIndex, isValid));\n this.emitter.on(['column-sorted'], ()=> this.processAll());\n\n this.initialized = true;\n }\n\n processAll() {\n if(!this.isEnabled()){\n return;\n }\n var tf = this.tf;\n var validRowsIndex = tf.getValidRows(true);\n var noValidRowsIndex = validRowsIndex.length === 0;\n //1st index\n var beginIndex = noValidRowsIndex ? tf.refRow : 0;\n // nb indexes\n var indexLen = noValidRowsIndex ?\n tf.nbFilterableRows+beginIndex :\n validRowsIndex.length;\n var idx = 0;\n\n //alternates bg color\n for(var j=beginIndex; j\n this.processRow(rowIndex, arrIndex, isValid));\n this.emitter.off(['column-sorted'], ()=> this.processAll());\n\n this.initialized = false;\n }\n\n}\n" }, { "kind": "class", "static": true, "variation": null, "name": "AlternateRows", "memberof": "src/modules/alternateRows.js", "longname": "src/modules/alternateRows.js~AlternateRows", "access": null, "export": true, "importPath": "tablefilter/src/modules/alternateRows.js", "importStyle": "{AlternateRows}", "description": null, "lineNumber": 4, "undocument": true, "interface": false, "extends": [ "src/modules/feature~Feature" ] }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#constructor", "access": null, "description": "Alternating rows color", "lineNumber": 10, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "evenCss", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#evenCss", "access": null, "description": null, "lineNumber": 15, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "oddCss", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#oddCss", "access": null, "description": null, "lineNumber": 17, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#init", "access": null, "description": "Sets alternating rows color", "lineNumber": 23, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#initialized", "access": null, "description": null, "lineNumber": 36, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "processAll", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#processAll", "access": null, "description": null, "lineNumber": 39, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "processRow", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#processRow", "access": null, "description": "Set/remove row background based on row validation", "lineNumber": 67, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "rowIdx", "description": "Row index" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "isValid", "description": "Valid row flag" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "setRowBg", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#setRowBg", "access": null, "description": "Sets row background color", "lineNumber": 81, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "rowIdx", "description": "Row index" }, { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "idx", "description": "Valid rows collection index needed to calculate bg\ncolor" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "removeRowBg", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#removeRowBg", "access": null, "description": "Removes row background color", "lineNumber": 99, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "idx", "description": "Row index" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#destroy", "access": null, "description": "Removes all alternating backgrounds", "lineNumber": 111, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/alternateRows.js~AlternateRows", "longname": "src/modules/alternateRows.js~AlternateRows#initialized", "access": null, "description": null, "lineNumber": 125, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "file", "static": true, "variation": null, "name": "src/modules/checkList.js", "memberof": null, "longname": "src/modules/checkList.js", "access": null, "description": null, "lineNumber": 1, "content": "import {Feature} from './feature';\nimport Dom from '../dom';\nimport Arr from '../array';\nimport Str from '../string';\nimport Sort from '../sort';\nimport Event from '../event';\n\nconst SORT_ERROR = 'Filter options for column {0} cannot be sorted in ' +\n '{1} manner.';\n\nexport class CheckList extends Feature{\n\n /**\n * Checklist UI component\n * @param {Object} tf TableFilter instance\n */\n constructor(tf){\n super(tf, 'checkList');\n\n // Configuration object\n let f = tf.config();\n\n this.checkListDiv = []; //checklist container div\n //defines css class for div containing checklist filter\n this.checkListDivCssClass = f.div_checklist_css_class ||\n 'div_checklist';\n //defines css class for checklist filters\n this.checkListCssClass = f.checklist_css_class || 'flt_checklist';\n //defines css class for checklist item (li)\n this.checkListItemCssClass = f.checklist_item_css_class ||\n 'flt_checklist_item';\n //defines css class for selected checklist item (li)\n this.checkListSlcItemCssClass = f.checklist_selected_item_css_class ||\n 'flt_checklist_slc_item';\n //Load on demand text\n this.activateCheckListTxt = f.activate_checklist_text ||\n 'Click to load filter data';\n //defines css class for checklist filters\n this.checkListItemDisabledCssClass =\n f.checklist_item_disabled_css_class ||\n 'flt_checklist_item_disabled';\n this.enableCheckListResetFilter =\n f.enable_checklist_reset_filter===false ? false : true;\n //checklist filter container div\n this.prfxCheckListDiv = 'chkdiv_';\n\n this.isCustom = null;\n this.opts = null;\n this.optsTxt = null;\n this.excludedOpts = null;\n }\n\n onChange(evt){\n let elm = evt.target;\n let tf = this.tf;\n tf.activeFilterId = elm.getAttribute('id');\n tf.activeFlt = Dom.id(tf.activeFilterId);\n tf.filter();\n }\n\n optionClick(evt){\n this.setCheckListValues(evt.target);\n this.onChange(evt);\n }\n\n onCheckListClick(evt){\n let elm = Event.target(evt);\n if(this.tf.loadFltOnDemand && elm.getAttribute('filled') === '0'){\n let ct = elm.getAttribute('ct');\n let div = this.checkListDiv[ct];\n this.build(ct);\n Event.remove(div, 'click', (evt)=> this.onCheckListClick(evt));\n }\n }\n\n /**\n * Initialize checklist filter\n * @param {Number} colIndex Column index\n * @param {Boolean} isExternal External filter flag\n * @param {DOMElement} container Dom element containing the filter\n */\n init(colIndex, isExternal, container){\n let tf = this.tf;\n let externalFltTgtId = isExternal ?\n tf.externalFltTgtIds[colIndex] : null;\n\n let divCont = Dom.create('div',\n ['id', this.prfxCheckListDiv+colIndex+'_'+tf.id],\n ['ct', colIndex], ['filled', '0']);\n divCont.className = this.checkListDivCssClass;\n\n //filter is appended in desired element\n if(externalFltTgtId){\n Dom.id(externalFltTgtId).appendChild(divCont);\n tf.externalFltEls.push(divCont);\n } else {\n container.appendChild(divCont);\n }\n\n this.checkListDiv[colIndex] = divCont;\n tf.fltIds.push(tf.prfxFlt+colIndex+'_'+tf.id);\n\n if(!tf.loadFltOnDemand){\n this.build(colIndex);\n } else {\n Event.add(divCont, 'click', (evt)=> this.onCheckListClick(evt));\n divCont.appendChild(Dom.text(this.activateCheckListTxt));\n }\n\n this.emitter.on(\n ['build-checklist-filter'],\n (tf, colIndex, isExternal)=> this.build(colIndex, isExternal)\n );\n\n this.emitter.on(\n ['select-checklist-options'],\n (tf, colIndex, values)=> this.selectOptions(colIndex, values)\n );\n\n this.initialized = true;\n }\n\n /**\n * Build checklist UI\n * @param {Number} colIndex Column index\n * @param {Boolean} isExternal Render in external container\n * @param {String} extFltId External container id\n */\n build(colIndex, isExternal=false, extFltId=null){\n let tf = this.tf;\n colIndex = parseInt(colIndex, 10);\n\n this.emitter.emit('before-populating-filter', tf, colIndex);\n\n this.opts = [];\n this.optsTxt = [];\n\n let divFltId = this.prfxCheckListDiv+colIndex+'_'+tf.id;\n if((!Dom.id(divFltId) && !isExternal) ||\n (!Dom.id(extFltId) && isExternal)){\n return;\n }\n\n let flt = !isExternal ? this.checkListDiv[colIndex] : Dom.id(extFltId);\n let ul = Dom.create(\n 'ul', ['id', tf.fltIds[colIndex]], ['colIndex', colIndex]);\n ul.className = this.checkListCssClass;\n Event.add(ul, 'change', (evt)=> this.onChange(evt));\n\n let rows = tf.tbl.rows;\n this.isCustom = tf.isCustomOptions(colIndex);\n\n let activeFlt;\n if(tf.linkedFilters && tf.activeFilterId){\n activeFlt = tf.activeFilterId.split('_')[0];\n activeFlt = activeFlt.split(tf.prfxFlt)[1];\n }\n\n let filteredDataCol = [];\n if(tf.linkedFilters && tf.disableExcludedOptions){\n this.excludedOpts = [];\n }\n\n for(let k=tf.refRow; k this.optionClick(evt));\n }\n ul.appendChild(li);\n\n if(val === ''){\n //item is hidden\n li.style.display = 'none';\n }\n }\n }\n\n /**\n * Add checklist header option\n * @param {Number} colIndex Column index\n * @param {Object} ul Ul element\n */\n addTChecks(colIndex, ul){\n let tf = this.tf;\n let chkCt = 1;\n let li0 = Dom.createCheckItem(\n tf.fltIds[colIndex]+'_0', '', tf.displayAllText);\n li0.className = this.checkListItemCssClass;\n ul.appendChild(li0);\n\n Event.add(li0.check, 'click', (evt)=> this.optionClick(evt));\n\n if(!this.enableCheckListResetFilter){\n li0.style.display = 'none';\n }\n\n if(tf.enableEmptyOption){\n let li1 = Dom.createCheckItem(\n tf.fltIds[colIndex]+'_1', tf.emOperator, tf.emptyText);\n li1.className = this.checkListItemCssClass;\n ul.appendChild(li1);\n Event.add(li1.check, 'click', (evt)=> this.optionClick(evt));\n chkCt++;\n }\n\n if(tf.enableNonEmptyOption){\n let li2 = Dom.createCheckItem(\n tf.fltIds[colIndex]+'_2',\n tf.nmOperator,\n tf.nonEmptyText\n );\n li2.className = this.checkListItemCssClass;\n ul.appendChild(li2);\n Event.add(li2.check, 'click', (evt)=> this.optionClick(evt));\n chkCt++;\n }\n return chkCt;\n }\n\n /**\n * Store checked options in DOM element attribute\n * @param {Object} o checklist option DOM element\n */\n setCheckListValues(o){\n if(!o){\n return;\n }\n let tf = this.tf;\n let chkValue = o.value; //checked item value\n let chkIndex = parseInt(o.id.split('_')[2], 10);\n let filterTag = 'ul', itemTag = 'li';\n let n = o;\n\n //ul tag search\n while(Str.lower(n.nodeName)!==filterTag){\n n = n.parentNode;\n }\n\n let li = n.childNodes[chkIndex];\n let colIndex = n.getAttribute('colIndex');\n let fltValue = n.getAttribute('value'); //filter value (ul tag)\n let fltIndexes = n.getAttribute('indexes'); //selected items (ul tag)\n\n if(o.checked){\n //show all item\n if(chkValue===''){\n if((fltIndexes && fltIndexes!=='')){\n //items indexes\n let indSplit = fltIndexes.split(tf.separator);\n //checked items loop\n for(let u=0; u this.build(colIndex, isExternal)\n );\n this.emitter.off(\n ['select-checklist-options'],\n (tf, colIndex, values)=> this.selectOptions(colIndex, values)\n );\n }\n}\n" }, { "kind": "variable", "static": true, "variation": null, "name": "SORT_ERROR", "memberof": "src/modules/checkList.js", "longname": "src/modules/checkList.js~SORT_ERROR", "access": null, "export": false, "importPath": "tablefilter/src/modules/checkList.js", "importStyle": null, "description": null, "lineNumber": 8, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "class", "static": true, "variation": null, "name": "CheckList", "memberof": "src/modules/checkList.js", "longname": "src/modules/checkList.js~CheckList", "access": null, "export": true, "importPath": "tablefilter/src/modules/checkList.js", "importStyle": "{CheckList}", "description": null, "lineNumber": 11, "undocument": true, "interface": false, "extends": [ "src/modules/feature~Feature" ] }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#constructor", "access": null, "description": "Checklist UI component", "lineNumber": 17, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "checkListDiv", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#checkListDiv", "access": null, "description": null, "lineNumber": 23, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "checkListDivCssClass", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#checkListDivCssClass", "access": null, "description": null, "lineNumber": 25, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "checkListCssClass", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#checkListCssClass", "access": null, "description": null, "lineNumber": 28, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "checkListItemCssClass", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#checkListItemCssClass", "access": null, "description": null, "lineNumber": 30, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "checkListSlcItemCssClass", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#checkListSlcItemCssClass", "access": null, "description": null, "lineNumber": 33, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "activateCheckListTxt", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#activateCheckListTxt", "access": null, "description": null, "lineNumber": 36, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "checkListItemDisabledCssClass", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#checkListItemDisabledCssClass", "access": null, "description": null, "lineNumber": 39, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "enableCheckListResetFilter", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#enableCheckListResetFilter", "access": null, "description": null, "lineNumber": 42, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "prfxCheckListDiv", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#prfxCheckListDiv", "access": null, "description": null, "lineNumber": 45, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "member", "static": false, "variation": null, "name": "isCustom", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#isCustom", "access": null, "description": null, "lineNumber": 47, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "opts", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#opts", "access": null, "description": null, "lineNumber": 48, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "optsTxt", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#optsTxt", "access": null, "description": null, "lineNumber": 49, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "excludedOpts", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#excludedOpts", "access": null, "description": null, "lineNumber": 50, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "onChange", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#onChange", "access": null, "description": null, "lineNumber": 53, "undocument": true, "params": [ { "name": "evt", "types": [ "*" ] } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "optionClick", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#optionClick", "access": null, "description": null, "lineNumber": 61, "undocument": true, "params": [ { "name": "evt", "types": [ "*" ] } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "onCheckListClick", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#onCheckListClick", "access": null, "description": null, "lineNumber": 66, "undocument": true, "params": [ { "name": "evt", "types": [ "*" ] } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#init", "access": null, "description": "Initialize checklist filter", "lineNumber": 82, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "colIndex", "description": "Column index" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "isExternal", "description": "External filter flag" }, { "nullable": null, "types": [ "DOMElement" ], "spread": false, "optional": false, "name": "container", "description": "Dom element containing the filter" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#initialized", "access": null, "description": null, "lineNumber": 120, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "build", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#build", "access": null, "description": "Build checklist UI", "lineNumber": 129, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "colIndex", "description": "Column index" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "isExternal", "description": "Render in external container" }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "extFltId", "description": "External container id" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "opts", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#opts", "access": null, "description": null, "lineNumber": 135, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "optsTxt", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#optsTxt", "access": null, "description": null, "lineNumber": 136, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "isCustom", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#isCustom", "access": null, "description": null, "lineNumber": 151, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "excludedOpts", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#excludedOpts", "access": null, "description": null, "lineNumber": 161, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "opts", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#opts", "access": null, "description": null, "lineNumber": 214, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "optsTxt", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#optsTxt", "access": null, "description": null, "lineNumber": 215, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "addChecks", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#addChecks", "access": null, "description": "Add checklist options", "lineNumber": 278, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "colIndex", "description": "Column index" }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "ul", "description": "Ul element" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "addTChecks", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#addTChecks", "access": null, "description": "Add checklist header option", "lineNumber": 311, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "colIndex", "description": "Column index" }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "ul", "description": "Ul element" } ], "return": { "types": [ "*" ] }, "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "setCheckListValues", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#setCheckListValues", "access": null, "description": "Store checked options in DOM element attribute", "lineNumber": 352, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "o", "description": "checklist option DOM element" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "selectOptions", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#selectOptions", "access": null, "description": "Select filter options programmatically", "lineNumber": 435, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "colIndex", "description": "Column index" }, { "nullable": null, "types": [ "Array" ], "spread": false, "optional": false, "name": "values", "description": "Array of option values to select" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/modules/checkList.js~CheckList", "longname": "src/modules/checkList.js~CheckList#destroy", "access": null, "description": null, "lineNumber": 464, "undocument": true, "params": [], "generator": false }, { "kind": "file", "static": true, "variation": null, "name": "src/modules/clearButton.js", "memberof": null, "longname": "src/modules/clearButton.js", "access": null, "description": null, "lineNumber": 1, "content": "import {Feature} from './feature';\nimport Dom from '../dom';\nimport Event from '../event';\n\nexport class ClearButton extends Feature{\n\n /**\n * Clear button component\n * @param {Object} tf TableFilter instance\n */\n constructor(tf){\n super(tf, 'btnReset');\n\n // Configuration object\n var f = this.config;\n\n //id of container element\n this.btnResetTgtId = f.btn_reset_target_id || null;\n //reset button element\n this.btnResetEl = null;\n //defines reset text\n this.btnResetText = f.btn_reset_text || 'Reset';\n //defines reset button tooltip\n this.btnResetTooltip = f.btn_reset_tooltip || 'Clear filters';\n //defines reset button innerHtml\n this.btnResetHtml = f.btn_reset_html ||\n (!tf.enableIcons ? null :\n '');\n //span containing reset button\n this.prfxResetSpan = 'resetspan_';\n }\n\n onClick(){\n if(!this.isEnabled()){\n return;\n }\n this.tf.clearFilters();\n }\n\n /**\n * Build DOM elements\n */\n init(){\n var tf = this.tf;\n\n if(this.initialized){\n return;\n }\n\n var resetspan = Dom.create('span', ['id', this.prfxResetSpan+tf.id]);\n\n // reset button is added to defined element\n if(!this.btnResetTgtId){\n tf.setToolbar();\n }\n var targetEl = !this.btnResetTgtId ?\n tf.rDiv : Dom.id(this.btnResetTgtId);\n targetEl.appendChild(resetspan);\n\n if(!this.btnResetHtml){\n var fltreset = Dom.create('a', ['href', 'javascript:void(0);']);\n fltreset.className = tf.btnResetCssClass;\n fltreset.appendChild(Dom.text(this.btnResetText));\n resetspan.appendChild(fltreset);\n Event.add(fltreset, 'click', ()=> { this.onClick(); });\n } else {\n resetspan.innerHTML = this.btnResetHtml;\n var resetEl = resetspan.firstChild;\n Event.add(resetEl, 'click', ()=> { this.onClick(); });\n }\n this.btnResetEl = resetspan.firstChild;\n\n this.initialized = true;\n }\n\n /**\n * Remove clear button UI\n */\n destroy(){\n var tf = this.tf;\n\n if(!this.initialized){\n return;\n }\n\n var resetspan = Dom.id(this.prfxResetSpan+tf.id);\n if(resetspan){\n Dom.remove(resetspan);\n }\n this.btnResetEl = null;\n this.initialized = false;\n }\n}\n" }, { "kind": "class", "static": true, "variation": null, "name": "ClearButton", "memberof": "src/modules/clearButton.js", "longname": "src/modules/clearButton.js~ClearButton", "access": null, "export": true, "importPath": "tablefilter/src/modules/clearButton.js", "importStyle": "{ClearButton}", "description": null, "lineNumber": 5, "undocument": true, "interface": false, "extends": [ "src/modules/feature~Feature" ] }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#constructor", "access": null, "description": "Clear button component", "lineNumber": 11, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "btnResetTgtId", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#btnResetTgtId", "access": null, "description": null, "lineNumber": 18, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnResetEl", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#btnResetEl", "access": null, "description": null, "lineNumber": 20, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnResetText", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#btnResetText", "access": null, "description": null, "lineNumber": 22, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnResetTooltip", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#btnResetTooltip", "access": null, "description": null, "lineNumber": 24, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnResetHtml", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#btnResetHtml", "access": null, "description": null, "lineNumber": 26, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "prfxResetSpan", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#prfxResetSpan", "access": null, "description": null, "lineNumber": 31, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "method", "static": false, "variation": null, "name": "onClick", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#onClick", "access": null, "description": null, "lineNumber": 34, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#init", "access": null, "description": "Build DOM elements", "lineNumber": 44, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "btnResetEl", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#btnResetEl", "access": null, "description": null, "lineNumber": 72, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#initialized", "access": null, "description": null, "lineNumber": 74, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#destroy", "access": null, "description": "Remove clear button UI", "lineNumber": 80, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "btnResetEl", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#btnResetEl", "access": null, "description": null, "lineNumber": 91, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/clearButton.js~ClearButton", "longname": "src/modules/clearButton.js~ClearButton#initialized", "access": null, "description": null, "lineNumber": 92, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "file", "static": true, "variation": null, "name": "src/modules/dropdown.js", "memberof": null, "longname": "src/modules/dropdown.js", "access": null, "description": null, "lineNumber": 1, "content": "import {Feature} from './feature';\nimport Dom from '../dom';\nimport Arr from '../array';\nimport Str from '../string';\nimport Sort from '../sort';\nimport Event from '../event';\n\nconst SORT_ERROR = 'Filter options for column {0} cannot be sorted in ' +\n '{1} manner.';\n\nexport class Dropdown extends Feature{\n\n /**\n * Dropdown UI component\n * @param {Object} tf TableFilter instance\n */\n constructor(tf){\n super(tf, 'dropdown');\n\n // Configuration object\n let f = tf.config();\n\n this.enableSlcResetFilter = f.enable_slc_reset_filter===false ?\n false : true;\n //defines empty option text\n this.nonEmptyText = f.non_empty_text || '(Non empty)';\n //sets select filling method: 'innerHTML' or 'createElement'\n this.slcFillingMethod = f.slc_filling_method || 'createElement';\n //IE only, tooltip text appearing on select before it is populated\n this.activateSlcTooltip = f.activate_slc_tooltip ||\n 'Click to activate';\n //tooltip text appearing on multiple select\n this.multipleSlcTooltip = f.multiple_slc_tooltip ||\n 'Use Ctrl key for multiple selections';\n\n this.isCustom = null;\n this.opts = null;\n this.optsTxt = null;\n this.slcInnerHtml = null;\n }\n\n onSlcFocus(e) {\n let elm = Event.target(e);\n let tf = this.tf;\n tf.activeFilterId = elm.getAttribute('id');\n tf.activeFlt = Dom.id(tf.activeFilterId);\n // select is populated when element has focus\n if(tf.loadFltOnDemand && elm.getAttribute('filled') === '0'){\n let ct = elm.getAttribute('ct');\n this.build(ct);\n }\n this.emitter.emit('filter-focus', tf, this);\n }\n\n onSlcChange() {\n if(this.tf.onSlcChange){\n this.tf.filter();\n }\n }\n\n /**\n * Initialize drop-down filter\n * @param {Number} colIndex Column index\n * @param {Boolean} isExternal External filter flag\n * @param {DOMElement} container Dom element containing the filter\n */\n init(colIndex, isExternal, container){\n let tf = this.tf;\n let col = tf.getFilterType(colIndex);\n let externalFltTgtId = isExternal ?\n tf.externalFltTgtIds[colIndex] : null;\n\n let slc = Dom.create(tf.fltTypeSlc,\n ['id', tf.prfxFlt+colIndex+'_'+tf.id],\n ['ct', colIndex], ['filled', '0']\n );\n\n if(col === tf.fltTypeMulti){\n slc.multiple = tf.fltTypeMulti;\n slc.title = this.multipleSlcTooltip;\n }\n slc.className = Str.lower(col) === tf.fltTypeSlc ?\n tf.fltCssClass : tf.fltMultiCssClass;\n\n //filter is appended in container element\n if(externalFltTgtId){\n Dom.id(externalFltTgtId).appendChild(slc);\n tf.externalFltEls.push(slc);\n } else {\n container.appendChild(slc);\n }\n\n tf.fltIds.push(slc.id);\n\n if(!tf.loadFltOnDemand){\n this.build(colIndex);\n } else {\n //1st option is created here since build isn't invoked\n let opt0 = Dom.createOpt(tf.displayAllText, '');\n slc.appendChild(opt0);\n }\n\n Event.add(slc, 'change', ()=> this.onSlcChange());\n Event.add(slc, 'focus', (e)=> this.onSlcFocus(e));\n\n this.emitter.on(\n ['build-select-filter'],\n (tf, colIndex, isLinked, isExternal)=>\n this.build(colIndex, isLinked, isExternal)\n );\n this.emitter.on(\n ['select-options'],\n (tf, colIndex, values)=> this.selectOptions(colIndex, values)\n );\n\n this.initialized = true;\n }\n\n /**\n * Build drop-down filter UI\n * @param {Number} colIndex Column index\n * @param {Boolean} isLinked Enable linked refresh behaviour\n * @param {Boolean} isExternal Render in external container\n * @param {String} extSlcId External container id\n */\n build(colIndex, isLinked=false, isExternal=false, extSlcId=null){\n let tf = this.tf;\n colIndex = parseInt(colIndex, 10);\n\n this.emitter.emit('before-populating-filter', tf, colIndex);\n\n this.opts = [];\n this.optsTxt = [];\n this.slcInnerHtml = '';\n\n let slcId = tf.fltIds[colIndex];\n if((!Dom.id(slcId) && !isExternal) ||\n (!Dom.id(extSlcId) && isExternal)){\n return;\n }\n let slc = !isExternal ? Dom.id(slcId) : Dom.id(extSlcId),\n rows = tf.tbl.rows,\n matchCase = tf.matchCase;\n\n //custom select test\n this.isCustom = tf.isCustomOptions(colIndex);\n\n //custom selects text\n let activeFlt;\n if(isLinked && tf.activeFilterId){\n activeFlt = tf.activeFilterId.split('_')[0];\n activeFlt = activeFlt.split(tf.prfxFlt)[1];\n }\n\n let excludedOpts = null,\n filteredDataCol = null;\n if(isLinked && tf.disableExcludedOptions){\n excludedOpts = [];\n filteredDataCol = [];\n }\n\n for(let k=tf.refRow; k' +\n lbl+'';\n } else {\n let opt;\n //fill select on demand\n if(tf.loadFltOnDemand && slcValue===this.opts[y] &&\n tf.getFilterType(colIndex) === tf.fltTypeSlc){\n opt = Dom.createOpt(lbl, val, true);\n } else {\n opt = Dom.createOpt(lbl, val, false);\n }\n if(isDisabled){\n opt.disabled = true;\n }\n slc.appendChild(opt);\n }\n }// for y\n\n if(fillMethod === 'innerhtml'){\n slc.innerHTML += this.slcInnerHtml;\n }\n slc.setAttribute('filled', '1');\n }\n\n /**\n * Add drop-down header option\n * @param {Object} slc Select DOM element\n */\n addFirstOption(slc){\n let tf = this.tf,\n fillMethod = Str.lower(this.slcFillingMethod);\n\n if(fillMethod === 'innerhtml'){\n this.slcInnerHtml += '';\n }\n else {\n let opt0 = Dom.createOpt(\n (!this.enableSlcResetFilter ? '' : tf.displayAllText),'');\n if(!this.enableSlcResetFilter){\n opt0.style.display = 'none';\n }\n slc.appendChild(opt0);\n if(tf.enableEmptyOption){\n let opt1 = Dom.createOpt(tf.emptyText, tf.emOperator);\n slc.appendChild(opt1);\n }\n if(tf.enableNonEmptyOption){\n let opt2 = Dom.createOpt(tf.nonEmptyText, tf.nmOperator);\n slc.appendChild(opt2);\n }\n }\n return slc;\n }\n\n /**\n * Select filter options programmatically\n * @param {Number} colIndex Column index\n * @param {Array} values Array of option values to select\n */\n selectOptions(colIndex, values=[]){\n let tf = this.tf;\n if(tf.getFilterType(colIndex) !== tf.fltTypeMulti ||\n values.length === 0){\n return;\n }\n let slc = tf.getFilterElement(colIndex);\n [].forEach.call(slc.options, (option)=> {\n // Empty value means clear all selections and first option is the\n // clear all option\n if(values[0] === '' || option.value === ''){\n option.selected = false;\n }\n\n if(option.value !== '' &&\n Arr.has(values, option.value, true)){\n option.selected = true;\n }//if\n });\n }\n\n destroy(){\n this.emitter.off(\n ['build-select-filter'],\n (colIndex, isLinked, isExternal)=>\n this.build(colIndex, isLinked, isExternal)\n );\n this.emitter.off(\n ['select-options'],\n (tf, colIndex, values)=> this.selectOptions(colIndex, values)\n );\n }\n}\n" }, { "kind": "variable", "static": true, "variation": null, "name": "SORT_ERROR", "memberof": "src/modules/dropdown.js", "longname": "src/modules/dropdown.js~SORT_ERROR", "access": null, "export": false, "importPath": "tablefilter/src/modules/dropdown.js", "importStyle": null, "description": null, "lineNumber": 8, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "class", "static": true, "variation": null, "name": "Dropdown", "memberof": "src/modules/dropdown.js", "longname": "src/modules/dropdown.js~Dropdown", "access": null, "export": true, "importPath": "tablefilter/src/modules/dropdown.js", "importStyle": "{Dropdown}", "description": null, "lineNumber": 11, "undocument": true, "interface": false, "extends": [ "src/modules/feature~Feature" ] }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#constructor", "access": null, "description": "Dropdown UI component", "lineNumber": 17, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "enableSlcResetFilter", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#enableSlcResetFilter", "access": null, "description": null, "lineNumber": 23, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "nonEmptyText", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#nonEmptyText", "access": null, "description": null, "lineNumber": 26, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "slcFillingMethod", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#slcFillingMethod", "access": null, "description": null, "lineNumber": 28, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "activateSlcTooltip", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#activateSlcTooltip", "access": null, "description": null, "lineNumber": 30, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "multipleSlcTooltip", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#multipleSlcTooltip", "access": null, "description": null, "lineNumber": 33, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "isCustom", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#isCustom", "access": null, "description": null, "lineNumber": 36, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "opts", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#opts", "access": null, "description": null, "lineNumber": 37, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "optsTxt", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#optsTxt", "access": null, "description": null, "lineNumber": 38, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "slcInnerHtml", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#slcInnerHtml", "access": null, "description": null, "lineNumber": 39, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "onSlcFocus", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#onSlcFocus", "access": null, "description": null, "lineNumber": 42, "undocument": true, "params": [ { "name": "e", "types": [ "*" ] } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "onSlcChange", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#onSlcChange", "access": null, "description": null, "lineNumber": 55, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#init", "access": null, "description": "Initialize drop-down filter", "lineNumber": 67, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "colIndex", "description": "Column index" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "isExternal", "description": "External filter flag" }, { "nullable": null, "types": [ "DOMElement" ], "spread": false, "optional": false, "name": "container", "description": "Dom element containing the filter" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#initialized", "access": null, "description": null, "lineNumber": 116, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "build", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#build", "access": null, "description": "Build drop-down filter UI", "lineNumber": 126, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "colIndex", "description": "Column index" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "isLinked", "description": "Enable linked refresh behaviour" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "isExternal", "description": "Render in external container" }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "extSlcId", "description": "External container id" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "opts", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#opts", "access": null, "description": null, "lineNumber": 132, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "optsTxt", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#optsTxt", "access": null, "description": null, "lineNumber": 133, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "slcInnerHtml", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#slcInnerHtml", "access": null, "description": null, "lineNumber": 134, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "member", "static": false, "variation": null, "name": "isCustom", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#isCustom", "access": null, "description": null, "lineNumber": 146, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "opts", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#opts", "access": null, "description": null, "lineNumber": 218, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "optsTxt", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#optsTxt", "access": null, "description": null, "lineNumber": 219, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "addOptions", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#addOptions", "access": null, "description": "Add drop-down options", "lineNumber": 278, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "colIndex", "description": "Column index" }, { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "slc", "description": "Select Dom element" }, { "nullable": null, "types": [ "Boolean" ], "spread": false, "optional": false, "name": "isLinked", "description": "Enable linked refresh behaviour" }, { "nullable": null, "types": [ "Array" ], "spread": false, "optional": false, "name": "excludedOpts", "description": "Array of excluded options" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "slcInnerHtml", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#slcInnerHtml", "access": null, "description": null, "lineNumber": 307, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "addFirstOption", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#addFirstOption", "access": null, "description": "Add drop-down header option", "lineNumber": 336, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "slc", "description": "Select DOM element" } ], "return": { "types": [ "*" ] }, "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "slcInnerHtml", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#slcInnerHtml", "access": null, "description": null, "lineNumber": 341, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "selectOptions", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#selectOptions", "access": null, "description": "Select filter options programmatically", "lineNumber": 368, "params": [ { "nullable": null, "types": [ "Number" ], "spread": false, "optional": false, "name": "colIndex", "description": "Column index" }, { "nullable": null, "types": [ "Array" ], "spread": false, "optional": false, "name": "values", "description": "Array of option values to select" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/modules/dropdown.js~Dropdown", "longname": "src/modules/dropdown.js~Dropdown#destroy", "access": null, "description": null, "lineNumber": 389, "undocument": true, "params": [], "generator": false }, { "kind": "file", "static": true, "variation": null, "name": "src/modules/feature.js", "memberof": null, "longname": "src/modules/feature.js", "access": null, "description": null, "lineNumber": 2, "content": "\nconst NOTIMPLEMENTED = 'Not implemented.';\n\nexport class Feature {\n constructor(tf, feature) {\n this.tf = tf;\n this.feature = feature;\n this.enabled = tf[feature];\n this.config = tf.config();\n this.emitter = tf.emitter;\n this.initialized = false;\n }\n\n init() {\n throw new Error(NOTIMPLEMENTED);\n }\n\n reset() {\n this.enable();\n this.init();\n }\n\n destroy() {\n throw new Error(NOTIMPLEMENTED);\n }\n\n enable() {\n this.enabled = true;\n }\n\n disable() {\n this.enabled = false;\n }\n\n isEnabled() {\n return this.enabled;\n }\n}\n" }, { "kind": "variable", "static": true, "variation": null, "name": "NOTIMPLEMENTED", "memberof": "src/modules/feature.js", "longname": "src/modules/feature.js~NOTIMPLEMENTED", "access": null, "export": false, "importPath": "tablefilter/src/modules/feature.js", "importStyle": null, "description": null, "lineNumber": 2, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "class", "static": true, "variation": null, "name": "Feature", "memberof": "src/modules/feature.js", "longname": "src/modules/feature.js~Feature", "access": null, "export": true, "importPath": "tablefilter/src/modules/feature.js", "importStyle": "{Feature}", "description": null, "lineNumber": 4, "undocument": true, "interface": false }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#constructor", "access": null, "description": null, "lineNumber": 5, "undocument": true, "params": [ { "name": "tf", "types": [ "*" ] }, { "name": "feature", "types": [ "*" ] } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "tf", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#tf", "access": null, "description": null, "lineNumber": 6, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "feature", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#feature", "access": null, "description": null, "lineNumber": 7, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "enabled", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#enabled", "access": null, "description": null, "lineNumber": 8, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "config", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#config", "access": null, "description": null, "lineNumber": 9, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "emitter", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#emitter", "access": null, "description": null, "lineNumber": 10, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#initialized", "access": null, "description": null, "lineNumber": 11, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#init", "access": null, "description": null, "lineNumber": 14, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "reset", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#reset", "access": null, "description": null, "lineNumber": 18, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#destroy", "access": null, "description": null, "lineNumber": 23, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "enable", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#enable", "access": null, "description": null, "lineNumber": 27, "undocument": true, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "enabled", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#enabled", "access": null, "description": null, "lineNumber": 28, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "disable", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#disable", "access": null, "description": null, "lineNumber": 31, "undocument": true, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "enabled", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#enabled", "access": null, "description": null, "lineNumber": 32, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "isEnabled", "memberof": "src/modules/feature.js~Feature", "longname": "src/modules/feature.js~Feature#isEnabled", "access": null, "description": null, "lineNumber": 35, "undocument": true, "params": [], "return": { "types": [ "*" ] }, "generator": false }, { "kind": "file", "static": true, "variation": null, "name": "src/modules/gridLayout.js", "memberof": null, "longname": "src/modules/gridLayout.js", "access": null, "description": null, "lineNumber": 1, "content": "import {Feature} from './feature';\nimport Dom from '../dom';\nimport Types from '../types';\nimport Event from '../event';\nimport Str from '../string';\n\nexport class GridLayout extends Feature{\n\n /**\n * Grid layout, table with fixed headers\n * @param {Object} tf TableFilter instance\n */\n constructor(tf){\n super(tf, 'gridLayout');\n\n let f = this.config;\n\n //defines grid width\n this.gridWidth = f.grid_width || null;\n //defines grid height\n this.gridHeight = f.grid_height || null;\n //defines css class for main container\n this.gridMainContCssClass = f.grid_cont_css_class || 'grd_Cont';\n //defines css class for div containing table\n this.gridContCssClass = f.grid_tbl_cont_css_class || 'grd_tblCont';\n //defines css class for div containing headers' table\n this.gridHeadContCssClass = f.grid_tblHead_cont_css_class ||\n 'grd_headTblCont';\n //defines css class for div containing rows counter, paging etc.\n this.gridInfDivCssClass = f.grid_inf_grid_css_class || 'grd_inf';\n //defines which row contains column headers\n this.gridHeadRowIndex = f.grid_headers_row_index || 0;\n //array of headers row indexes to be placed in header table\n this.gridHeadRows = f.grid_headers_rows || [0];\n //generate filters in table headers\n this.gridEnableFilters = f.grid_enable_default_filters!==undefined ?\n f.grid_enable_default_filters : true;\n //default col width\n this.gridDefaultColWidth = f.grid_default_col_width || '100px';\n\n this.gridColElms = [];\n\n //div containing grid elements if grid_layout true\n this.prfxMainTblCont = 'gridCont_';\n //div containing table if grid_layout true\n this.prfxTblCont = 'tblCont_';\n //div containing headers table if grid_layout true\n this.prfxHeadTblCont = 'tblHeadCont_';\n //headers' table if grid_layout true\n this.prfxHeadTbl = 'tblHead_';\n //id of td containing the filter if grid_layout true\n this.prfxGridFltTd = '_td_';\n //id of th containing column header if grid_layout true\n this.prfxGridTh = 'tblHeadTh_';\n\n this.sourceTblHtml = tf.tbl.outerHTML;\n\n // filters flag at TF level\n tf.fltGrid = this.gridEnableFilters;\n }\n\n /**\n * Generates a grid with fixed headers\n */\n init(){\n let tf = this.tf;\n let f = this.config;\n let tbl = tf.tbl;\n\n if(this.initialized){\n return;\n }\n\n // Override reference rows indexes\n tf.refRow = Types.isNull(tf.startRow) ? 0 : tf.startRow;\n tf.headersRow = 0;\n tf.filtersRowIndex = 1;\n\n tf.isExternalFlt = true;\n\n // default width of 100px if column widths not set\n if(!tf.hasColWidths){\n tf.colWidths = [];\n for(let k=0; k0){\n tbl.removeChild(thead[0]);\n }\n\n //Headers table style\n this.headTbl.style.tableLayout = 'fixed';\n tbl.style.tableLayout = 'fixed';\n this.headTbl.cellPadding = tbl.cellPadding;\n this.headTbl.cellSpacing = tbl.cellSpacing;\n // this.headTbl.style.width = tbl.style.width;\n\n //content table without headers needs col widths to be reset\n tf.setColWidths(0, this.headTbl);\n\n //Headers container width\n // this.headTblCont.style.width = this.tblCont.clientWidth+'px';\n\n tbl.style.width = '';\n //\n this.headTbl.style.width = tbl.clientWidth + 'px';\n //\n\n //scroll synchronisation\n Event.add(this.tblCont, 'scroll', (evt)=> {\n let elm = Event.target(evt);\n let scrollLeft = elm.scrollLeft;\n this.headTblCont.scrollLeft = scrollLeft;\n //New pointerX calc taking into account scrollLeft\n // if(!o.isPointerXOverwritten){\n // try{\n // o.Evt.pointerX = function(evt){\n // let e = evt || global.event;\n // let bdScrollLeft = tf_StandardBody().scrollLeft +\n // scrollLeft;\n // return (e.pageX + scrollLeft) ||\n // (e.clientX + bdScrollLeft);\n // };\n // o.isPointerXOverwritten = true;\n // } catch(err) {\n // o.isPointerXOverwritten = false;\n // }\n // }\n });\n\n //Configure sort extension if any\n let sort = (f.extensions || []).filter(function(itm){\n return itm.name === 'sort';\n });\n if(sort.length === 1){\n sort[0].async_sort = true;\n sort[0].trigger_ids = sortTriggers;\n }\n\n //Cols generation for all browsers excepted IE<=7\n this.tblHasColTag = Dom.tag(tbl, 'col').length > 0 ? true : false;\n\n //Col elements are enough to keep column widths after sorting and\n //filtering\n let createColTags = function(){\n for(let k=(tf.nbCells-1); k>=0; k--){\n let col = Dom.create('col', ['id', tf.id+'_col_'+k]);\n tbl.insertBefore(col, tbl.firstChild);\n col.style.width = tf.colWidths[k];\n this.gridColElms[k] = col;\n }\n this.tblHasColTag = true;\n };\n\n if(!this.tblHasColTag){\n createColTags.call(this);\n } else {\n let cols = Dom.tag(tbl, 'col');\n for(let ii=0; ii<, <=, >, ' +\n '>=, =, *, !, {, }, ' +\n '||,&&, [empty], [nonempty], ' +\n 'rgx:
' +\n 'Learn more
';\n //defines help innerHtml\n this.instrHtml = f.help_instructions_html || null;\n //defines reset button text\n this.btnText = f.help_instructions_btn_text || '?';\n //defines reset button innerHtml\n this.btnHtml = f.help_instructions_btn_html || null;\n //defines css class for help button\n this.btnCssClass = f.help_instructions_btn_css_class || 'helpBtn';\n //defines css class for help container\n this.contCssClass = f.help_instructions_container_css_class ||\n 'helpCont';\n //help button element\n this.btn = null;\n //help content div\n this.cont = null;\n this.defaultHtml = '

TableFilter ' +\n 'v'+ tf.version +'

' +\n ''+ WEBSITE_URL +''+\n '
©2015-'+ tf.year +' {AUTHOR}' +\n '
' +\n 'Close
';\n\n //id prefix for help elements\n this.prfxHelpSpan = 'helpSpan_';\n //id prefix for help elements\n this.prfxHelpDiv = 'helpDiv_';\n\n this.emitter.on(['init-help'], ()=> this.init());\n }\n\n init(){\n if(this.initialized){\n return;\n }\n\n var tf = this.tf;\n\n var helpspan = Dom.create('span', ['id', this.prfxHelpSpan+tf.id]);\n var helpdiv = Dom.create('div', ['id', this.prfxHelpDiv+tf.id]);\n\n //help button is added to defined element\n if(!this.tgtId){\n tf.setToolbar();\n }\n var targetEl = !this.tgtId ? tf.rDiv : Dom.id(this.tgtId);\n targetEl.appendChild(helpspan);\n\n var divContainer = !this.contTgtId ? helpspan : Dom.id(this.contTgtId);\n\n if(!this.btnHtml){\n divContainer.appendChild(helpdiv);\n var helplink = Dom.create('a', ['href', 'javascript:void(0);']);\n helplink.className = this.btnCssClass;\n helplink.appendChild(Dom.text(this.btnText));\n helpspan.appendChild(helplink);\n Event.add(helplink, 'click', () => { this.toggle(); });\n } else {\n helpspan.innerHTML = this.btnHtml;\n var helpEl = helpspan.firstChild;\n Event.add(helpEl, 'click', () => { this.toggle(); });\n divContainer.appendChild(helpdiv);\n }\n\n if(!this.instrHtml){\n helpdiv.innerHTML = this.instrText;\n helpdiv.className = this.contCssClass;\n Event.add(helpdiv, 'dblclick', () => { this.toggle(); });\n } else {\n if(this.contTgtId){\n divContainer.appendChild(helpdiv);\n }\n helpdiv.innerHTML = this.instrHtml;\n if(!this.contTgtId){\n helpdiv.className = this.contCssClass;\n Event.add(helpdiv, 'dblclick', () => { this.toggle(); });\n }\n }\n helpdiv.innerHTML += this.defaultHtml;\n Event.add(helpdiv, 'click', () => { this.toggle(); });\n\n this.cont = helpdiv;\n this.btn = helpspan;\n this.initialized = true;\n }\n\n /**\n * Toggle help pop-up\n */\n toggle(){\n // check only if explicitily set to false as in this case undefined\n // signifies the help feature is enabled by default\n if(this.enabled === false){\n return;\n }\n var divDisplay = this.cont.style.display;\n if(divDisplay === '' || divDisplay === 'none'){\n this.cont.style.display = 'inline';\n } else {\n this.cont.style.display = 'none';\n }\n }\n\n /**\n * Remove help UI\n */\n destroy(){\n if(!this.initialized){\n return;\n }\n Dom.remove(this.btn);\n this.btn = null;\n if(!this.cont){\n return;\n }\n Dom.remove(this.cont);\n this.cont = null;\n this.initialized = false;\n }\n\n}\n" }, { "kind": "variable", "static": true, "variation": null, "name": "WIKI_URL", "memberof": "src/modules/help.js", "longname": "src/modules/help.js~WIKI_URL", "access": null, "export": false, "importPath": "tablefilter/src/modules/help.js", "importStyle": null, "description": null, "lineNumber": 6, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "variable", "static": true, "variation": null, "name": "WEBSITE_URL", "memberof": "src/modules/help.js", "longname": "src/modules/help.js~WEBSITE_URL", "access": null, "export": false, "importPath": "tablefilter/src/modules/help.js", "importStyle": null, "description": null, "lineNumber": 8, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "class", "static": true, "variation": null, "name": "Help", "memberof": "src/modules/help.js", "longname": "src/modules/help.js~Help", "access": null, "export": true, "importPath": "tablefilter/src/modules/help.js", "importStyle": "{Help}", "description": null, "lineNumber": 10, "undocument": true, "interface": false, "extends": [ "src/modules/feature~Feature" ] }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#constructor", "access": null, "description": "Help UI component", "lineNumber": 16, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "tgtId", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#tgtId", "access": null, "description": null, "lineNumber": 22, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "contTgtId", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#contTgtId", "access": null, "description": null, "lineNumber": 24, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "instrText", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#instrText", "access": null, "description": null, "lineNumber": 27, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "instrHtml", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#instrHtml", "access": null, "description": null, "lineNumber": 37, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnText", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#btnText", "access": null, "description": null, "lineNumber": 39, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnHtml", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#btnHtml", "access": null, "description": null, "lineNumber": 41, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btnCssClass", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#btnCssClass", "access": null, "description": null, "lineNumber": 43, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "contCssClass", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#contCssClass", "access": null, "description": null, "lineNumber": 45, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btn", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#btn", "access": null, "description": null, "lineNumber": 48, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "cont", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#cont", "access": null, "description": null, "lineNumber": 50, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "defaultHtml", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#defaultHtml", "access": null, "description": null, "lineNumber": 51, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "prfxHelpSpan", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#prfxHelpSpan", "access": null, "description": null, "lineNumber": 59, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "member", "static": false, "variation": null, "name": "prfxHelpDiv", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#prfxHelpDiv", "access": null, "description": null, "lineNumber": 61, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#init", "access": null, "description": null, "lineNumber": 66, "undocument": true, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "cont", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#cont", "access": null, "description": null, "lineNumber": 116, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "btn", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#btn", "access": null, "description": null, "lineNumber": 117, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#initialized", "access": null, "description": null, "lineNumber": 118, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "toggle", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#toggle", "access": null, "description": "Toggle help pop-up", "lineNumber": 124, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#destroy", "access": null, "description": "Remove help UI", "lineNumber": 141, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "btn", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#btn", "access": null, "description": null, "lineNumber": 146, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "cont", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#cont", "access": null, "description": null, "lineNumber": 151, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/help.js~Help", "longname": "src/modules/help.js~Help#initialized", "access": null, "description": null, "lineNumber": 152, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "file", "static": true, "variation": null, "name": "src/modules/highlightKeywords.js", "memberof": null, "longname": "src/modules/highlightKeywords.js", "access": null, "description": null, "lineNumber": 1, "content": "import Dom from '../dom';\nimport Str from '../string';\nimport Types from '../types';\n\nexport class HighlightKeyword{\n\n /**\n * HighlightKeyword, highlight matched keyword\n * @param {Object} tf TableFilter instance\n */\n constructor(tf) {\n var f = tf.config();\n //defines css class for highlighting\n this.highlightCssClass = f.highlight_css_class || 'keyword';\n this.highlightedNodes = [];\n\n this.tf = tf;\n this.emitter = tf.emitter;\n }\n\n init(){\n this.emitter.on(\n ['before-filtering', 'destroy'],\n ()=> this.unhighlightAll()\n );\n this.emitter.on(\n ['highlight-keyword'],\n (tf, cell, word)=>\n this.highlight(cell, word, this.highlightCssClass)\n );\n }\n\n /**\n * highlight occurences of searched term in passed node\n * @param {Node} node\n * @param {String} word Searched term\n * @param {String} cssClass Css class name\n */\n highlight(node, word, cssClass){\n // Iterate into this nodes childNodes\n if(node.hasChildNodes){\n var children = node.childNodes;\n for(var i=0; i {\n if(Types.isArray(val)){\n val.forEach((item)=>\n this.unhighlight(item, this.highlightCssClass));\n } else {\n this.unhighlight(val, this.highlightCssClass);\n }\n });\n this.highlightedNodes = [];\n }\n\n destroy(){\n this.emitter.off(\n ['before-filtering', 'destroy'],\n ()=> this.unhighlightAll()\n );\n this.emitter.off(\n ['highlight-keyword'],\n (tf, cell, word)=>\n this.highlight(cell, word, this.highlightCssClass)\n );\n }\n}" }, { "kind": "class", "static": true, "variation": null, "name": "HighlightKeyword", "memberof": "src/modules/highlightKeywords.js", "longname": "src/modules/highlightKeywords.js~HighlightKeyword", "access": null, "export": true, "importPath": "tablefilter/src/modules/highlightKeywords.js", "importStyle": "{HighlightKeyword}", "description": null, "lineNumber": 5, "undocument": true, "interface": false }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#constructor", "access": null, "description": "HighlightKeyword, highlight matched keyword", "lineNumber": 11, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "highlightCssClass", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#highlightCssClass", "access": null, "description": null, "lineNumber": 14, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "highlightedNodes", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#highlightedNodes", "access": null, "description": null, "lineNumber": 15, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "tf", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#tf", "access": null, "description": null, "lineNumber": 17, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "emitter", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#emitter", "access": null, "description": null, "lineNumber": 18, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#init", "access": null, "description": null, "lineNumber": 21, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "highlight", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#highlight", "access": null, "description": "highlight occurences of searched term in passed node", "lineNumber": 39, "params": [ { "nullable": null, "types": [ "Node" ], "spread": false, "optional": false, "name": "node", "description": "" }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "word", "description": "Searched term" }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "cssClass", "description": "Css class name" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "unhighlight", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#unhighlight", "access": null, "description": "Removes highlight to nodes matching passed string", "lineNumber": 80, "params": [ { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "word", "description": "" }, { "nullable": null, "types": [ "String" ], "spread": false, "optional": false, "name": "cssClass", "description": "Css class to remove" } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "unhighlightAll", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#unhighlightAll", "access": null, "description": "Clear all occurrences of highlighted nodes", "lineNumber": 112, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "highlightedNodes", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#highlightedNodes", "access": null, "description": null, "lineNumber": 125, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/modules/highlightKeywords.js~HighlightKeyword", "longname": "src/modules/highlightKeywords.js~HighlightKeyword#destroy", "access": null, "description": null, "lineNumber": 128, "undocument": true, "params": [], "generator": false }, { "kind": "file", "static": true, "variation": null, "name": "src/modules/loader.js", "memberof": null, "longname": "src/modules/loader.js", "access": null, "description": null, "lineNumber": 1, "content": "import {Feature} from './feature';\nimport Dom from '../dom';\nimport Types from '../types';\n\nlet global = window;\n\nexport class Loader extends Feature{\n\n /**\n * Loading message/spinner\n * @param {Object} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'loader');\n\n // TableFilter configuration\n let f = this.config;\n\n //id of container element\n this.loaderTgtId = f.loader_target_id || null;\n //div containing loader\n this.loaderDiv = null;\n //defines loader text\n this.loaderText = f.loader_text || 'Loading...';\n //defines loader innerHtml\n this.loaderHtml = f.loader_html || null;\n //defines css class for loader div\n this.loaderCssClass = f.loader_css_class || 'loader';\n //delay for hiding loader\n this.loaderCloseDelay = 250;\n //callback function before loader is displayed\n this.onShowLoader = Types.isFn(f.on_show_loader) ?\n f.on_show_loader : null;\n //callback function after loader is closed\n this.onHideLoader = Types.isFn(f.on_hide_loader) ?\n f.on_hide_loader : null;\n //loader div\n this.prfxLoader = 'load_';\n }\n\n init() {\n if(this.initialized){\n return;\n }\n\n let tf = this.tf;\n let emitter = this.emitter;\n\n let containerDiv = Dom.create('div', ['id', this.prfxLoader+tf.id]);\n containerDiv.className = this.loaderCssClass;\n\n let targetEl = !this.loaderTgtId ?\n tf.tbl.parentNode : Dom.id(this.loaderTgtId);\n if(!this.loaderTgtId){\n targetEl.insertBefore(containerDiv, tf.tbl);\n } else {\n targetEl.appendChild(containerDiv);\n }\n this.loaderDiv = containerDiv;\n if(!this.loaderHtml){\n this.loaderDiv.appendChild(Dom.text(this.loaderText));\n } else {\n this.loaderDiv.innerHTML = this.loaderHtml;\n }\n\n this.show('none');\n\n // Subscribe to events\n emitter.on([\n 'before-filtering',\n 'before-populating-filter',\n 'before-changing-page',\n 'before-clearing-filters',\n 'before-changing-results-per-page',\n 'before-reset-page',\n 'before-reset-page-length',\n 'before-loading-extensions',\n 'before-loading-themes'\n ],\n ()=> this.show('')\n );\n emitter.on([\n 'after-filtering',\n 'after-populating-filter',\n 'after-changing-page',\n 'after-clearing-filters',\n 'after-changing-results-per-page',\n 'after-reset-page',\n 'after-reset-page-length',\n 'after-loading-extensions',\n 'after-loading-themes'\n ],\n ()=> this.show('none')\n );\n\n this.initialized = true;\n }\n\n show(p) {\n if(!this.isEnabled() /*|| this.loaderDiv.style.display === p*/){\n return;\n }\n\n let displayLoader = () => {\n if(!this.loaderDiv){\n return;\n }\n if(this.onShowLoader && p !== 'none'){\n this.onShowLoader.call(null, this);\n }\n this.loaderDiv.style.display = p;\n if(this.onHideLoader && p === 'none'){\n this.onHideLoader.call(null, this);\n }\n };\n\n let t = p === 'none' ? this.loaderCloseDelay : 1;\n global.setTimeout(displayLoader, t);\n }\n\n destroy() {\n if(!this.initialized){\n return;\n }\n\n let emitter = this.emitter;\n\n Dom.remove(this.loaderDiv);\n this.loaderDiv = null;\n\n // Unsubscribe to events\n emitter.off([\n 'before-filtering',\n 'before-populating-filter',\n 'before-changing-page',\n 'before-clearing-filters',\n 'before-changing-results-per-page',\n 'before-reset-page',\n 'before-reset-page-length',\n 'before-loading-extensions',\n 'before-loading-themes'\n ],\n ()=> this.show('')\n );\n emitter.off([\n 'after-filtering',\n 'after-populating-filter',\n 'after-changing-page',\n 'after-clearing-filters',\n 'after-changing-results-per-page',\n 'after-reset-page',\n 'after-reset-page-length',\n 'after-loading-extensions',\n 'after-loading-themes'\n ],\n ()=> this.show('none')\n );\n\n this.initialized = false;\n }\n}\n" }, { "kind": "variable", "static": true, "variation": null, "name": "global", "memberof": "src/modules/loader.js", "longname": "src/modules/loader.js~global", "access": null, "export": false, "importPath": "tablefilter/src/modules/loader.js", "importStyle": null, "description": null, "lineNumber": 5, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "class", "static": true, "variation": null, "name": "Loader", "memberof": "src/modules/loader.js", "longname": "src/modules/loader.js~Loader", "access": null, "export": true, "importPath": "tablefilter/src/modules/loader.js", "importStyle": "{Loader}", "description": null, "lineNumber": 7, "undocument": true, "interface": false, "extends": [ "src/modules/feature~Feature" ] }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#constructor", "access": null, "description": "Loading message/spinner", "lineNumber": 13, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "loaderTgtId", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#loaderTgtId", "access": null, "description": null, "lineNumber": 20, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "loaderDiv", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#loaderDiv", "access": null, "description": null, "lineNumber": 22, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "loaderText", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#loaderText", "access": null, "description": null, "lineNumber": 24, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "loaderHtml", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#loaderHtml", "access": null, "description": null, "lineNumber": 26, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "loaderCssClass", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#loaderCssClass", "access": null, "description": null, "lineNumber": 28, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "loaderCloseDelay", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#loaderCloseDelay", "access": null, "description": null, "lineNumber": 30, "undocument": true, "type": { "types": [ "number" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onShowLoader", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#onShowLoader", "access": null, "description": null, "lineNumber": 32, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onHideLoader", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#onHideLoader", "access": null, "description": null, "lineNumber": 35, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "prfxLoader", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#prfxLoader", "access": null, "description": null, "lineNumber": 38, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#init", "access": null, "description": null, "lineNumber": 41, "undocument": true, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "loaderDiv", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#loaderDiv", "access": null, "description": null, "lineNumber": 59, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#initialized", "access": null, "description": null, "lineNumber": 96, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "show", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#show", "access": null, "description": null, "lineNumber": 99, "undocument": true, "params": [ { "name": "p", "types": [ "*" ] } ], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#destroy", "access": null, "description": null, "lineNumber": 121, "undocument": true, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "loaderDiv", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#loaderDiv", "access": null, "description": null, "lineNumber": 129, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/loader.js~Loader", "longname": "src/modules/loader.js~Loader#initialized", "access": null, "description": null, "lineNumber": 159, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "file", "static": true, "variation": null, "name": "src/modules/noResults.js", "memberof": null, "longname": "src/modules/noResults.js", "access": null, "description": null, "lineNumber": 1, "content": "import {Feature} from './feature';\nimport Dom from '../dom';\nimport Types from '../types';\n\nexport class NoResults extends Feature{\n\n /**\n * No results message UI component\n * @param {Object} tf TableFilter instance\n */\n constructor(tf){\n super(tf, 'noResults');\n\n //configuration object\n let f = this.config.no_results_message;\n\n this.content = f.content || 'No results';\n this.customContainer = f.custom_container || null;\n this.customContainerId = f.custom_container_id || null;\n this.isExternal = !Types.isEmpty(this.customContainer) ||\n !Types.isEmpty(this.customContainerId);\n this.cssClass = f.css_class || 'no-results';\n\n this.cont = null;\n\n //callback before message is displayed\n this.onBeforeShowMsg = Types.isFn(f.on_before_show_msg) ?\n f.on_before_show_msg : null;\n //callback after message is displayed\n this.onAfterShowMsg = Types.isFn(f.on_after_show_msg) ?\n f.on_after_show_msg : null;\n //callback before message is hidden\n this.onBeforeHideMsg = Types.isFn(f.on_before_hide_msg) ?\n f.on_before_hide_msg : null;\n //callback after message is hidden\n this.onAfterHideMsg = Types.isFn(f.on_after_hide_msg) ?\n f.on_after_hide_msg : null;\n\n this.prfxNoResults = 'nores_';\n }\n\n init(){\n if(this.initialized){\n return;\n }\n let tf = this.tf;\n let target = this.customContainer || Dom.id(this.customContainerId) ||\n tf.tbl;\n\n //container\n let cont = Dom.create('div', ['id', this.prfxNoResults+tf.id]);\n cont.className = this.cssClass;\n cont.innerHTML = this.content;\n\n if(this.isExternal){\n target.appendChild(cont);\n } else {\n target.parentNode.insertBefore(cont, target.nextSibling);\n }\n\n this.cont = cont;\n\n // subscribe to after-filtering event\n this.emitter.on(['after-filtering'], ()=> this.toggle());\n\n this.initialized = true;\n this.hide();\n }\n\n toggle(){\n if(this.tf.nbVisibleRows > 0){\n this.hide();\n } else {\n this.show();\n }\n }\n\n show(){\n if(!this.initialized || !this.isEnabled()){\n return;\n }\n\n if(this.onBeforeShowMsg){\n this.onBeforeShowMsg.call(null, this.tf, this);\n }\n\n this.setWidth();\n this.cont.style.display = 'block';\n\n if(this.onAfterShowMsg){\n this.onAfterShowMsg.call(null, this.tf, this);\n }\n }\n\n hide(){\n if(!this.initialized || !this.isEnabled()){\n return;\n }\n\n if(this.onBeforeHideMsg){\n this.onBeforeHideMsg.call(null, this.tf, this);\n }\n\n this.cont.style.display = 'none';\n\n if(this.onBeforeHideMsg){\n this.onBeforeHideMsg.call(null, this.tf, this);\n }\n }\n\n setWidth(){\n if(!this.initialized || this.isExternal || !this.isEnabled()){\n return;\n }\n if(this.tf.gridLayout){\n let gridLayout = this.tf.feature('gridLayout');\n this.cont.style.width = gridLayout.tblCont.clientWidth + 'px';\n } else {\n this.cont.style.width = this.tf.tbl.clientWidth + 'px';\n }\n\n }\n\n destroy(){\n if(!this.initialized){\n return;\n }\n Dom.remove(this.cont);\n this.cont = null;\n // unsubscribe to after-filtering event\n this.emitter.off(['after-filtering'], ()=> this.toggle());\n\n this.initialized = false;\n }\n}\n" }, { "kind": "class", "static": true, "variation": null, "name": "NoResults", "memberof": "src/modules/noResults.js", "longname": "src/modules/noResults.js~NoResults", "access": null, "export": true, "importPath": "tablefilter/src/modules/noResults.js", "importStyle": "{NoResults}", "description": null, "lineNumber": 5, "undocument": true, "interface": false, "extends": [ "src/modules/feature~Feature" ] }, { "kind": "constructor", "static": false, "variation": null, "name": "constructor", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#constructor", "access": null, "description": "No results message UI component", "lineNumber": 11, "params": [ { "nullable": null, "types": [ "Object" ], "spread": false, "optional": false, "name": "tf", "description": "TableFilter instance" } ], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "content", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#content", "access": null, "description": null, "lineNumber": 17, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "customContainer", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#customContainer", "access": null, "description": null, "lineNumber": 18, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "customContainerId", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#customContainerId", "access": null, "description": null, "lineNumber": 19, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "isExternal", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#isExternal", "access": null, "description": null, "lineNumber": 20, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "cssClass", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#cssClass", "access": null, "description": null, "lineNumber": 22, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "cont", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#cont", "access": null, "description": null, "lineNumber": 24, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onBeforeShowMsg", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#onBeforeShowMsg", "access": null, "description": null, "lineNumber": 27, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onAfterShowMsg", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#onAfterShowMsg", "access": null, "description": null, "lineNumber": 30, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onBeforeHideMsg", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#onBeforeHideMsg", "access": null, "description": null, "lineNumber": 33, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "onAfterHideMsg", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#onAfterHideMsg", "access": null, "description": null, "lineNumber": 36, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "prfxNoResults", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#prfxNoResults", "access": null, "description": null, "lineNumber": 39, "undocument": true, "type": { "types": [ "string" ] } }, { "kind": "method", "static": false, "variation": null, "name": "init", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#init", "access": null, "description": null, "lineNumber": 42, "undocument": true, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "cont", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#cont", "access": null, "description": null, "lineNumber": 61, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#initialized", "access": null, "description": null, "lineNumber": 66, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "method", "static": false, "variation": null, "name": "toggle", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#toggle", "access": null, "description": null, "lineNumber": 70, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "show", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#show", "access": null, "description": null, "lineNumber": 78, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "hide", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#hide", "access": null, "description": null, "lineNumber": 95, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "setWidth", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#setWidth", "access": null, "description": null, "lineNumber": 111, "undocument": true, "params": [], "generator": false }, { "kind": "method", "static": false, "variation": null, "name": "destroy", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#destroy", "access": null, "description": null, "lineNumber": 124, "undocument": true, "params": [], "generator": false }, { "kind": "member", "static": false, "variation": null, "name": "cont", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#cont", "access": null, "description": null, "lineNumber": 129, "undocument": true, "type": { "types": [ "*" ] } }, { "kind": "member", "static": false, "variation": null, "name": "initialized", "memberof": "src/modules/noResults.js~NoResults", "longname": "src/modules/noResults.js~NoResults#initialized", "access": null, "description": null, "lineNumber": 133, "undocument": true, "type": { "types": [ "boolean" ] } }, { "kind": "file", "static": true, "variation": null, "name": "src/modules/paging.js", "memberof": null, "longname": "src/modules/paging.js", "access": null, "description": null, "lineNumber": 1, "content": "import {Feature} from './feature';\nimport Dom from '../dom';\nimport Types from '../types';\nimport Str from '../string';\nimport Event from '../event';\n\nexport class Paging extends Feature{\n\n /**\n * Pagination component\n * @param {Object} tf TableFilter instance\n */\n constructor(tf){\n super(tf, 'paging');\n\n // Configuration object\n var f = this.config;\n\n //css class for paging buttons (previous,next,etc.)\n this.btnPageCssClass = f.paging_btn_css_class || 'pgInp';\n //stores paging select element\n this.pagingSlc = null;\n //results per page select element\n this.resultsPerPageSlc = null;\n //id of container element\n this.pagingTgtId = f.paging_target_id || null;\n //defines table paging length\n this.pagingLength = !isNaN(f.paging_length) ? f.paging_length : 10;\n //id of container element\n this.resultsPerPageTgtId = f.results_per_page_target_id || null;\n //css class for paging select element\n this.pgSlcCssClass = f.paging_slc_css_class || 'pgSlc';\n //css class for paging input element\n this.pgInpCssClass = f.paging_inp_css_class || 'pgNbInp';\n //stores results per page text and values\n this.resultsPerPage = f.results_per_page || null;\n //enables/disables results per page drop-down\n this.hasResultsPerPage = Types.isArray(this.resultsPerPage);\n //defines css class for results per page select\n this.resultsSlcCssClass = f.results_slc_css_class || 'rspg';\n //css class for label preceding results per page select\n this.resultsSpanCssClass = f.results_span_css_class || 'rspgSpan';\n //1st row index of current page\n this.startPagingRow = 0;\n //total nb of pages\n this.nbPages = 0;\n //current page nb\n this.currentPageNb = 1;\n //defines next page button text\n this.btnNextPageText = f.btn_next_page_text || '>';\n //defines previous page button text\n this.btnPrevPageText = f.btn_prev_page_text || '<';\n //defines last page button text\n this.btnLastPageText = f.btn_last_page_text || '>|';\n //defines first page button text\n this.btnFirstPageText = f.btn_first_page_text || '|<';\n //defines next page button html\n this.btnNextPageHtml = f.btn_next_page_html ||\n (!tf.enableIcons ? null :\n '');\n //defines previous page button html\n this.btnPrevPageHtml = f.btn_prev_page_html ||\n (!tf.enableIcons ? null :\n '');\n //defines last page button html\n this.btnFirstPageHtml = f.btn_first_page_html ||\n (!tf.enableIcons ? null :\n '');\n //defines previous page button html\n this.btnLastPageHtml = f.btn_last_page_html ||\n (!tf.enableIcons ? null :\n '');\n //defines text preceeding page selector drop-down\n this.pageText = f.page_text || ' Page ';\n //defines text after page selector drop-down\n this.ofText = f.of_text || ' of ';\n //css class for span containing tot nb of pages\n this.nbPgSpanCssClass = f.nb_pages_css_class || 'nbpg';\n //enables/disables paging buttons\n this.hasPagingBtns = f.paging_btns===false ? false : true;\n //defines previous page button html\n this.pageSelectorType = f.page_selector_type || tf.fltTypeSlc;\n //calls function before page is changed\n this.onBeforeChangePage = Types.isFn(f.on_before_change_page) ?\n f.on_before_change_page : null;\n //calls function before page is changed\n this.onAfterChangePage = Types.isFn(f.on_after_change_page) ?\n f.on_after_change_page : null;\n\n //pages select\n this.prfxSlcPages = 'slcPages_';\n //results per page select\n this.prfxSlcResults = 'slcResults_';\n //label preciding results per page select\n this.prfxSlcResultsTxt = 'slcResultsTxt_';\n //span containing next page button\n this.prfxBtnNextSpan = 'btnNextSpan_';\n //span containing previous page button\n this.prfxBtnPrevSpan = 'btnPrevSpan_';\n //span containing last page button\n this.prfxBtnLastSpan = 'btnLastSpan_';\n //span containing first page button\n this.prfxBtnFirstSpan = 'btnFirstSpan_';\n //next button\n this.prfxBtnNext = 'btnNext_';\n //previous button\n this.prfxBtnPrev = 'btnPrev_';\n //last button\n this.prfxBtnLast = 'btnLast_';\n //first button\n this.prfxBtnFirst = 'btnFirst_';\n //span for tot nb pages\n this.prfxPgSpan = 'pgspan_';\n //span preceding pages select (contains 'Page')\n this.prfxPgBeforeSpan = 'pgbeforespan_';\n //span following pages select (contains ' of ')\n this.prfxPgAfterSpan = 'pgafterspan_';\n\n var start_row = tf.refRow;\n var nrows = tf.nbRows;\n //calculates page nb\n this.nbPages = Math.ceil((nrows-start_row)/this.pagingLength);\n\n //Paging elements events\n var o = this;\n // Paging DOM events\n this.evt = {\n slcIndex(){\n return (o.pageSelectorType===tf.fltTypeSlc) ?\n o.pagingSlc.options.selectedIndex :\n parseInt(o.pagingSlc.value, 10)-1;\n },\n nbOpts(){\n return (o.pageSelectorType===tf.fltTypeSlc) ?\n parseInt(o.pagingSlc.options.length, 10)-1 :\n (o.nbPages-1);\n },\n next(){\n var nextIndex = o.evt.slcIndex() < o.evt.nbOpts() ?\n o.evt.slcIndex()+1 : 0;\n o.changePage(nextIndex);\n },\n prev(){\n var prevIndex = o.evt.slcIndex()>0 ?\n o.evt.slcIndex()-1 : o.evt.nbOpts();\n o.changePage(prevIndex);\n },\n last(){\n o.changePage(o.evt.nbOpts());\n },\n first(){\n o.changePage(0);\n },\n _detectKey(e){\n var key = Event.keyCode(e);\n if(key===13){\n if(tf.sorted){\n tf.filter();\n o.changePage(o.evt.slcIndex());\n } else{\n o.changePage();\n }\n this.blur();\n }\n },\n slcPagesChange: null,\n nextEvt: null,\n prevEvt: null,\n lastEvt: null,\n firstEvt: null\n };\n }\n\n /**\n * Initialize DOM elements\n */\n init(){\n var slcPages;\n var tf = this.tf;\n var evt = this.evt;\n\n if(this.initialized){\n return;\n }\n\n // Check resultsPerPage is in expected format and initialise the\n // results per page component\n if(this.hasResultsPerPage){\n if(this.resultsPerPage.length<2){\n this.hasResultsPerPage = false;\n } else {\n this.pagingLength = this.resultsPerPage[1][0];\n this.setResultsPerPage();\n }\n }\n\n evt.slcPagesChange = (event) => {\n var slc = event.target;\n this.changePage(slc.selectedIndex);\n };\n\n // Paging drop-down list selector\n if(this.pageSelectorType === tf.fltTypeSlc){\n slcPages = Dom.create(\n tf.fltTypeSlc, ['id', this.prfxSlcPages+tf.id]);\n slcPages.className = this.pgSlcCssClass;\n Event.add(slcPages, 'change', evt.slcPagesChange);\n }\n\n // Paging input selector\n if(this.pageSelectorType === tf.fltTypeInp){\n slcPages = Dom.create(\n tf.fltTypeInp,\n ['id', this.prfxSlcPages+tf.id],\n ['value', this.currentPageNb]\n );\n slcPages.className = this.pgInpCssClass;\n Event.add(slcPages, 'keypress', evt._detectKey);\n }\n\n // btns containers\n var btnNextSpan = Dom.create(\n 'span',['id', this.prfxBtnNextSpan+tf.id]);\n var btnPrevSpan = Dom.create(\n 'span',['id', this.prfxBtnPrevSpan+tf.id]);\n var btnLastSpan = Dom.create(\n 'span',['id', this.prfxBtnLastSpan+tf.id]);\n var btnFirstSpan = Dom.create(\n 'span',['id', this.prfxBtnFirstSpan+tf.id]);\n\n if(this.hasPagingBtns){\n // Next button\n if(!this.btnNextPageHtml){\n var btn_next = Dom.create(\n tf.fltTypeInp,\n ['id', this.prfxBtnNext+tf.id],\n ['type', 'button'],\n ['value', this.btnNextPageText],\n ['title', 'Next']\n );\n btn_next.className = this.btnPageCssClass;\n Event.add(btn_next, 'click', evt.next);\n btnNextSpan.appendChild(btn_next);\n } else {\n btnNextSpan.innerHTML = this.btnNextPageHtml;\n Event.add(btnNextSpan, 'click', evt.next);\n }\n // Previous button\n if(!this.btnPrevPageHtml){\n var btn_prev = Dom.create(\n tf.fltTypeInp,\n ['id', this.prfxBtnPrev+tf.id],\n ['type', 'button'],\n ['value', this.btnPrevPageText],\n ['title', 'Previous']\n );\n btn_prev.className = this.btnPageCssClass;\n Event.add(btn_prev, 'click', evt.prev);\n btnPrevSpan.appendChild(btn_prev);\n } else {\n btnPrevSpan.innerHTML = this.btnPrevPageHtml;\n Event.add(btnPrevSpan, 'click', evt.prev);\n }\n // Last button\n if(!this.btnLastPageHtml){\n var btn_last = Dom.create(\n tf.fltTypeInp,\n ['id', this.prfxBtnLast+tf.id],\n ['type', 'button'],\n ['value', this.btnLastPageText],\n ['title', 'Last']\n );\n btn_last.className = this.btnPageCssClass;\n Event.add(btn_last, 'click', evt.last);\n btnLastSpan.appendChild(btn_last);\n } else {\n btnLastSpan.innerHTML = this.btnLastPageHtml;\n Event.add(btnLastSpan, 'click', evt.last);\n }\n // First button\n if(!this.btnFirstPageHtml){\n var btn_first = Dom.create(\n tf.fltTypeInp,\n ['id', this.prfxBtnFirst+tf.id],\n ['type', 'button'],\n ['value', this.btnFirstPageText],\n ['title', 'First']\n );\n btn_first.className = this.btnPageCssClass;\n Event.add(btn_first, 'click', evt.first);\n btnFirstSpan.appendChild(btn_first);\n } else {\n btnFirstSpan.innerHTML = this.btnFirstPageHtml;\n Event.add(btnFirstSpan, 'click', evt.first);\n }\n }\n\n // paging elements (buttons+drop-down list) are added to defined element\n if(!this.pagingTgtId){\n tf.setToolbar();\n }\n var targetEl = !this.pagingTgtId ? tf.mDiv : Dom.id(this.pagingTgtId);\n targetEl.appendChild(btnFirstSpan);\n targetEl.appendChild(btnPrevSpan);\n\n var pgBeforeSpan = Dom.create(\n 'span',['id', this.prfxPgBeforeSpan+tf.id] );\n pgBeforeSpan.appendChild( Dom.text(this.pageText) );\n pgBeforeSpan.className = this.nbPgSpanCssClass;\n targetEl.appendChild(pgBeforeSpan);\n targetEl.appendChild(slcPages);\n var pgAfterSpan = Dom.create(\n 'span',['id', this.prfxPgAfterSpan+tf.id]);\n pgAfterSpan.appendChild( Dom.text(this.ofText) );\n pgAfterSpan.className = this.nbPgSpanCssClass;\n targetEl.appendChild(pgAfterSpan);\n var pgspan = Dom.create( 'span',['id', this.prfxPgSpan+tf.id] );\n pgspan.className = this.nbPgSpanCssClass;\n pgspan.appendChild( Dom.text(' '+this.nbPages+' ') );\n targetEl.appendChild(pgspan);\n targetEl.appendChild(btnNextSpan);\n targetEl.appendChild(btnLastSpan);\n this.pagingSlc = Dom.id(this.prfxSlcPages+tf.id);\n\n if(!tf.rememberGridValues){\n this.setPagingInfo();\n }\n if(!tf.fltGrid){\n tf.validateAllRows();\n this.setPagingInfo(tf.validRowsIndex);\n }\n\n this.emitter.on(['after-filtering'], ()=> this.resetPagingInfo());\n this.emitter.on(['initialized'], ()=> this.resetValues());\n\n this.initialized = true;\n }\n\n /**\n * Reset paging when filters are already instantiated\n * @param {Boolean} filterTable Execute filtering once paging instanciated\n */\n reset(filterTable=false){\n var tf = this.tf;\n if(this.isEnabled()){\n return;\n }\n this.enable();\n this.init();\n // tf.resetValues();\n if(filterTable){\n tf.filter();\n }\n }\n\n /**\n * Reset paging info from scratch after a filtering process\n */\n resetPagingInfo(){\n this.startPagingRow = 0;\n this.currentPageNb = 1;\n this.setPagingInfo(this.tf.validRowsIndex);\n }\n\n /**\n * Calculate number of pages based on valid rows\n * Refresh paging select according to number of pages\n * @param {Array} validRows Collection of valid rows\n */\n setPagingInfo(validRows){\n var tf = this.tf;\n var mdiv = !this.pagingTgtId ? tf.mDiv : Dom.id(this.pagingTgtId);\n var pgspan = Dom.id(this.prfxPgSpan+tf.id);\n\n //store valid rows indexes\n tf.validRowsIndex = validRows || tf.getValidRows(true);\n\n //calculate nb of pages\n this.nbPages = Math.ceil(tf.validRowsIndex.length/this.pagingLength);\n //refresh page nb span\n pgspan.innerHTML = this.nbPages;\n //select clearing shortcut\n if(this.pageSelectorType === tf.fltTypeSlc){\n this.pagingSlc.innerHTML = '';\n }\n\n if(this.nbPages>0){\n mdiv.style.visibility = 'visible';\n if(this.pageSelectorType === tf.fltTypeSlc){\n for(var z=0; z