src/tablefilter.js
-import {addEvt, cancelEvt, stopEvt, targetEvt, keyCode} from './event';
+import {addEvt, cancelEvt, stopEvt, targetEvt, isKeyPressed} from './event';
import {
addClass, createElm, createOpt, elm, getText, getFirstTextNode,
removeClass, tag
@@ -876,16 +877,17 @@ export class TableFilter {
/**
* Enable auto-filter behaviour, table is filtered when a user
* stops typing
- * @type {Boolean}
+ * @type {Object|Boolean}
*/
- this.autoFilter = Boolean(f.auto_filter);
+ this.autoFilter = isObj(f.auto_filter) || Boolean(f.auto_filter);
/**
- * Auto-filter delay in msecs
+ * Auto-filter delay in milliseconds
* @type {Number}
*/
- this.autoFilterDelay =
- defaultsNb(f.auto_filter_delay, AUTO_FILTER_DELAY);
+ this.autoFilterDelay = isObj(f.auto_filter) &&
+ isNumber(f.auto_filter.delay) ?
+ f.auto_filter.delay : AUTO_FILTER_DELAY;
/**
* Indicate whether user is typing
@@ -1200,17 +1202,15 @@ export class TableFilter {
if (!this.enterKey) {
return;
}
- if (evt) {
- let key = keyCode(evt);
- if (key === ENTER_KEY) {
- this.filter();
- cancelEvt(evt);
- stopEvt(evt);
- } else {
- this.isUserTyping = true;
- root.clearInterval(this.autoFilterTimer);
- this.autoFilterTimer = null;
- }
+
+ if (isKeyPressed(evt, [ENTER_KEY])) {
+ this.filter();
+ cancelEvt(evt);
+ stopEvt(evt);
+ } else {
+ this.isUserTyping = true;
+ root.clearInterval(this.autoFilterTimer);
+ this.autoFilterTimer = null;
}
}
@@ -1223,7 +1223,6 @@ export class TableFilter {
if (!this.autoFilter) {
return;
}
- let key = keyCode(evt);
this.isUserTyping = false;
function filter() {
@@ -1235,15 +1234,17 @@ export class TableFilter {
}
}
- if (key !== ENTER_KEY && key !== TAB_KEY && key !== ESC_KEY &&
- key !== UP_ARROW_KEY && key !== DOWN_ARROW_KEY) {
- if (this.autoFilterTimer === null) {
- this.autoFilterTimer = root.setInterval(filter.bind(this),
- this.autoFilterDelay);
- }
- } else {
+ if (isKeyPressed(evt,
+ [ENTER_KEY, TAB_KEY, ESC_KEY, UP_ARROW_KEY, DOWN_ARROW_KEY])) {
root.clearInterval(this.autoFilterTimer);
this.autoFilterTimer = null;
+ } else {
+ if (this.autoFilterTimer !== null) {
+ return;
+ }
+ this.autoFilterTimer = root.setInterval(
+ filter.bind(this),
+ this.autoFilterDelay);
}
}
diff --git a/docs/file/src/types.js.html b/docs/file/src/types.js.html
index 89740119..3dcbbf38 100644
--- a/docs/file/src/types.js.html
+++ b/docs/file/src/types.js.html
@@ -47,6 +47,7 @@
Ftag
FaddEvt
FcancelEvt
+FisKeyPressed
FkeyCode
FremoveEvt
FstopEvt
diff --git a/docs/function/index.html b/docs/function/index.html
index 938be747..b8dd3662 100644
--- a/docs/function/index.html
+++ b/docs/function/index.html
@@ -47,6 +47,7 @@
Ftag
FaddEvt
FcancelEvt
+FisKeyPressed
FkeyCode
FremoveEvt
FstopEvt
@@ -906,35 +907,6 @@ otherwise return the value itself
-
-
-
-
-
-
-
- Checks if passed string is empty
-
-
-
-
-
-
-
-
-
-
- public
-
-
-
@@ -964,6 +936,35 @@ otherwise return the value itself
+
+
+
+
+
+
+
+ Checks if passed string is empty
+
+
+
+
+
+
+
+
+
+
+ public
+
+
+
@@ -993,6 +994,35 @@ otherwise return the value itself
+
+
+
+
+
+
+
+
+ isKeyPressed(evt: Event, keyCodes: Array): *
+
+
+
+
+
+ Check code of pressed key is one of the expected key codes
+
+
+
+
+
+
+
+
+
+
+ public
+
+
+
@@ -3569,18 +3599,18 @@ otherwise return the value itself
- isEmpty(text: String): Boolean
+ isEmpty(obj: Any): Boolean
- source
+ source
- import {isEmpty} from 'tablefilter/src/string.js'
+ import {isEmpty} from 'tablefilter/src/types.js'
- Checks if passed string is empty
+ Check passed argument is empty (undefined, null or empty string)
@@ -3594,8 +3624,8 @@ otherwise return the value itself
- text
- String
+ obj
+ Any
@@ -3641,18 +3671,18 @@ otherwise return the value itself
- isEmpty(obj: Any): Boolean
+ isEmpty(text: String): Boolean
- source
+ source
- import {isEmpty} from 'tablefilter/src/types.js'
+ import {isEmpty} from 'tablefilter/src/string.js'
- Check passed argument is empty (undefined, null or empty string)
+ Checks if passed string is empty
@@ -3666,8 +3696,8 @@ otherwise return the value itself
- obj
- Any
+ text
+ String
@@ -3776,6 +3806,86 @@ otherwise return the value itself
+
+
+
+ public
+
+
+
+
+
+ isKeyPressed(evt: Event, keyCodes: Array): *
+
+
+
+ source
+
+
+
+ import {isKeyPressed} from 'tablefilter/src/event.js'
+
+
+ Check code of pressed key is one of the expected key codes
+
+
+
+
+
+ Params:
+
+
+ Name Type Attribute Description
+
+
+
+
+ evt
+ Event
+
+ key event
+
+
+
+ keyCodes
+ Array
+
+ list of keycodes to check
+
+
+
+
+
+
+
+
+ Return:
+
+
+
+ *
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/identifiers.html b/docs/identifiers.html
index 02aa929f..700950df 100644
--- a/docs/identifiers.html
+++ b/docs/identifiers.html
@@ -47,6 +47,7 @@
Ftag
FaddEvt
FcancelEvt
+FisKeyPressed
FkeyCode
FremoveEvt
FstopEvt
@@ -673,6 +674,35 @@ propagation of the event.
+
+
+
+
+
+ F
+
+
+ isKeyPressed(evt: Event, keyCodes: Array): *
+
+
+
+
+
+ Check code of pressed key is one of the expected key codes
+
+
+
+
+
+
+
+
+
+
+ public
+
+
+
diff --git a/docs/index.html b/docs/index.html
index 99c68603..e4d0a386 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -47,6 +47,7 @@
Ftag
FaddEvt
FcancelEvt
+FisKeyPressed
FkeyCode
FremoveEvt
FstopEvt
diff --git a/docs/index.json b/docs/index.json
index b39c5b6a..c85c9985 100644
--- a/docs/index.json
+++ b/docs/index.json
@@ -1809,7 +1809,7 @@
"__docId__": 94,
"kind": "file",
"name": "src/event.js",
- "content": "import {root} from './root';\n\n/**\n * DOM event utilities\n */\n\n/**\n * Add event handler for specified event on passed element\n *\n * @param {DOMElement} obj Element\n * @param {String} type Event type\n * @param {Function} Handler\n * @param {Boolean} capture Specifiy whether the event should be executed in\n * the capturing or in the bubbling phase\n */\nexport const addEvt = (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\n/**\n * Remove event handler for specified event on passed element\n *\n * @param {DOMElement} obj Element\n * @param {String} type Event type\n * @param {Function} Handler\n * @param {Boolean} capture Specifiy whether the event should be executed in\n * the capturing or in the bubbling phase\n */\nexport const removeEvt = (obj, type, func, capture) => {\n if (obj.removeEventListener) {\n obj.removeEventListener(type, func, capture);\n } else if (obj.detachEvent) {\n obj.detachEvent('on' + type, func);\n } else {\n obj['on' + type] = null;\n }\n};\n\n/**\n * Prevents further propagation of the current event in the bubbling phase\n *\n * @param {Event} evt Event on the DOM\n */\nexport const stopEvt = (evt) => {\n if (!evt) {\n evt = root.event;\n }\n if (evt.stopPropagation) {\n evt.stopPropagation();\n } else {\n evt.cancelBubble = true;\n }\n};\n\n/**\n * Cancels the event if it is cancelable, without stopping further\n * propagation of the event.\n *\n * @param {Event} evt Event on the DOM\n */\nexport const cancelEvt = (evt) => {\n if (!evt) {\n evt = root.event;\n }\n if (evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n};\n\n/**\n * Reference to the object that dispatched the event\n *\n * @param {Event} evt Event on the DOM\n * @returns {DOMElement}\n */\nexport const targetEvt = (evt) => {\n if (!evt) {\n evt = root.event;\n }\n return evt.target || evt.srcElement;\n};\n\n/**\n * Returns the Unicode value of pressed key\n *\n * @param {Event} evt Event on the DOM\n * @returns {Number}\n */\nexport const keyCode = (evt) => {\n return evt.charCode ? evt.charCode :\n (evt.keyCode ? evt.keyCode : (evt.which ? evt.which : 0));\n};\n",
+ "content": "import {root} from './root';\n\n/**\n * DOM event utilities\n */\n\n/**\n * Add event handler for specified event on passed element\n *\n * @param {DOMElement} obj Element\n * @param {String} type Event type\n * @param {Function} Handler\n * @param {Boolean} capture Specifiy whether the event should be executed in\n * the capturing or in the bubbling phase\n */\nexport const addEvt = (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\n/**\n * Remove event handler for specified event on passed element\n *\n * @param {DOMElement} obj Element\n * @param {String} type Event type\n * @param {Function} Handler\n * @param {Boolean} capture Specifiy whether the event should be executed in\n * the capturing or in the bubbling phase\n */\nexport const removeEvt = (obj, type, func, capture) => {\n if (obj.removeEventListener) {\n obj.removeEventListener(type, func, capture);\n } else if (obj.detachEvent) {\n obj.detachEvent('on' + type, func);\n } else {\n obj['on' + type] = null;\n }\n};\n\n/**\n * Prevents further propagation of the current event in the bubbling phase\n *\n * @param {Event} evt Event on the DOM\n */\nexport const stopEvt = (evt) => {\n if (!evt) {\n evt = root.event;\n }\n if (evt.stopPropagation) {\n evt.stopPropagation();\n } else {\n evt.cancelBubble = true;\n }\n};\n\n/**\n * Cancels the event if it is cancelable, without stopping further\n * propagation of the event.\n *\n * @param {Event} evt Event on the DOM\n */\nexport const cancelEvt = (evt) => {\n if (!evt) {\n evt = root.event;\n }\n if (evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n};\n\n/**\n * Reference to the object that dispatched the event\n *\n * @param {Event} evt Event on the DOM\n * @returns {DOMElement}\n */\nexport const targetEvt = (evt) => {\n if (!evt) {\n evt = root.event;\n }\n return evt.target || evt.srcElement;\n};\n\n/**\n * Returns the Unicode value of pressed key\n *\n * @param {Event} evt Event on the DOM\n * @returns {Number}\n */\nexport const keyCode = (evt) => {\n return evt.charCode ? evt.charCode :\n (evt.keyCode ? evt.keyCode : (evt.which ? evt.which : 0));\n};\n\n/**\n * Check code of pressed key is one of the expected key codes\n *\n * @param {Event} evt key event\n * @param {Array} keyCodes list of keycodes to check\n */\nexport const isKeyPressed = (evt, keyCodes = []) => {\n return keyCodes.indexOf(keyCode(evt)) !== -1;\n};\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/event.js",
"access": "public",
@@ -2078,6 +2078,49 @@
},
{
"__docId__": 101,
+ "kind": "function",
+ "name": "isKeyPressed",
+ "memberof": "src/event.js",
+ "generator": false,
+ "async": false,
+ "static": true,
+ "longname": "src/event.js~isKeyPressed",
+ "access": "public",
+ "export": true,
+ "importPath": "tablefilter/src/event.js",
+ "importStyle": "{isKeyPressed}",
+ "description": "Check code of pressed key is one of the expected key codes",
+ "lineNumber": 109,
+ "params": [
+ {
+ "nullable": null,
+ "types": [
+ "Event"
+ ],
+ "spread": false,
+ "optional": false,
+ "name": "evt",
+ "description": "key event"
+ },
+ {
+ "nullable": null,
+ "types": [
+ "Array"
+ ],
+ "spread": false,
+ "optional": false,
+ "name": "keyCodes",
+ "description": "list of keycodes to check"
+ }
+ ],
+ "return": {
+ "types": [
+ "*"
+ ]
+ }
+ },
+ {
+ "__docId__": 102,
"kind": "file",
"name": "src/extensions/advancedGrid/adapterEzEditTable.js",
"content": "import {Feature} from '../../feature';\nimport {tag} from '../../dom';\nimport {INPUT} from '../../const';\nimport {defaultsStr} from '../../settings';\nimport {root} from '../../root';\n\nconst INSTANTIATION_ERROR = `Failed to instantiate EditTable object.\n \\n\"ezEditTable\" dependency not found.`;\n\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 */\nexport default class AdapterEzEditTable extends Feature {\n\n /**\n * Creates an instance of AdapterEzEditTable\n *\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} cfg Configuration options for ezEditTable library\n */\n constructor(tf, cfg) {\n super(tf, cfg.name);\n\n /**\n * Module description\n * @type {String}\n */\n this.desc = defaultsStr(cfg.description, 'ezEditTable adapter');\n\n /**\n * Filename of ezEditTable library\n * @type {String}\n */\n this.filename = defaultsStr(cfg.filename, 'ezEditTable.js');\n\n /**\n * Path to ezEditTable library\n * @type {String}\n */\n this.vendorPath = cfg.vendor_path;\n\n /**\n * Load ezEditTable stylesheet\n * @type {Boolean}\n */\n this.loadStylesheet = Boolean(cfg.load_stylesheet);\n\n /**\n * Path to ezEditTable stylesheet\n * @type {String}\n */\n this.stylesheet = defaultsStr(cfg.stylesheet,\n this.vendorPath + 'ezEditTable.css');\n\n /**\n * Name of ezEditTable stylesheet\n * @type {String}\n */\n this.stylesheetName = defaultsStr(cfg.stylesheet_name,\n 'ezEditTableCss');\n\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 /**\n * ezEditTable instance\n * @type {EditTable}\n * @private\n */\n this._ezEditTable = null;\n\n /**\n * ezEditTable configuration\n * @private\n */\n this.cfg = cfg;\n\n this.enable();\n }\n\n /**\n * Conditionally load ezEditTable library and set advanced grid\n */\n init() {\n if (this.initialized) {\n return;\n }\n let tf = this.tf;\n if (root.EditTable) {\n this._setAdvancedGrid();\n } else {\n let 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 * @inherited\n */\n this.initialized = true;\n }\n\n /**\n * Instantiate ezEditTable component for advanced grid features\n * @private\n */\n _setAdvancedGrid() {\n let tf = this.tf;\n\n //start row for EditTable constructor needs to be calculated\n let startRow,\n cfg = this.cfg,\n thead = tag(tf.dom(), '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 let editable = cfg.editable;\n let 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 let _lastValidRowIndex = 0;\n let _lastRowIndex = 0;\n\n if (selectable) {\n //Row navigation needs to be calculated according to TableFilter's\n //validRowsIndex array\n let onAfterSelection = function (et, selectedElm, e) {\n let slc = et.Selection;\n //Next valid filtered row needs to be selected\n let doSelect = function (nextRowIndex) {\n if (et.defaultSelection === 'row') {\n /* eslint-disable */\n slc.SelectRowByIndex(nextRowIndex);\n /* eslint-enable */\n } else {\n /* eslint-disable */\n et.ClearSelections();\n /* eslint-enable */\n let cellIndex = selectedElm.cellIndex,\n row = tf.dom().rows[nextRowIndex];\n if (et.defaultSelection === 'both') {\n /* eslint-disable */\n slc.SelectRowByIndex(nextRowIndex);\n /* eslint-enable */\n }\n if (row) {\n /* eslint-disable */\n slc.SelectCell(row.cells[cellIndex]);\n /* eslint-enable */\n }\n }\n //Table is filtered\n if (tf.validRowsIndex.length !== tf.getRowsNb()) {\n let r = tf.dom().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 let 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 /* eslint-disable */\n keyCode = e !== undefined ? et.Event.GetKey(e) : 0,\n /* eslint-enable */\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.pageLength || et.nbRowsPerPage) :\n 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 let 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 let 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 let onBeforeSelection = function (et, selectedElm) {\n let row = et.defaultSelection !== 'row' ?\n selectedElm.parentNode : selectedElm;\n if (tf.paging) {\n if (tf.feature('paging').nbPages > 1) {\n let paging = tf.feature('paging');\n //page length is re-assigned in case it has changed\n et.nbRowsPerPage = paging.pageLength;\n let validIndexes = tf.validRowsIndex,\n validIdxLen = validIndexes.length,\n pagingEndRow = parseInt(paging.startPagingRow, 10) +\n parseInt(paging.pageLength, 10);\n let 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 let advGrid = paging.tf.extension('advancedGrid');\n let et = advGrid._ezEditTable;\n let slc = et.Selection;\n /* eslint-disable */\n let row = slc.GetActiveRow();\n /* eslint-enable */\n if (row) {\n row.scrollIntoView(false);\n }\n /* eslint-disable */\n let cell = slc.GetActiveCell();\n /* eslint-enable */\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 let fnB = cfg.on_before_selected_row;\n cfg.on_before_selected_row = function () {\n var args = arguments;\n onBeforeSelection(args[0], args[1], args[2]);\n if (fnB) {\n fnB.call(null, args[0], args[1], args[2]);\n }\n };\n let fnA = cfg.on_after_selected_row;\n cfg.on_after_selected_row = function () {\n var args = arguments;\n onAfterSelection(args[0], args[1], args[2]);\n if (fnA) {\n fnA.call(null, args[0], args[1], args[2]);\n }\n };\n } else {\n let fnD = cfg.on_before_selected_cell;\n cfg.on_before_selected_cell = function () {\n var args = arguments;\n onBeforeSelection(args[0], args[1], args[2]);\n if (fnD) {\n fnD.call(null, args[0], args[1], args[2]);\n }\n };\n let fnC = cfg.on_after_selected_cell;\n cfg.on_after_selected_cell = function () {\n var args = arguments;\n onAfterSelection(args[0], args[1], args[2]);\n if (fnC) {\n fnC.call(null, args[0], args[1], args[2]);\n }\n };\n }\n }\n if (editable) {\n //Added or removed rows, TF rows number needs to be re-calculated\n let fnE = cfg.on_added_dom_row;\n cfg.on_added_dom_row = function () {\n var args = arguments;\n tf.nbFilterableRows++;\n if (!tf.paging) {\n tf.emitter.emit('rows-changed', tf, this);\n } else {\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, args[0], args[1], args[2]);\n }\n };\n if (cfg.actions && cfg.actions['delete']) {\n let fnF = cfg.actions['delete'].on_after_submit;\n cfg.actions['delete'].on_after_submit = function () {\n var args = arguments;\n tf.nbFilterableRows--;\n if (!tf.paging) {\n tf.emitter.emit('rows-changed', tf, this);\n } else {\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, args[0], args[1]);\n }\n };\n }\n }\n\n try {\n /* eslint-disable */\n this._ezEditTable = new EditTable(tf.id, cfg, startRow);\n this._ezEditTable.Init();\n /* eslint-enable */\n } catch (e) { throw new Error(INSTANTIATION_ERROR); }\n\n this.initialized = true;\n }\n\n /**\n * Reset advanced grid when previously removed\n */\n reset() {\n let ezEditTable = this._ezEditTable;\n if (ezEditTable) {\n if (this.cfg.selection) {\n /* eslint-disable */\n ezEditTable.Selection.Set();\n /* eslint-enable */\n }\n if (this.cfg.editable) {\n /* eslint-disable */\n ezEditTable.Editable.Set();\n /* eslint-enable */\n }\n }\n }\n\n /**\n * Toggle behaviour\n */\n toggle() {\n let ezEditTable = this._ezEditTable;\n if (ezEditTable.editable) {\n /* eslint-disable */\n ezEditTable.Editable.Remove();\n /* eslint-enable */\n } else {\n /* eslint-disable */\n ezEditTable.Editable.Set();\n /* eslint-enable */\n }\n if (ezEditTable.selection) {\n /* eslint-disable */\n ezEditTable.Selection.Remove();\n /* eslint-enable */\n } else {\n /* eslint-disable */\n ezEditTable.Selection.Set();\n /* eslint-enable */\n }\n }\n\n _toggleForInputFilter() {\n let tf = this.tf;\n if (!tf.getActiveFilterId()) {\n return;\n }\n let colIndex = tf.getColumnIndexFromFilterId(tf.getActiveFilterId());\n let filterType = tf.getFilterType(colIndex);\n if (filterType === INPUT) {\n this.toggle();\n }\n }\n\n /**\n * Remove advanced grid\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n let ezEditTable = this._ezEditTable;\n if (ezEditTable) {\n if (this.cfg.selection) {\n /* eslint-disable */\n ezEditTable.Selection.ClearSelections();\n ezEditTable.Selection.Remove();\n /* eslint-enable */\n }\n if (this.cfg.editable) {\n /* eslint-disable */\n ezEditTable.Editable.Remove();\n /* eslint-enable */\n }\n }\n\n this.emitter.off(['filter-focus', 'filter-blur'],\n () => this._toggleForInputFilter());\n this.initialized = false;\n }\n}\n",
@@ -2088,7 +2131,7 @@
"lineNumber": 1
},
{
- "__docId__": 102,
+ "__docId__": 103,
"kind": "variable",
"name": "INSTANTIATION_ERROR",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js",
@@ -2109,7 +2152,7 @@
"ignore": true
},
{
- "__docId__": 103,
+ "__docId__": 104,
"kind": "class",
"name": "AdapterEzEditTable",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js",
@@ -2127,7 +2170,7 @@
]
},
{
- "__docId__": 104,
+ "__docId__": 105,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2162,7 +2205,7 @@
]
},
{
- "__docId__": 105,
+ "__docId__": 106,
"kind": "member",
"name": "desc",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2181,7 +2224,7 @@
}
},
{
- "__docId__": 106,
+ "__docId__": 107,
"kind": "member",
"name": "filename",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2200,7 +2243,7 @@
}
},
{
- "__docId__": 107,
+ "__docId__": 108,
"kind": "member",
"name": "vendorPath",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2219,7 +2262,7 @@
}
},
{
- "__docId__": 108,
+ "__docId__": 109,
"kind": "member",
"name": "loadStylesheet",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2238,7 +2281,7 @@
}
},
{
- "__docId__": 109,
+ "__docId__": 110,
"kind": "member",
"name": "stylesheet",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2257,7 +2300,7 @@
}
},
{
- "__docId__": 110,
+ "__docId__": 111,
"kind": "member",
"name": "stylesheetName",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2276,7 +2319,7 @@
}
},
{
- "__docId__": 111,
+ "__docId__": 112,
"kind": "member",
"name": "_ezEditTable",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2292,10 +2335,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 112,
+ "__docId__": 113,
"kind": "member",
"name": "cfg",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2304,6 +2348,7 @@
"access": "private",
"description": "ezEditTable configuration",
"lineNumber": 79,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -2311,7 +2356,7 @@
}
},
{
- "__docId__": 113,
+ "__docId__": 114,
"kind": "method",
"name": "init",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2326,7 +2371,7 @@
"return": null
},
{
- "__docId__": 114,
+ "__docId__": 115,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2348,7 +2393,7 @@
}
},
{
- "__docId__": 115,
+ "__docId__": 116,
"kind": "method",
"name": "_setAdvancedGrid",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2359,11 +2404,12 @@
"access": "private",
"description": "Instantiate ezEditTable component for advanced grid features",
"lineNumber": 117,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 118,
+ "__docId__": 119,
"kind": "method",
"name": "reset",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2378,7 +2424,7 @@
"return": null
},
{
- "__docId__": 119,
+ "__docId__": 120,
"kind": "method",
"name": "toggle",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2393,7 +2439,7 @@
"return": null
},
{
- "__docId__": 120,
+ "__docId__": 121,
"kind": "method",
"name": "_toggleForInputFilter",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2405,11 +2451,12 @@
"description": null,
"lineNumber": 469,
"undocument": true,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 121,
+ "__docId__": 122,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
@@ -2424,7 +2471,7 @@
"return": null
},
{
- "__docId__": 123,
+ "__docId__": 124,
"kind": "file",
"name": "src/extensions/advancedGrid/advancedGrid.js",
"content": "import AdapterEzEditTable from './adapterEzEditTable';\n\nexport default AdapterEzEditTable;",
@@ -2435,7 +2482,7 @@
"lineNumber": 1
},
{
- "__docId__": 124,
+ "__docId__": 125,
"kind": "file",
"name": "src/extensions/colOps/colOps.js",
"content": "import {Feature} from '../../feature';\nimport {createText, elm} from '../../dom';\nimport {isArray, isEmpty, EMPTY_FN} from '../../types';\nimport {numSortAsc} from '../../sort';\nimport {FORMATTED_NUMBER} from '../../const';\nimport formatNumber from 'format-number';\nimport {defaultsFn, defaultsArr} from '../../settings';\n\nconst EVENTS = [\n 'after-filtering',\n 'after-page-change',\n 'after-page-length-change'\n];\n\nconst SUM = 'sum';\nconst MEAN = 'mean';\nconst MIN = 'min';\nconst MAX = 'max';\nconst MEDIAN = 'median';\nconst Q1 = 'q1';\nconst Q3 = 'q3';\n\n/**\n * Column calculations extension\n */\nexport default class ColOps extends Feature {\n\n /**\n * Creates an instance of ColOps\n *\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} opts Configuration object\n */\n constructor(tf, opts) {\n super(tf, opts.name);\n\n /**\n * Callback fired before columns operations start\n * @type {Function}\n */\n this.onBeforeOperation = defaultsFn(opts.on_before_operation, EMPTY_FN);\n\n /**\n * Callback fired after columns operations are completed\n * @type {Function}\n */\n this.onAfterOperation = defaultsFn(opts.on_after_operation, EMPTY_FN);\n\n /**\n * Configuration options\n * @type {Object}\n */\n this.opts = opts;\n\n /**\n * List of DOM element IDs containing column's calculation result\n * @type {Array}\n */\n this.labelIds = defaultsArr(opts.id, []);\n\n /**\n * List of columns' indexes for calculations\n * @type {Array}\n */\n this.colIndexes = defaultsArr(opts.col, []);\n\n /**\n * List of operations - possible values: 'sum', 'mean', 'min', 'max',\n * 'median', 'q1', 'q3'\n * @type {Array}\n */\n this.operations = defaultsArr(opts.operation, []);\n\n /**\n * List of write methods used to write the result - possible values:\n * 'innerHTML', 'setValue', 'createTextNode'\n * @type {Array}\n */\n this.outputTypes = defaultsArr(opts.write_method, []);\n\n /**\n * List of format objects used for formatting the result -\n * refer to https://github.com/componitable/format-number to check\n * configuration options\n * @type {Array}\n */\n this.formatResults = defaultsArr(opts.format_result, []);\n\n /**\n * List of row indexes displaying the results\n * @type {Array}\n */\n this.totRowIndexes = defaultsArr(opts.tot_row_index, []);\n\n /**\n * List of row indexes excluded from calculations\n * @type {Array}\n */\n this.excludeRows = defaultsArr(opts.exclude_row, []);\n\n /**\n * List of decimal precision for calculation results\n * @type {Array}\n */\n this.decimalPrecisions = defaultsArr(opts.decimal_precision, 2);\n\n this.enable();\n }\n\n /**\n * Initializes ColOps instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n // subscribe to events\n this.emitter.on(EVENTS, () => this.calcAll());\n\n this.calcAll();\n\n /** @inherited */\n this.initialized = true;\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 calcAll() {\n let tf = this.tf;\n if (!tf.isInitialized()) {\n return;\n }\n\n this.onBeforeOperation(tf, this);\n this.emitter.emit('before-column-operation', tf, this);\n\n let { colIndexes, operations: colOperations, outputTypes,\n totRowIndexes, excludeRows, formatResults,\n decimalPrecisions } = this;\n\n //nuovella: determine unique list of columns to operate on\n let uIndexes = [];\n colIndexes.forEach((val) => {\n if (uIndexes.indexOf(val) === -1) {\n uIndexes.push(val);\n }\n });\n\n let nbCols = uIndexes.length,\n rows = tf.dom().rows,\n colValues = [];\n\n for (let u = 0; u < nbCols; u++) {\n //this retrieves col values\n //use uIndexes because we only want to pass through this loop\n //once for each column get the values in this unique column\n colValues.push(\n tf.getVisibleColumnData(uIndexes[u], false, excludeRows)\n );\n\n let curValues = colValues[u];\n\n //next: calculate all operations for this column\n let result = 0,\n operations = [],\n precisions = [],\n labels = [],\n writeType,\n formatResult = [],\n idx = 0;\n\n for (let k = 0; k < colIndexes.length; k++) {\n if (colIndexes[k] !== uIndexes[u]) {\n continue;\n }\n operations[idx] = (colOperations[k] || 'sum').toLowerCase();\n precisions[idx] = decimalPrecisions[k];\n labels[idx] = this.labelIds[k];\n writeType = isArray(outputTypes) ? outputTypes[k] : null;\n formatResult[idx] =\n this.configureFormat(uIndexes[u], formatResults[k]);\n idx++;\n }\n\n for (let i = 0; i < idx; i++) {\n // emit values before column calculation\n this.emitter.emit(\n 'before-column-calc',\n tf,\n this,\n uIndexes[u],\n curValues,\n operations[i],\n precisions[i]\n );\n\n result = Number(this.calc(curValues, operations[i], null));\n\n // emit column calculation result\n this.emitter.emit(\n 'column-calc',\n tf,\n this,\n uIndexes[u],\n result,\n operations[i],\n precisions[i]\n );\n\n // write result in expected DOM element\n this.writeResult(\n result,\n labels[i],\n writeType,\n precisions[i],\n formatResult[i]\n );\n\n }//for i\n\n // row(s) with result are always visible\n let totRow = totRowIndexes && totRowIndexes[u] ?\n rows[totRowIndexes[u]] : null;\n if (totRow) {\n totRow.style.display = '';\n }\n }//for u\n\n this.onAfterOperation(tf, this);\n this.emitter.emit('after-column-operation', tf, this);\n }\n\n /**\n * Make desired calculation on specified column.\n * @param {Number} colIndex Column index\n * @param {String} [operation=SUM] Operation type\n * @param {Number} precision Decimal precision\n * @returns {Number}\n */\n columnCalc(colIndex, operation = SUM, precision) {\n let excludeRows = this.excludeRows || [];\n let colValues = tf.getVisibleColumnData(colIndex, false, excludeRows);\n\n return Number(this.calc(colValues, operation, precision));\n }\n\n /**\n * Make calculation on passed values.\n * @param {Array} values List of values\n * @param {String} [operation=SUM] Optional operation type\n * @param {Number} precision Optional result precision\n * @returns {Number}\n * @private\n */\n calc(colValues, operation = SUM, precision) {\n let result = 0;\n\n if (operation === Q1 || operation === Q3 || operation === MEDIAN) {\n colValues = this.sortColumnValues(colValues, numSortAsc);\n }\n\n switch (operation) {\n case MEAN:\n result = this.calcMean(colValues);\n break;\n case SUM:\n result = this.calcSum(colValues);\n break;\n case MIN:\n result = this.calcMin(colValues);\n break;\n case MAX:\n result = this.calcMax(colValues);\n break;\n case MEDIAN:\n result = this.calcMedian(colValues);\n break;\n case Q1:\n result = this.calcQ1(colValues);\n break;\n case Q3:\n result = this.calcQ3(colValues);\n break;\n }\n\n return isEmpty(precision) ? result : result.toFixed(precision);\n }\n\n /**\n * Calculate the sum of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcSum(values = []) {\n if (isEmpty(values)) {\n return 0;\n }\n let result = values.reduce((x, y) => Number(x) + Number(y));\n return result;\n }\n\n /**\n * Calculate the mean of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcMean(values = []) {\n let result = this.calcSum(values) / values.length;\n return Number(result);\n }\n\n /**\n * Calculate the max value of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcMax(values = []) {\n return Math.max.apply(null, values);\n }\n\n /**\n * Calculate the min value of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcMin(values = []) {\n return Math.min.apply(null, values);\n }\n\n /**\n * Calculate the median of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcMedian(values = []) {\n let nbValues = values.length;\n let aux = 0;\n if (nbValues % 2 === 1) {\n aux = Math.floor(nbValues / 2);\n return Number(values[aux]);\n }\n return (Number(values[nbValues / 2]) +\n Number(values[((nbValues / 2) - 1)])) / 2;\n }\n\n /**\n * Calculate the lower quartile of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcQ1(values = []) {\n let nbValues = values.length;\n let posa = 0.0;\n posa = Math.floor(nbValues / 4);\n if (4 * posa === nbValues) {\n return (Number(values[posa - 1]) +\n Number(values[posa])) / 2;\n }\n return Number(values[posa]);\n }\n\n /**\n * Calculate the upper quartile of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcQ3(values = []) {\n let nbValues = values.length;\n let posa = 0.0;\n let posb = 0.0;\n posa = Math.floor(nbValues / 4);\n if (4 * posa === nbValues) {\n posb = 3 * posa;\n return (Number(values[posb]) +\n Number(values[posb - 1])) / 2;\n }\n return Number(values[nbValues - posa - 1]);\n }\n\n /**\n * Sort passed values with supplied sorter function.\n * @param {Array} [values=[]] List of values to be sorted\n * @param {Function} sorter Sorter function\n * @returns {Array}\n */\n sortColumnValues(values = [], sorter) {\n return values.sort(sorter);\n }\n\n /**\n * Write calculation result in passed DOM element with supplied write method\n * and decimal precision.\n * @param {Number} [result=0] Calculation result\n * @param {DOMElement} label DOM element\n * @param {String} [writeType='innerhtml'] Write method\n * @param {Number} [precision=2] Applied decimal precision\n * @private\n */\n writeResult(result = 0, label, writeType = 'innerhtml',\n precision = 2, format = {}) {\n let labelElm = elm(label);\n\n if (!labelElm) {\n return;\n }\n\n result = result.toFixed(precision);\n if (isNaN(result) || !isFinite(result)) {\n result = '';\n } else {\n result = formatNumber(format)(result);\n }\n\n switch (writeType.toLowerCase()) {\n case 'innerhtml':\n labelElm.innerHTML = result;\n break;\n case 'setvalue':\n labelElm.value = result;\n break;\n case 'createtextnode':\n let oldNode = labelElm.firstChild;\n let txtNode = createText(result);\n labelElm.replaceChild(txtNode, oldNode);\n break;\n }\n }\n\n /**\n * Configure the format options used to format the operation result based\n * on column type.\n * @param {Number} colIndex Column index\n * @param {Object} [format={}] Format object\n * @returns {Object}\n * @private\n */\n configureFormat(colIndex, format = {}) {\n let tf = this.tf;\n if (tf.hasType(colIndex, [FORMATTED_NUMBER])) {\n let colType = tf.colTypes[colIndex];\n if (colType.decimal && !format.decimal) {\n format.decimal = colType.decimal;\n }\n if (colType.thousands && !format.integerSeparator) {\n format.integerSeparator = colType.thousands;\n }\n } else {\n format.decimal = format.decimal || '';\n format.integerSeparator = format.integerSeparator || '';\n }\n return format;\n }\n\n /** Remove extension */\n destroy() {\n if (!this.initialized) {\n return;\n }\n // unsubscribe to events\n this.emitter.off(EVENTS, () => this.calcAll());\n\n this.initialized = false;\n }\n\n}\n",
@@ -2446,7 +2493,7 @@
"lineNumber": 1
},
{
- "__docId__": 125,
+ "__docId__": 126,
"kind": "variable",
"name": "EVENTS",
"memberof": "src/extensions/colOps/colOps.js",
@@ -2467,7 +2514,7 @@
"ignore": true
},
{
- "__docId__": 126,
+ "__docId__": 127,
"kind": "variable",
"name": "SUM",
"memberof": "src/extensions/colOps/colOps.js",
@@ -2488,7 +2535,7 @@
"ignore": true
},
{
- "__docId__": 127,
+ "__docId__": 128,
"kind": "variable",
"name": "MEAN",
"memberof": "src/extensions/colOps/colOps.js",
@@ -2509,7 +2556,7 @@
"ignore": true
},
{
- "__docId__": 128,
+ "__docId__": 129,
"kind": "variable",
"name": "MIN",
"memberof": "src/extensions/colOps/colOps.js",
@@ -2530,7 +2577,7 @@
"ignore": true
},
{
- "__docId__": 129,
+ "__docId__": 130,
"kind": "variable",
"name": "MAX",
"memberof": "src/extensions/colOps/colOps.js",
@@ -2551,7 +2598,7 @@
"ignore": true
},
{
- "__docId__": 130,
+ "__docId__": 131,
"kind": "variable",
"name": "MEDIAN",
"memberof": "src/extensions/colOps/colOps.js",
@@ -2572,7 +2619,7 @@
"ignore": true
},
{
- "__docId__": 131,
+ "__docId__": 132,
"kind": "variable",
"name": "Q1",
"memberof": "src/extensions/colOps/colOps.js",
@@ -2593,7 +2640,7 @@
"ignore": true
},
{
- "__docId__": 132,
+ "__docId__": 133,
"kind": "variable",
"name": "Q3",
"memberof": "src/extensions/colOps/colOps.js",
@@ -2614,7 +2661,7 @@
"ignore": true
},
{
- "__docId__": 133,
+ "__docId__": 134,
"kind": "class",
"name": "ColOps",
"memberof": "src/extensions/colOps/colOps.js",
@@ -2632,7 +2679,7 @@
]
},
{
- "__docId__": 134,
+ "__docId__": 135,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2667,7 +2714,7 @@
]
},
{
- "__docId__": 135,
+ "__docId__": 136,
"kind": "member",
"name": "onBeforeOperation",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2686,7 +2733,7 @@
}
},
{
- "__docId__": 136,
+ "__docId__": 137,
"kind": "member",
"name": "onAfterOperation",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2705,7 +2752,7 @@
}
},
{
- "__docId__": 137,
+ "__docId__": 138,
"kind": "member",
"name": "opts",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2724,7 +2771,7 @@
}
},
{
- "__docId__": 138,
+ "__docId__": 139,
"kind": "member",
"name": "labelIds",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2743,7 +2790,7 @@
}
},
{
- "__docId__": 139,
+ "__docId__": 140,
"kind": "member",
"name": "colIndexes",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2762,7 +2809,7 @@
}
},
{
- "__docId__": 140,
+ "__docId__": 141,
"kind": "member",
"name": "operations",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2781,7 +2828,7 @@
}
},
{
- "__docId__": 141,
+ "__docId__": 142,
"kind": "member",
"name": "outputTypes",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2800,7 +2847,7 @@
}
},
{
- "__docId__": 142,
+ "__docId__": 143,
"kind": "member",
"name": "formatResults",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2819,7 +2866,7 @@
}
},
{
- "__docId__": 143,
+ "__docId__": 144,
"kind": "member",
"name": "totRowIndexes",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2838,7 +2885,7 @@
}
},
{
- "__docId__": 144,
+ "__docId__": 145,
"kind": "member",
"name": "excludeRows",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2857,7 +2904,7 @@
}
},
{
- "__docId__": 145,
+ "__docId__": 146,
"kind": "member",
"name": "decimalPrecisions",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2876,7 +2923,7 @@
}
},
{
- "__docId__": 146,
+ "__docId__": 147,
"kind": "method",
"name": "init",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2891,7 +2938,7 @@
"return": null
},
{
- "__docId__": 147,
+ "__docId__": 148,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2913,7 +2960,7 @@
}
},
{
- "__docId__": 148,
+ "__docId__": 149,
"kind": "method",
"name": "calcAll",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2928,7 +2975,7 @@
"return": null
},
{
- "__docId__": 149,
+ "__docId__": 150,
"kind": "method",
"name": "columnCalc",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -2989,7 +3036,7 @@
}
},
{
- "__docId__": 150,
+ "__docId__": 151,
"kind": "method",
"name": "calc",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3047,10 +3094,11 @@
],
"spread": false,
"description": ""
- }
+ },
+ "ignore": true
},
{
- "__docId__": 151,
+ "__docId__": 152,
"kind": "method",
"name": "calcSum",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3091,7 +3139,7 @@
}
},
{
- "__docId__": 152,
+ "__docId__": 153,
"kind": "method",
"name": "calcMean",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3132,7 +3180,7 @@
}
},
{
- "__docId__": 153,
+ "__docId__": 154,
"kind": "method",
"name": "calcMax",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3173,7 +3221,7 @@
}
},
{
- "__docId__": 154,
+ "__docId__": 155,
"kind": "method",
"name": "calcMin",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3214,7 +3262,7 @@
}
},
{
- "__docId__": 155,
+ "__docId__": 156,
"kind": "method",
"name": "calcMedian",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3255,7 +3303,7 @@
}
},
{
- "__docId__": 156,
+ "__docId__": 157,
"kind": "method",
"name": "calcQ1",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3296,7 +3344,7 @@
}
},
{
- "__docId__": 157,
+ "__docId__": 158,
"kind": "method",
"name": "calcQ3",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3337,7 +3385,7 @@
}
},
{
- "__docId__": 158,
+ "__docId__": 159,
"kind": "method",
"name": "sortColumnValues",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3388,7 +3436,7 @@
}
},
{
- "__docId__": 159,
+ "__docId__": 160,
"kind": "method",
"name": "writeResult",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3447,10 +3495,11 @@
"description": "Applied decimal precision"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 160,
+ "__docId__": 161,
"kind": "method",
"name": "configureFormat",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3498,10 +3547,11 @@
],
"spread": false,
"description": ""
- }
+ },
+ "ignore": true
},
{
- "__docId__": 161,
+ "__docId__": 162,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
@@ -3516,7 +3566,7 @@
"return": null
},
{
- "__docId__": 163,
+ "__docId__": 164,
"kind": "file",
"name": "src/extensions/colsVisibility/colsVisibility.js",
"content": "import {Feature} from '../../feature';\nimport {\n addClass, removeClass, createCheckItem, createElm, elm, removeElm,\n getText, tag\n} from '../../dom';\nimport {isUndef, EMPTY_FN, isNull} from '../../types';\nimport {addEvt, targetEvt, removeEvt} from '../../event';\nimport {root} from '../../root';\nimport {NONE} from '../../const';\nimport {\n defaultsBool, defaultsStr, defaultsFn, defaultsNb, defaultsArr\n} from '../../settings';\nimport {RIGHT} from '../../modules/toolbar';\n\n/**\n * Columns Visibility extension\n */\nexport default class ColsVisibility extends Feature {\n\n /**\n * Creates an instance of ColsVisibility\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} Configuration object\n */\n constructor(tf, f) {\n super(tf, f.name);\n\n // Configuration object\n let cfg = this.config;\n\n /**\n * Module name\n * @type {String}\n */\n this.name = f.name;\n\n /**\n * Module description\n * @type {String}\n */\n this.desc = defaultsStr(f.description, 'Columns visibility manager');\n\n /**\n * show/hide columns container element\n * @private\n */\n this.spanEl = null;\n\n /**\n * show/hide columns button element\n * @private\n */\n this.btnEl = null;\n\n /**\n * show/hide columns main container element\n * @private\n */\n this.contEl = null;\n\n /**\n * Enable tick to hide a column, defaults to true\n * @type {Boolean}\n */\n this.tickToHide = defaultsBool(f.tick_to_hide, true);\n\n /**\n * Enable columns manager UI, defaults to true\n * @type {Boolean}\n */\n this.manager = defaultsBool(f.manager, true);\n\n /**\n * Headers HTML table reference only if headers are external\n * @type {DOMElement}\n */\n this.headersTbl = f.headers_table || null;\n\n /**\n * Headers row index only if headers are external\n * @type {Number}\n */\n this.headersIndex = defaultsNb(f.headers_index, 1);\n\n /**\n * ID of main container element\n * @type {String}\n */\n this.contElTgtId = defaultsStr(f.container_target_id, null);\n\n /**\n * Alternative text for column headers in column manager UI\n * @type {Array}\n */\n this.headersText = defaultsArr(f.headers_text, []);\n\n /**\n * ID of button's container element\n * @type {String}\n */\n this.btnTgtId = defaultsStr(f.btn_target_id, null);\n\n /**\n * Button's text, defaults to Columns▼\n * @type {String}\n */\n this.btnText = defaultsStr(f.btn_text, 'Columns▼');\n\n /**\n * Button's inner HTML\n * @type {String}\n */\n this.btnHtml = defaultsStr(f.btn_html, null);\n\n /**\n * Css class for button\n * @type {String}\n */\n this.btnCssClass = defaultsStr(f.btn_css_class, 'colVis');\n\n /**\n * Columns manager UI close link text, defaults to 'Close'\n * @type {String}\n */\n this.btnCloseText = defaultsStr(f.btn_close_text, 'Close');\n\n /**\n * Columns manager UI close link HTML\n * @type {String}\n */\n this.btnCloseHtml = defaultsStr(f.btn_close_html, null);\n\n /**\n * Css for columns manager UI close link\n * @type {String}\n */\n this.btnCloseCssClass = defaultsStr(f.btn_close_css_class,\n this.btnCssClass);\n\n /**\n * Extension's stylesheet filename\n * @type {String}\n */\n this.stylesheet = defaultsStr(f.stylesheet, 'colsVisibility.css');\n\n /**\n * Css for columns manager UI span\n * @type {String}\n */\n this.spanCssClass = defaultsStr(f.span_css_class, 'colVisSpan');\n\n /**\n * Css for columns manager UI main container\n * @type {String}\n */\n this.contCssClass = defaultsStr(f.cont_css_class, 'colVisCont');\n\n /**\n * Css for columns manager UI checklist (ul)\n * @type {String}\n */\n this.listCssClass = defaultsStr(cfg.list_css_class, 'cols_checklist');\n\n /**\n * Css for columns manager UI checklist item (li)\n * @type {String}\n */\n this.listItemCssClass = defaultsStr(cfg.checklist_item_css_class,\n 'cols_checklist_item');\n\n /**\n * Css for columns manager UI checklist item selected state (li)\n * @type {String}\n */\n this.listSlcItemCssClass = defaultsStr(\n cfg.checklist_selected_item_css_class,\n 'cols_checklist_slc_item'\n );\n\n /**\n * Text preceding the columns list, defaults to 'Hide' or 'Show'\n * depending on tick mode (tick_to_hide option)\n * @type {String}\n */\n this.text = defaultsStr(f.text, this.tickToHide ? 'Hide: ' : 'Show: ');\n\n /**\n * List of columns indexes to be hidden at initialization\n * @type {Array}\n */\n this.atStart = defaultsArr(f.at_start, []);\n\n /**\n * Enable hover behaviour on columns manager button/link\n * @type {Boolean}\n */\n this.enableHover = Boolean(f.enable_hover);\n\n /**\n * Enable select all option, disabled by default\n * @type {Boolean}\n */\n this.enableTickAll = Boolean(f.enable_tick_all);\n\n /**\n * Text for select all option, defaults to 'Select all:'\n * @type {String}\n */\n this.tickAllText = defaultsStr(f.tick_all_text, 'Select all:');\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, RIGHT);\n\n /**\n * List of indexes of hidden columns\n * @private\n */\n this.hiddenCols = [];\n\n /**\n * Bound mouseup wrapper\n * @private\n */\n this.boundMouseup = null;\n\n /**\n * Callback fired when the extension is initialized\n * @type {Function}\n */\n this.onLoaded = defaultsFn(f.on_loaded, EMPTY_FN);\n\n /**\n * Callback fired before the columns manager is opened\n * @type {Function}\n */\n this.onBeforeOpen = defaultsFn(f.on_before_open, EMPTY_FN);\n\n /**\n * Callback fired after the columns manager is opened\n * @type {Function}\n */\n this.onAfterOpen = defaultsFn(f.on_after_open, EMPTY_FN);\n\n /**\n * Callback fired before the columns manager is closed\n * @type {Function}\n */\n this.onBeforeClose = defaultsFn(f.on_before_close, EMPTY_FN);\n\n /**\n * Callback fired after the columns manager is closed\n * @type {Function}\n */\n this.onAfterClose = defaultsFn(f.on_after_close, EMPTY_FN);\n\n /**\n * Callback fired before a column is hidden\n * @type {Function}\n */\n this.onBeforeColHidden = defaultsFn(f.on_before_col_hidden, EMPTY_FN);\n\n /**\n * Callback fired after a column is hidden\n * @type {Function}\n */\n this.onAfterColHidden = defaultsFn(f.on_after_col_hidden, EMPTY_FN);\n\n /**\n * Callback fired before a column is displayed\n * @type {Function}\n */\n this.onBeforeColDisplayed = defaultsFn(f.on_before_col_displayed,\n EMPTY_FN);\n\n /**\n * Callback fired after a column is displayed\n * @type {Function}\n */\n this.onAfterColDisplayed = defaultsFn(f.on_after_col_displayed,\n EMPTY_FN);\n\n //Grid layout support\n if (tf.gridLayout) {\n this.headersTbl = tf.feature('gridLayout').headTbl; //headers table\n this.headersIndex = 0; //headers index\n }\n\n //Loads extension stylesheet\n tf.import(f.name + 'Style', tf.getStylePath() + this.stylesheet, null,\n 'link');\n\n this.enable();\n }\n\n /**\n * Mouse-up event handler handling popup auto-close behaviour\n * @private\n */\n onMouseup(evt) {\n let targetElm = targetEvt(evt);\n\n while (targetElm && targetElm !== this.contEl\n && targetElm !== this.btnEl) {\n targetElm = targetElm.parentNode;\n }\n\n if (targetElm !== this.contEl && targetElm !== this.btnEl) {\n this.toggle();\n }\n\n return;\n }\n\n /**\n * Toggle columns manager UI\n */\n toggle() {\n // ensure mouseup event handler is removed\n removeEvt(root, 'mouseup', this.boundMouseup);\n\n let contDisplay = this.contEl.style.display;\n\n if (contDisplay !== 'inline') {\n this.onBeforeOpen(this);\n }\n if (contDisplay === 'inline') {\n this.onBeforeClose(this);\n }\n\n this.contEl.style.display = contDisplay === 'inline' ?\n NONE : 'inline';\n\n if (contDisplay !== 'inline') {\n this.onAfterOpen(this);\n addEvt(root, 'mouseup', this.boundMouseup);\n }\n if (contDisplay === 'inline') {\n this.onAfterClose(this);\n }\n }\n\n /**\n * Check an item in columns manager UI\n * @private\n */\n checkItem(lbl) {\n let li = lbl.parentNode;\n if (!li || !lbl) {\n return;\n }\n let isChecked = lbl.firstChild.checked;\n let colIndex = lbl.firstChild.getAttribute('id').split('_')[1];\n colIndex = parseInt(colIndex, 10);\n if (isChecked) {\n addClass(li, this.listSlcItemCssClass);\n } else {\n removeClass(li, this.listSlcItemCssClass);\n }\n\n let hide = false;\n if ((this.tickToHide && isChecked) ||\n (!this.tickToHide && !isChecked)) {\n hide = true;\n }\n this.setHidden(colIndex, hide);\n }\n\n /**\n * Initializes ColsVisibility instance\n */\n init() {\n if (this.initialized || !this.manager) {\n return;\n }\n\n this.emitter.emit('initializing-extension', this,\n !isNull(this.btnTgtId));\n\n this.emitter.on(['hide-column'],\n (tf, colIndex) => this.hideCol(colIndex));\n\n this.buildBtn();\n this.buildManager();\n\n /** @inherited */\n this.initialized = true;\n\n this.boundMouseup = this.onMouseup.bind(this);\n\n this.emitter.emit('columns-visibility-initialized', this.tf, this);\n this.emitter.emit('extension-initialized', this);\n\n // Hide columns at start at very end of initialization, do not move\n // as order is important\n this._hideAtStart();\n }\n\n /**\n * Build main button UI\n */\n buildBtn() {\n if (this.btnEl) {\n return;\n }\n let tf = this.tf;\n let span = createElm('span');\n span.className = this.spanCssClass;\n\n // Container element (rdiv or custom element)\n let targetEl = !this.btnTgtId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.btnTgtId);\n\n if (!this.btnTgtId) {\n let firstChild = targetEl.firstChild;\n firstChild.parentNode.insertBefore(span, firstChild);\n } else {\n targetEl.appendChild(span);\n }\n\n if (!this.btnHtml) {\n let btn = createElm('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 addEvt(btn, 'click', (evt) => this.toggle(evt));\n } else {\n addEvt(btn, 'mouseover', (evt) => this.toggle(evt));\n }\n } else { // Custom html\n span.innerHTML = this.btnHtml;\n let colVisEl = span.firstChild;\n if (!this.enableHover) {\n addEvt(colVisEl, 'click', (evt) => this.toggle(evt));\n } else {\n addEvt(colVisEl, 'mouseover', (evt) => this.toggle(evt));\n }\n }\n\n this.spanEl = span;\n this.btnEl = this.spanEl.firstChild;\n\n this.onLoaded(this);\n }\n\n /**\n * Build columns manager UI\n */\n buildManager() {\n let tf = this.tf;\n\n let container = !this.contElTgtId ?\n createElm('div') :\n elm(this.contElTgtId);\n container.className = this.contCssClass;\n\n //Extension description\n let extNameLabel = createElm('p');\n extNameLabel.innerHTML = this.text;\n container.appendChild(extNameLabel);\n\n //Headers list\n let ul = createElm('ul');\n ul.className = this.listCssClass;\n\n let tbl = this.headersTbl || tf.dom();\n let headerIndex = this.headersTbl ?\n this.headersIndex : tf.getHeadersRowIndex();\n let headerRow = tbl.rows[headerIndex];\n\n //Tick all option\n if (this.enableTickAll) {\n let li = createCheckItem('col__' + tf.id, this.tickAllText,\n this.tickAllText);\n addClass(li, this.listItemCssClass);\n ul.appendChild(li);\n li.check.checked = !this.tickToHide;\n\n addEvt(li.check, 'click', () => {\n for (let h = 0; h < headerRow.cells.length; h++) {\n let itm = elm('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 (let i = 0; i < headerRow.cells.length; i++) {\n let cell = headerRow.cells[i];\n let cellText = this.headersText[i] || this._getHeaderText(cell);\n let liElm = createCheckItem('col_' + i + '_' + tf.id, cellText,\n cellText);\n addClass(liElm, this.listItemCssClass);\n if (!this.tickToHide) {\n addClass(liElm, this.listSlcItemCssClass);\n }\n ul.appendChild(liElm);\n if (!this.tickToHide) {\n liElm.check.checked = true;\n }\n\n addEvt(liElm.check, 'click', (evt) => {\n let elm = targetEvt(evt);\n let lbl = elm.parentNode;\n this.checkItem(lbl);\n });\n }\n\n //separator\n let p = createElm('p', ['align', 'center']);\n let btn;\n //Close link\n if (!this.btnCloseHtml) {\n btn = createElm('a', ['href', 'javascript:;']);\n btn.className = this.btnCloseCssClass;\n btn.innerHTML = this.btnCloseText;\n addEvt(btn, 'click', (evt) => this.toggle(evt));\n p.appendChild(btn);\n } else {\n p.innerHTML = this.btnCloseHtml;\n btn = p.firstChild;\n addEvt(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\n /**\n * Hide or show specified columns\n * @param {Number} colIndex Column index\n * @param {Boolean} hide Hide column if true or show if false\n */\n setHidden(colIndex, hide) {\n let tf = this.tf;\n let tbl = tf.dom();\n\n if (hide) {\n this.onBeforeColHidden(this, colIndex);\n } else {\n this.onBeforeColDisplayed(this, colIndex);\n }\n\n this._hideElements(tbl, colIndex, hide);\n if (this.headersTbl) {\n this._hideElements(this.headersTbl, colIndex, hide);\n }\n\n let hiddenCols = this.hiddenCols;\n let itemIndex = hiddenCols.indexOf(colIndex);\n if (hide) {\n if (itemIndex === -1) {\n this.hiddenCols.push(colIndex);\n }\n } else {\n if (itemIndex !== -1) {\n this.hiddenCols.splice(itemIndex, 1);\n }\n }\n\n if (hide) {\n this.onAfterColHidden(this, colIndex);\n this.emitter.emit('column-hidden', tf, this, colIndex,\n this.hiddenCols);\n } else {\n this.onAfterColDisplayed(this, colIndex);\n this.emitter.emit('column-shown', tf, this, colIndex,\n this.hiddenCols);\n }\n }\n\n /**\n * Show specified column\n * @param {Number} colIndex Column index\n */\n showCol(colIndex) {\n if (isUndef(colIndex) || !this.isColHidden(colIndex)) {\n return;\n }\n if (this.manager && this.contEl) {\n let itm = elm('col_' + colIndex + '_' + this.tf.id);\n if (itm) {\n itm.click();\n }\n } else {\n this.setHidden(colIndex, false);\n }\n }\n\n /**\n * Hide specified column\n * @param {Number} colIndex Column index\n */\n hideCol(colIndex) {\n if (isUndef(colIndex) || this.isColHidden(colIndex)) {\n return;\n }\n if (this.manager && this.contEl) {\n let itm = elm('col_' + colIndex + '_' + this.tf.id);\n if (itm) {\n itm.click();\n }\n } else {\n this.setHidden(colIndex, true);\n }\n }\n\n /**\n * Determine if specified column is hidden\n * @param {Number} colIndex Column index\n */\n isColHidden(colIndex) {\n if (this.hiddenCols.indexOf(colIndex) !== -1) {\n return true;\n }\n return false;\n }\n\n /**\n * Toggle visibility of specified column\n * @param {Number} colIndex Column index\n */\n toggleCol(colIndex) {\n if (isUndef(colIndex) || this.isColHidden(colIndex)) {\n this.showCol(colIndex);\n } else {\n this.hideCol(colIndex);\n }\n }\n\n /**\n * Return the indexes of the columns currently hidden\n * @return {Array} column indexes\n */\n getHiddenCols() {\n return this.hiddenCols;\n }\n\n /**\n * Remove the columns manager\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n if (elm(this.contElTgtId)) {\n elm(this.contElTgtId).innerHTML = '';\n } else {\n this.contEl.innerHTML = '';\n removeElm(this.contEl);\n this.contEl = null;\n }\n this.btnEl.innerHTML = '';\n removeElm(this.btnEl);\n this.btnEl = null;\n\n this.emitter.off(['hide-column'],\n (tf, colIndex) => this.hideCol(colIndex));\n\n this.boundMouseup = null;\n\n this.initialized = false;\n }\n\n _getHeaderText(cell) {\n if (!cell.hasChildNodes) {\n return '';\n }\n\n for (let i = 0; i < cell.childNodes.length; i++) {\n let n = cell.childNodes[i];\n if (n.nodeType === 3) {\n return n.nodeValue;\n } else if (n.nodeType === 1) {\n if (n.id && n.id.indexOf('popUp') !== -1) {\n continue;\n } else {\n return getText(n);\n }\n }\n continue;\n }\n return '';\n }\n\n _hideElements(tbl, colIdx, hide) {\n this._hideCells(tbl, colIdx, hide);\n this._hideCol(tbl, colIdx, hide);\n }\n\n _hideCells(tbl, colIdx, hide) {\n for (let i = 0; i < tbl.rows.length; i++) {\n let row = tbl.rows[i];\n let cell = row.cells[colIdx];\n if (cell) {\n cell.style.display = hide ? NONE : '';\n }\n }\n }\n\n _hideCol(tbl, colIdx, hide) {\n let colElms = tag(this.tf.dom(), 'col');\n if (colElms.length === 0) {\n return;\n }\n colElms[colIdx].style.display = hide ? NONE : '';\n }\n\n _hideAtStart() {\n this.atStart.forEach((colIdx) => {\n this.hideCol(colIdx);\n });\n }\n}\n",
@@ -3527,7 +3577,7 @@
"lineNumber": 1
},
{
- "__docId__": 164,
+ "__docId__": 165,
"kind": "class",
"name": "ColsVisibility",
"memberof": "src/extensions/colsVisibility/colsVisibility.js",
@@ -3545,7 +3595,7 @@
]
},
{
- "__docId__": 165,
+ "__docId__": 166,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3580,7 +3630,7 @@
]
},
{
- "__docId__": 166,
+ "__docId__": 167,
"kind": "member",
"name": "name",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3599,7 +3649,7 @@
}
},
{
- "__docId__": 167,
+ "__docId__": 168,
"kind": "member",
"name": "desc",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3618,7 +3668,7 @@
}
},
{
- "__docId__": 168,
+ "__docId__": 169,
"kind": "member",
"name": "spanEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3627,22 +3677,7 @@
"access": "private",
"description": "show/hide columns container element",
"lineNumber": 47,
- "type": {
- "types": [
- "*"
- ]
- }
- },
- {
- "__docId__": 169,
- "kind": "member",
- "name": "btnEl",
- "memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
- "static": false,
- "longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnEl",
- "access": "private",
- "description": "show/hide columns button element",
- "lineNumber": 53,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -3652,13 +3687,14 @@
{
"__docId__": 170,
"kind": "member",
- "name": "contEl",
+ "name": "btnEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
- "longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contEl",
+ "longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnEl",
"access": "private",
- "description": "show/hide columns main container element",
- "lineNumber": 59,
+ "description": "show/hide columns button element",
+ "lineNumber": 53,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -3668,6 +3704,23 @@
{
"__docId__": 171,
"kind": "member",
+ "name": "contEl",
+ "memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
+ "static": false,
+ "longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contEl",
+ "access": "private",
+ "description": "show/hide columns main container element",
+ "lineNumber": 59,
+ "ignore": true,
+ "type": {
+ "types": [
+ "*"
+ ]
+ }
+ },
+ {
+ "__docId__": 172,
+ "kind": "member",
"name": "tickToHide",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
@@ -3685,7 +3738,7 @@
}
},
{
- "__docId__": 172,
+ "__docId__": 173,
"kind": "member",
"name": "manager",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3704,7 +3757,7 @@
}
},
{
- "__docId__": 173,
+ "__docId__": 174,
"kind": "member",
"name": "headersTbl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3723,7 +3776,7 @@
}
},
{
- "__docId__": 174,
+ "__docId__": 175,
"kind": "member",
"name": "headersIndex",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3742,7 +3795,7 @@
}
},
{
- "__docId__": 175,
+ "__docId__": 176,
"kind": "member",
"name": "contElTgtId",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3761,7 +3814,7 @@
}
},
{
- "__docId__": 176,
+ "__docId__": 177,
"kind": "member",
"name": "headersText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3780,7 +3833,7 @@
}
},
{
- "__docId__": 177,
+ "__docId__": 178,
"kind": "member",
"name": "btnTgtId",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3799,7 +3852,7 @@
}
},
{
- "__docId__": 178,
+ "__docId__": 179,
"kind": "member",
"name": "btnText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3818,7 +3871,7 @@
}
},
{
- "__docId__": 179,
+ "__docId__": 180,
"kind": "member",
"name": "btnHtml",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3837,7 +3890,7 @@
}
},
{
- "__docId__": 180,
+ "__docId__": 181,
"kind": "member",
"name": "btnCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3856,7 +3909,7 @@
}
},
{
- "__docId__": 181,
+ "__docId__": 182,
"kind": "member",
"name": "btnCloseText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3875,7 +3928,7 @@
}
},
{
- "__docId__": 182,
+ "__docId__": 183,
"kind": "member",
"name": "btnCloseHtml",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3894,7 +3947,7 @@
}
},
{
- "__docId__": 183,
+ "__docId__": 184,
"kind": "member",
"name": "btnCloseCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3913,7 +3966,7 @@
}
},
{
- "__docId__": 184,
+ "__docId__": 185,
"kind": "member",
"name": "stylesheet",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3932,7 +3985,7 @@
}
},
{
- "__docId__": 185,
+ "__docId__": 186,
"kind": "member",
"name": "spanCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3951,7 +4004,7 @@
}
},
{
- "__docId__": 186,
+ "__docId__": 187,
"kind": "member",
"name": "contCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3970,7 +4023,7 @@
}
},
{
- "__docId__": 187,
+ "__docId__": 188,
"kind": "member",
"name": "listCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -3989,7 +4042,7 @@
}
},
{
- "__docId__": 188,
+ "__docId__": 189,
"kind": "member",
"name": "listItemCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4008,7 +4061,7 @@
}
},
{
- "__docId__": 189,
+ "__docId__": 190,
"kind": "member",
"name": "listSlcItemCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4027,7 +4080,7 @@
}
},
{
- "__docId__": 190,
+ "__docId__": 191,
"kind": "member",
"name": "text",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4046,7 +4099,7 @@
}
},
{
- "__docId__": 191,
+ "__docId__": 192,
"kind": "member",
"name": "atStart",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4065,7 +4118,7 @@
}
},
{
- "__docId__": 192,
+ "__docId__": 193,
"kind": "member",
"name": "enableHover",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4084,7 +4137,7 @@
}
},
{
- "__docId__": 193,
+ "__docId__": 194,
"kind": "member",
"name": "enableTickAll",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4103,7 +4156,7 @@
}
},
{
- "__docId__": 194,
+ "__docId__": 195,
"kind": "member",
"name": "tickAllText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4122,7 +4175,7 @@
}
},
{
- "__docId__": 195,
+ "__docId__": 196,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4141,7 +4194,7 @@
}
},
{
- "__docId__": 196,
+ "__docId__": 197,
"kind": "member",
"name": "hiddenCols",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4150,6 +4203,7 @@
"access": "private",
"description": "List of indexes of hidden columns",
"lineNumber": 221,
+ "ignore": true,
"type": {
"types": [
"*[]"
@@ -4157,7 +4211,7 @@
}
},
{
- "__docId__": 197,
+ "__docId__": 198,
"kind": "member",
"name": "boundMouseup",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4166,6 +4220,7 @@
"access": "private",
"description": "Bound mouseup wrapper",
"lineNumber": 227,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -4173,7 +4228,7 @@
}
},
{
- "__docId__": 198,
+ "__docId__": 199,
"kind": "member",
"name": "onLoaded",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4192,7 +4247,7 @@
}
},
{
- "__docId__": 199,
+ "__docId__": 200,
"kind": "member",
"name": "onBeforeOpen",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4211,7 +4266,7 @@
}
},
{
- "__docId__": 200,
+ "__docId__": 201,
"kind": "member",
"name": "onAfterOpen",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4230,7 +4285,7 @@
}
},
{
- "__docId__": 201,
+ "__docId__": 202,
"kind": "member",
"name": "onBeforeClose",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4249,7 +4304,7 @@
}
},
{
- "__docId__": 202,
+ "__docId__": 203,
"kind": "member",
"name": "onAfterClose",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4268,7 +4323,7 @@
}
},
{
- "__docId__": 203,
+ "__docId__": 204,
"kind": "member",
"name": "onBeforeColHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4287,7 +4342,7 @@
}
},
{
- "__docId__": 204,
+ "__docId__": 205,
"kind": "member",
"name": "onAfterColHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4306,7 +4361,7 @@
}
},
{
- "__docId__": 205,
+ "__docId__": 206,
"kind": "member",
"name": "onBeforeColDisplayed",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4325,7 +4380,7 @@
}
},
{
- "__docId__": 206,
+ "__docId__": 207,
"kind": "member",
"name": "onAfterColDisplayed",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4344,7 +4399,7 @@
}
},
{
- "__docId__": 209,
+ "__docId__": 210,
"kind": "method",
"name": "onMouseup",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4355,6 +4410,7 @@
"access": "private",
"description": "Mouse-up event handler handling popup auto-close behaviour",
"lineNumber": 302,
+ "ignore": true,
"params": [
{
"name": "evt",
@@ -4366,7 +4422,7 @@
"return": null
},
{
- "__docId__": 210,
+ "__docId__": 211,
"kind": "method",
"name": "toggle",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4381,7 +4437,7 @@
"return": null
},
{
- "__docId__": 211,
+ "__docId__": 212,
"kind": "method",
"name": "checkItem",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4392,6 +4448,7 @@
"access": "private",
"description": "Check an item in columns manager UI",
"lineNumber": 349,
+ "ignore": true,
"params": [
{
"name": "lbl",
@@ -4403,7 +4460,7 @@
"return": null
},
{
- "__docId__": 212,
+ "__docId__": 213,
"kind": "method",
"name": "init",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4418,7 +4475,7 @@
"return": null
},
{
- "__docId__": 213,
+ "__docId__": 214,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4440,7 +4497,7 @@
}
},
{
- "__docId__": 215,
+ "__docId__": 216,
"kind": "method",
"name": "buildBtn",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4455,7 +4512,7 @@
"return": null
},
{
- "__docId__": 218,
+ "__docId__": 219,
"kind": "method",
"name": "buildManager",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4470,7 +4527,7 @@
"return": null
},
{
- "__docId__": 220,
+ "__docId__": 221,
"kind": "method",
"name": "setHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4506,7 +4563,7 @@
"return": null
},
{
- "__docId__": 221,
+ "__docId__": 222,
"kind": "method",
"name": "showCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4532,7 +4589,7 @@
"return": null
},
{
- "__docId__": 222,
+ "__docId__": 223,
"kind": "method",
"name": "hideCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4558,7 +4615,7 @@
"return": null
},
{
- "__docId__": 223,
+ "__docId__": 224,
"kind": "method",
"name": "isColHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4588,7 +4645,7 @@
}
},
{
- "__docId__": 224,
+ "__docId__": 225,
"kind": "method",
"name": "toggleCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4614,7 +4671,7 @@
"return": null
},
{
- "__docId__": 225,
+ "__docId__": 226,
"kind": "method",
"name": "getHiddenCols",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4636,7 +4693,7 @@
"params": []
},
{
- "__docId__": 226,
+ "__docId__": 227,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4651,7 +4708,7 @@
"return": null
},
{
- "__docId__": 231,
+ "__docId__": 232,
"kind": "method",
"name": "_getHeaderText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4663,6 +4720,7 @@
"description": null,
"lineNumber": 676,
"undocument": true,
+ "ignore": true,
"params": [
{
"name": "cell",
@@ -4678,7 +4736,7 @@
}
},
{
- "__docId__": 232,
+ "__docId__": 233,
"kind": "method",
"name": "_hideElements",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
@@ -4690,41 +4748,7 @@
"description": null,
"lineNumber": 697,
"undocument": true,
- "params": [
- {
- "name": "tbl",
- "types": [
- "*"
- ]
- },
- {
- "name": "colIdx",
- "types": [
- "*"
- ]
- },
- {
- "name": "hide",
- "types": [
- "*"
- ]
- }
- ],
- "return": null
- },
- {
- "__docId__": 233,
- "kind": "method",
- "name": "_hideCells",
- "memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
- "generator": false,
- "async": false,
- "static": false,
- "longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideCells",
- "access": "private",
- "description": null,
- "lineNumber": 702,
- "undocument": true,
+ "ignore": true,
"params": [
{
"name": "tbl",
@@ -4750,16 +4774,17 @@
{
"__docId__": 234,
"kind": "method",
- "name": "_hideCol",
+ "name": "_hideCells",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
- "longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideCol",
+ "longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideCells",
"access": "private",
"description": null,
- "lineNumber": 712,
+ "lineNumber": 702,
"undocument": true,
+ "ignore": true,
"params": [
{
"name": "tbl",
@@ -4785,6 +4810,42 @@
{
"__docId__": 235,
"kind": "method",
+ "name": "_hideCol",
+ "memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
+ "generator": false,
+ "async": false,
+ "static": false,
+ "longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideCol",
+ "access": "private",
+ "description": null,
+ "lineNumber": 712,
+ "undocument": true,
+ "ignore": true,
+ "params": [
+ {
+ "name": "tbl",
+ "types": [
+ "*"
+ ]
+ },
+ {
+ "name": "colIdx",
+ "types": [
+ "*"
+ ]
+ },
+ {
+ "name": "hide",
+ "types": [
+ "*"
+ ]
+ }
+ ],
+ "return": null
+ },
+ {
+ "__docId__": 236,
+ "kind": "method",
"name": "_hideAtStart",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
@@ -4795,11 +4856,12 @@
"description": null,
"lineNumber": 720,
"undocument": true,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 236,
+ "__docId__": 237,
"kind": "file",
"name": "src/extensions/filtersVisibility/filtersVisibility.js",
"content": "import {Feature} from '../../feature';\nimport {createElm, removeElm, elm} from '../../dom';\nimport {EMPTY_FN, isNull} from '../../types';\nimport {addEvt} from '../../event';\nimport {\n defaultsBool, defaultsStr, defaultsFn, defaultsNb,\n} from '../../settings';\nimport {RIGHT} from '../../modules/toolbar';\n\n/**\n * Filters Visibility extension\n */\nexport default class FiltersVisibility extends Feature {\n\n /**\n * Creates an instance of FiltersVisibility\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} Configuration object\n */\n constructor(tf, f) {\n super(tf, f.name);\n\n /**\n * Module name\n * @type {String}\n */\n this.name = f.name;\n\n /**\n * Module description\n * @type {String}\n */\n this.desc = defaultsStr(f.description,\n 'Filters row visibility manager');\n\n /**\n * Extension's stylesheet filename\n * @type {String}\n */\n this.stylesheet = defaultsStr(f.stylesheet , 'filtersVisibility.css');\n\n /**\n * Expand icon filename\n * @type {String}\n */\n this.icnExpand = defaultsStr(f.expand_icon_name, 'icn_exp.png');\n\n /**\n * Collapse icon filename\n * @type {String}\n */\n this.icnCollapse = defaultsStr(f.collapse_icon_name, 'icn_clp.png');\n\n /**\n * Main container element\n * @private\n */\n this.contEl = null;\n\n /**\n * Button element\n * @private\n */\n this.btnEl = null;\n\n /**\n * Expand icon HTML\n * @private\n */\n this.icnExpandHtml = '
';\n\n /**\n * Collapse icon HTML\n * @private\n */\n this.icnCollapseHtml = '
';\n\n /**\n * Default text\n * @private\n */\n this.defaultText = 'Toggle filters';\n\n /**\n * ID of main container element\n * @type {String}\n */\n this.targetId = f.target_id || null;\n\n /**\n * Enable expand/collapse icon, defaults to true\n * @type {Boolean}\n */\n this.enableIcon = defaultsBool(f.enable_icon, true);\n\n /**\n * Custom text for button\n * @type {String}\n */\n this.btnText = defaultsStr(f.btn_text, '');\n\n /**\n * Collapse button HTML\n * @private\n */\n this.collapseBtnHtml = this.enableIcon ?\n this.icnCollapseHtml + this.btnText :\n this.btnText || this.defaultText;\n\n /**\n * Expand button HTML\n * @private\n */\n this.expandBtnHtml = this.enableIcon ?\n this.icnExpandHtml + this.btnText :\n this.btnText || this.defaultText;\n\n /**\n * Button's custom HTML\n * @type {String}\n */\n this.btnHtml = defaultsStr(f.btn_html, null);\n\n /**\n * Css class for expand/collapse filters button\n * @type {String}\n */\n this.btnCssClass = defaultsStr(f.btn_css_class, 'btnExpClpFlt');\n\n /**\n * Css class for main container\n * @type {String}\n */\n this.contCssClass = defaultsStr(f.cont_css_class, 'expClpFlt');\n\n /**\n * Filters row index\n * @type {Number}\n */\n this.filtersRowIndex = defaultsNb(f.filters_row_index,\n tf.getFiltersRowIndex());\n\n /**\n * Make filters visible at initialization, defaults to true\n * @type {Boolean}\n */\n this.visibleAtStart = defaultsNb(f.visible_at_start, true);\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, RIGHT);\n\n /**\n * Callback fired before filters row is shown\n * @type {Function}\n */\n this.onBeforeShow = defaultsFn(f.on_before_show, EMPTY_FN);\n\n /**\n * Callback fired after filters row is shown\n * @type {Function}\n */\n this.onAfterShow = defaultsFn(f.on_after_show, EMPTY_FN);\n\n /**\n * Callback fired before filters row is hidden\n * @type {Function}\n */\n this.onBeforeHide = defaultsFn(f.on_before_hide, EMPTY_FN);\n\n /**\n * Callback fired after filters row is hidden\n * @type {Function}\n */\n this.onAfterHide = defaultsFn(f.on_after_hide, EMPTY_FN);\n\n //Import extension's stylesheet\n tf.import(f.name + 'Style', tf.getStylePath() + this.stylesheet, null,\n 'link');\n\n this.enable();\n }\n\n /**\n * Initialise extension\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n this.emitter.emit('initializing-extension', this,\n !isNull(this.targetId));\n\n this.buildUI();\n\n /** @inherited */\n this.initialized = true;\n\n this.emitter.on(['show-filters'], (tf, visible) => this.show(visible));\n this.emitter.emit('filters-visibility-initialized', this.tf, this);\n this.emitter.emit('extension-initialized', this);\n }\n\n /**\n * Build UI elements\n */\n buildUI() {\n let tf = this.tf;\n let span = createElm('span');\n span.className = this.contCssClass;\n\n // Container element (rdiv or custom element)\n let targetEl = !this.targetId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(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 = createElm('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 addEvt(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.dom();\n let fltRow = tbl.rows[this.filtersRowIndex];\n let isDisplayed = fltRow.style.display === '';\n\n this.show(!isDisplayed);\n }\n\n /**\n * Show or hide filters\n *\n * @param {boolean} [visible=true] Visibility flag\n */\n show(visible = true) {\n let tf = this.tf;\n let tbl = tf.gridLayout ? tf.feature('gridLayout').headTbl : tf.dom();\n let fltRow = tbl.rows[this.filtersRowIndex];\n\n if (visible) {\n this.onBeforeShow(this);\n }\n if (!visible) {\n this.onBeforeHide(this);\n }\n\n fltRow.style.display = visible ? '' : 'none';\n if (this.enableIcon && !this.btnHtml) {\n this.btnEl.innerHTML = visible ?\n this.collapseBtnHtml : this.expandBtnHtml;\n }\n\n if (visible) {\n this.onAfterShow(this);\n }\n if (!visible) {\n this.onAfterHide(this);\n }\n\n this.emitter.emit('filters-toggled', tf, this, visible);\n }\n\n /**\n * Destroy the UI\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n this.emitter.off(['show-filters'], (tf, visible) => this.show(visible));\n\n this.btnEl.innerHTML = '';\n removeElm(this.btnEl);\n this.btnEl = null;\n\n this.contEl.innerHTML = '';\n removeElm(this.contEl);\n this.contEl = null;\n this.initialized = false;\n }\n\n}\n",
@@ -4810,7 +4872,7 @@
"lineNumber": 1
},
{
- "__docId__": 237,
+ "__docId__": 238,
"kind": "class",
"name": "FiltersVisibility",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js",
@@ -4828,7 +4890,7 @@
]
},
{
- "__docId__": 238,
+ "__docId__": 239,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -4863,7 +4925,7 @@
]
},
{
- "__docId__": 239,
+ "__docId__": 240,
"kind": "member",
"name": "name",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -4882,7 +4944,7 @@
}
},
{
- "__docId__": 240,
+ "__docId__": 241,
"kind": "member",
"name": "desc",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -4901,7 +4963,7 @@
}
},
{
- "__docId__": 241,
+ "__docId__": 242,
"kind": "member",
"name": "stylesheet",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -4920,7 +4982,7 @@
}
},
{
- "__docId__": 242,
+ "__docId__": 243,
"kind": "member",
"name": "icnExpand",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -4939,7 +5001,7 @@
}
},
{
- "__docId__": 243,
+ "__docId__": 244,
"kind": "member",
"name": "icnCollapse",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -4958,7 +5020,7 @@
}
},
{
- "__docId__": 244,
+ "__docId__": 245,
"kind": "member",
"name": "contEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -4967,22 +5029,7 @@
"access": "private",
"description": "Main container element",
"lineNumber": 58,
- "type": {
- "types": [
- "*"
- ]
- }
- },
- {
- "__docId__": 245,
- "kind": "member",
- "name": "btnEl",
- "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
- "static": false,
- "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl",
- "access": "private",
- "description": "Button element",
- "lineNumber": 64,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -4992,13 +5039,14 @@
{
"__docId__": 246,
"kind": "member",
- "name": "icnExpandHtml",
+ "name": "btnEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
- "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpandHtml",
+ "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl",
"access": "private",
- "description": "Expand icon HTML",
- "lineNumber": 70,
+ "description": "Button element",
+ "lineNumber": 64,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -5008,13 +5056,14 @@
{
"__docId__": 247,
"kind": "member",
- "name": "icnCollapseHtml",
+ "name": "icnExpandHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
- "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapseHtml",
+ "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpandHtml",
"access": "private",
- "description": "Collapse icon HTML",
- "lineNumber": 77,
+ "description": "Expand icon HTML",
+ "lineNumber": 70,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -5024,6 +5073,23 @@
{
"__docId__": 248,
"kind": "member",
+ "name": "icnCollapseHtml",
+ "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
+ "static": false,
+ "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapseHtml",
+ "access": "private",
+ "description": "Collapse icon HTML",
+ "lineNumber": 77,
+ "ignore": true,
+ "type": {
+ "types": [
+ "*"
+ ]
+ }
+ },
+ {
+ "__docId__": 249,
+ "kind": "member",
"name": "defaultText",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
@@ -5031,6 +5097,7 @@
"access": "private",
"description": "Default text",
"lineNumber": 84,
+ "ignore": true,
"type": {
"types": [
"string"
@@ -5038,7 +5105,7 @@
}
},
{
- "__docId__": 249,
+ "__docId__": 250,
"kind": "member",
"name": "targetId",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5057,7 +5124,7 @@
}
},
{
- "__docId__": 250,
+ "__docId__": 251,
"kind": "member",
"name": "enableIcon",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5076,7 +5143,7 @@
}
},
{
- "__docId__": 251,
+ "__docId__": 252,
"kind": "member",
"name": "btnText",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5095,7 +5162,7 @@
}
},
{
- "__docId__": 252,
+ "__docId__": 253,
"kind": "member",
"name": "collapseBtnHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5104,22 +5171,7 @@
"access": "private",
"description": "Collapse button HTML",
"lineNumber": 108,
- "type": {
- "types": [
- "*"
- ]
- }
- },
- {
- "__docId__": 253,
- "kind": "member",
- "name": "expandBtnHtml",
- "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
- "static": false,
- "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#expandBtnHtml",
- "access": "private",
- "description": "Expand button HTML",
- "lineNumber": 116,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -5129,6 +5181,23 @@
{
"__docId__": 254,
"kind": "member",
+ "name": "expandBtnHtml",
+ "memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
+ "static": false,
+ "longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#expandBtnHtml",
+ "access": "private",
+ "description": "Expand button HTML",
+ "lineNumber": 116,
+ "ignore": true,
+ "type": {
+ "types": [
+ "*"
+ ]
+ }
+ },
+ {
+ "__docId__": 255,
+ "kind": "member",
"name": "btnHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
@@ -5146,7 +5215,7 @@
}
},
{
- "__docId__": 255,
+ "__docId__": 256,
"kind": "member",
"name": "btnCssClass",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5165,7 +5234,7 @@
}
},
{
- "__docId__": 256,
+ "__docId__": 257,
"kind": "member",
"name": "contCssClass",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5184,7 +5253,7 @@
}
},
{
- "__docId__": 257,
+ "__docId__": 258,
"kind": "member",
"name": "filtersRowIndex",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5203,7 +5272,7 @@
}
},
{
- "__docId__": 258,
+ "__docId__": 259,
"kind": "member",
"name": "visibleAtStart",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5222,7 +5291,7 @@
}
},
{
- "__docId__": 259,
+ "__docId__": 260,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5241,7 +5310,7 @@
}
},
{
- "__docId__": 260,
+ "__docId__": 261,
"kind": "member",
"name": "onBeforeShow",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5260,7 +5329,7 @@
}
},
{
- "__docId__": 261,
+ "__docId__": 262,
"kind": "member",
"name": "onAfterShow",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5279,7 +5348,7 @@
}
},
{
- "__docId__": 262,
+ "__docId__": 263,
"kind": "member",
"name": "onBeforeHide",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5298,7 +5367,7 @@
}
},
{
- "__docId__": 263,
+ "__docId__": 264,
"kind": "member",
"name": "onAfterHide",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5317,7 +5386,7 @@
}
},
{
- "__docId__": 264,
+ "__docId__": 265,
"kind": "method",
"name": "init",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5332,7 +5401,7 @@
"return": null
},
{
- "__docId__": 265,
+ "__docId__": 266,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5354,7 +5423,7 @@
}
},
{
- "__docId__": 266,
+ "__docId__": 267,
"kind": "method",
"name": "buildUI",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5369,7 +5438,7 @@
"return": null
},
{
- "__docId__": 269,
+ "__docId__": 270,
"kind": "method",
"name": "toggle",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5384,7 +5453,7 @@
"return": null
},
{
- "__docId__": 270,
+ "__docId__": 271,
"kind": "method",
"name": "show",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5412,7 +5481,7 @@
"return": null
},
{
- "__docId__": 271,
+ "__docId__": 272,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
@@ -5427,7 +5496,7 @@
"return": null
},
{
- "__docId__": 275,
+ "__docId__": 276,
"kind": "file",
"name": "src/extensions/sort/adapterSortabletable.js",
"content": "import {Feature} from '../../feature';\nimport {isUndef, isObj, EMPTY_FN} from '../../types';\nimport {createElm, elm, getText, tag} from '../../dom';\nimport {addEvt} from '../../event';\nimport {parse as parseNb} from '../../number';\nimport {\n NONE, CELL_TAG, HEADER_TAG, STRING, NUMBER, DATE, FORMATTED_NUMBER,\n IP_ADDRESS\n} from '../../const';\nimport {defaultsStr, defaultsFn, defaultsArr} from '../../settings';\n\n/**\n * SortableTable Adapter module\n */\nexport default class AdapterSortableTable extends Feature {\n\n /**\n * Creates an instance of AdapterSortableTable\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} opts Configuration object\n */\n constructor(tf, opts) {\n super(tf, opts.name);\n\n /**\n * Module name\n * @type {String}\n */\n this.name = opts.name;\n\n /**\n * Module description\n * @type {String}\n */\n this.desc = defaultsStr(opts.description, 'Sortable table');\n\n /**\n * Indicate whether table previously sorted\n * @type {Boolean}\n * @private\n */\n this.sorted = false;\n\n /**\n * List of sort type per column basis\n * @type {Array}\n */\n this.sortTypes = defaultsArr(opts.types, tf.colTypes);\n\n /**\n * Column to be sorted at initialization, ie:\n * sort_col_at_start: [1, true]\n * @type {Array}\n */\n this.sortColAtStart = defaultsArr(opts.sort_col_at_start, null);\n\n /**\n * Enable asynchronous sort, if triggers are external\n * @type {Boolean}\n */\n this.asyncSort = Boolean(opts.async_sort);\n\n /**\n * List of element IDs triggering sort on a per column basis\n * @type {Array}\n */\n this.triggerIds = defaultsArr(opts.trigger_ids, []);\n\n // edit .sort-arrow.descending / .sort-arrow.ascending in\n // tablefilter.css to reflect any path change\n /**\n * Path to images\n * @type {String}\n */\n this.imgPath = defaultsStr(opts.images_path, tf.themesPath);\n\n /**\n * Blank image file name\n * @type {String}\n */\n this.imgBlank = defaultsStr(opts.image_blank, 'blank.png');\n\n /**\n * Css class for sort indicator image\n * @type {String}\n */\n this.imgClassName = defaultsStr(opts.image_class_name, 'sort-arrow');\n\n /**\n * Css class for ascending sort indicator image\n * @type {String}\n */\n this.imgAscClassName = defaultsStr(opts.image_asc_class_name,\n 'ascending');\n\n /**\n * Css class for descending sort indicator image\n * @type {String}\n */\n this.imgDescClassName = defaultsStr(opts.image_desc_class_name,\n 'descending');\n\n /**\n * Cell attribute key storing custom value used for sorting\n * @type {String}\n */\n this.customKey = defaultsStr(opts.custom_key, 'data-tf-sortKey');\n\n /**\n * Callback fired when sort extension is instanciated\n * @type {Function}\n */\n this.onSortLoaded = defaultsFn(opts.on_sort_loaded, EMPTY_FN);\n\n /**\n * Callback fired before a table column is sorted\n * @type {Function}\n */\n this.onBeforeSort = defaultsFn(opts.on_before_sort, EMPTY_FN);\n\n /**\n * Callback fired after a table column is sorted\n * @type {Function}\n */\n this.onAfterSort = defaultsFn(opts.on_after_sort, EMPTY_FN);\n\n /**\n * SortableTable instance\n * @private\n */\n this.stt = null;\n\n this.enable();\n }\n\n /**\n * Initializes AdapterSortableTable instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n let tf = this.tf;\n let adpt = this;\n\n // SortableTable class sanity check (sortabletable.js)\n if (isUndef(SortableTable)) {\n throw new Error('SortableTable class not found.');\n }\n\n // Add any date format if needed\n this.emitter.emit('add-date-type-formats', this.tf, this.sortTypes);\n\n this.overrideSortableTable();\n this.setSortTypes();\n\n this.onSortLoaded(tf, this);\n\n /*** SortableTable callbacks ***/\n this.stt.onbeforesort = function () {\n adpt.onBeforeSort(tf, adpt.stt.sortColumn);\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 adpt.onAfterSort(tf, adpt.stt.sortColumn, adpt.stt.descending);\n adpt.emitter.emit('column-sorted', tf, adpt.stt.sortColumn,\n adpt.stt.descending);\n };\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 this.emitter.on(['sort'],\n (tf, colIdx, desc) => this.sortByColumnIndex(colIdx, desc));\n\n /** @inherited */\n this.initialized = true;\n\n this.emitter.emit('sort-initialized', tf, this);\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 /**\n * Set SortableTable overrides for TableFilter integration\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 !== CELL_TAG && el.tagName !== HEADER_TAG) {\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 = createElm('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 addEvt(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 < l; j++) {\n cells.push(elm(triggers[j]));\n }\n } else {\n if (!this.tHead) {\n return;\n }\n cells = stt.tHead.rows[stt.headersRow].cells;\n l = cells.length;\n }\n for (let i = 0; i < l; i++) {\n let cell = cells[i];\n if (!cell) {\n continue;\n }\n let cellAttr = cell.getAttribute('_sortType');\n if (cellAttr !== null && cellAttr !== 'None') {\n img = cell.lastChild || cell;\n if (img.nodeName.toLowerCase() !== 'img') {\n img = createElm('img',\n ['src', adpt.imgPath + adpt.imgBlank]);\n cell.appendChild(img);\n }\n if (i === stt.sortColumn) {\n img.className = adpt.imgClassName + ' ' +\n (this.descending ?\n adpt.imgDescClassName :\n adpt.imgAscClassName);\n } else {\n img.className = adpt.imgClassName;\n }\n }\n }\n };\n\n /**\n * Overrides getRowValue for custom key value feature\n * @param {Object} oRow Row element\n * @param {String} sType\n * @param {Number} nColumn\n * @return {String}\n */\n SortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\n let stt = this;\n // if we have defined a custom getRowValue use that\n let sortTypeInfo = stt._sortTypeInfo[sType];\n if (sortTypeInfo && sortTypeInfo.getRowValue) {\n return sortTypeInfo.getRowValue(oRow, nColumn);\n }\n let c = oRow.cells[nColumn];\n let s = SortableTable.getInnerText(c);\n return stt.getValueFromString(s, sType);\n };\n\n /**\n * Overrides getInnerText in order to avoid Firefox unexpected sorting\n * behaviour with untrimmed text elements\n * @param {Object} oNode DOM element\n * @return {String} DOM element inner text\n */\n SortableTable.getInnerText = function (oNode) {\n if (!oNode) {\n return;\n }\n if (oNode.getAttribute(adpt.customKey)) {\n return oNode.getAttribute(adpt.customKey);\n } else {\n return getText(oNode);\n }\n };\n }\n\n /**\n * Adds a sort type\n */\n addSortType(...args) {\n // Extract the arguments\n let [id, caster, sorter] = args;\n SortableTable.prototype.addSortType(id, caster, sorter);\n }\n\n /**\n * Sets the sort types on a column basis\n * @private\n */\n setSortTypes() {\n let tf = this.tf,\n sortTypes = this.sortTypes,\n _sortTypes = [];\n\n tf.eachCol((i) => {\n let colType;\n if (sortTypes[i]) {\n colType = sortTypes[i];\n if (isObj(colType)) {\n if (colType.type === DATE) {\n colType = this._addDateType(i, sortTypes);\n }\n else if (colType.type === FORMATTED_NUMBER) {\n let decimal = colType.decimal || tf.decimalSeparator;\n colType = this._addNumberType(i, decimal);\n }\n } else {\n colType = colType.toLowerCase();\n if (colType === DATE) {\n colType = this._addDateType(i, sortTypes);\n }\n else if (colType === FORMATTED_NUMBER ||\n colType === NUMBER) {\n colType = this._addNumberType(i, tf.decimalSeparator);\n }\n else if (colType === NONE) {\n // TODO: normalise 'none' vs 'None'\n colType = 'None';\n }\n }\n } else {\n colType = STRING;\n }\n _sortTypes.push(colType);\n });\n\n //Public TF method to add sort type\n\n //Custom sort types\n this.addSortType('caseinsensitivestring', SortableTable.toUpperCase);\n this.addSortType(STRING);\n this.addSortType(IP_ADDRESS, ipAddress, sortIP);\n\n this.stt = new SortableTable(tf.dom(), _sortTypes);\n\n /*** external table headers adapter ***/\n if (this.asyncSort && this.triggerIds.length > 0) {\n let triggers = this.triggerIds;\n for (let j = 0; j < triggers.length; j++) {\n if (triggers[j] === null) {\n continue;\n }\n let trigger = elm(triggers[j]);\n if (trigger) {\n trigger.style.cursor = 'pointer';\n\n addEvt(trigger, 'click', (evt) => {\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 _addDateType(colIndex, types) {\n let tf = this.tf;\n let dateType = tf.feature('dateType');\n let locale = dateType.getOptions(colIndex, types).locale || tf.locale;\n let colType = `${DATE}-${locale}`;\n\n this.addSortType(colType, (value) => {\n let parsedDate = dateType.parse(value, locale);\n // Invalid date defaults to Wed Feb 04 -768 11:00:00\n return isNaN(+parsedDate) ? new Date(-86400000000000) : parsedDate;\n });\n return colType;\n }\n\n _addNumberType(colIndex, decimal) {\n let colType = `${FORMATTED_NUMBER}${decimal === '.' ? '' : '-custom'}`;\n\n this.addSortType(colType, (value) => {\n return parseNb(value, decimal);\n });\n return colType;\n }\n\n /**\n * Remove extension\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n let tf = this.tf;\n this.emitter.off(['sort'],\n (tf, colIdx, desc) => this.sortByColumnIndex(colIdx, desc));\n this.sorted = 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 = tag(header, 'img');\n\n if (img.length === 1) {\n header.removeChild(img[0]);\n }\n }\n this.initialized = false;\n }\n\n}\n\n//Converters\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 < bb) {\n return -1;\n } else {\n return 1;\n }\n}\n",
@@ -5438,7 +5507,7 @@
"lineNumber": 1
},
{
- "__docId__": 276,
+ "__docId__": 277,
"kind": "class",
"name": "AdapterSortableTable",
"memberof": "src/extensions/sort/adapterSortabletable.js",
@@ -5456,7 +5525,7 @@
]
},
{
- "__docId__": 277,
+ "__docId__": 278,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5491,7 +5560,7 @@
]
},
{
- "__docId__": 278,
+ "__docId__": 279,
"kind": "member",
"name": "name",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5510,7 +5579,7 @@
}
},
{
- "__docId__": 279,
+ "__docId__": 280,
"kind": "member",
"name": "desc",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5529,7 +5598,7 @@
}
},
{
- "__docId__": 280,
+ "__docId__": 281,
"kind": "member",
"name": "sorted",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5545,10 +5614,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 281,
+ "__docId__": 282,
"kind": "member",
"name": "sortTypes",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5567,7 +5637,7 @@
}
},
{
- "__docId__": 282,
+ "__docId__": 283,
"kind": "member",
"name": "sortColAtStart",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5586,7 +5656,7 @@
}
},
{
- "__docId__": 283,
+ "__docId__": 284,
"kind": "member",
"name": "asyncSort",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5605,7 +5675,7 @@
}
},
{
- "__docId__": 284,
+ "__docId__": 285,
"kind": "member",
"name": "triggerIds",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5624,7 +5694,7 @@
}
},
{
- "__docId__": 285,
+ "__docId__": 286,
"kind": "member",
"name": "imgPath",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5643,7 +5713,7 @@
}
},
{
- "__docId__": 286,
+ "__docId__": 287,
"kind": "member",
"name": "imgBlank",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5662,7 +5732,7 @@
}
},
{
- "__docId__": 287,
+ "__docId__": 288,
"kind": "member",
"name": "imgClassName",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5681,7 +5751,7 @@
}
},
{
- "__docId__": 288,
+ "__docId__": 289,
"kind": "member",
"name": "imgAscClassName",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5700,7 +5770,7 @@
}
},
{
- "__docId__": 289,
+ "__docId__": 290,
"kind": "member",
"name": "imgDescClassName",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5719,7 +5789,7 @@
}
},
{
- "__docId__": 290,
+ "__docId__": 291,
"kind": "member",
"name": "customKey",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5738,7 +5808,7 @@
}
},
{
- "__docId__": 291,
+ "__docId__": 292,
"kind": "member",
"name": "onSortLoaded",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5757,7 +5827,7 @@
}
},
{
- "__docId__": 292,
+ "__docId__": 293,
"kind": "member",
"name": "onBeforeSort",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5776,7 +5846,7 @@
}
},
{
- "__docId__": 293,
+ "__docId__": 294,
"kind": "member",
"name": "onAfterSort",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5795,7 +5865,7 @@
}
},
{
- "__docId__": 294,
+ "__docId__": 295,
"kind": "member",
"name": "stt",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5804,6 +5874,7 @@
"access": "private",
"description": "SortableTable instance",
"lineNumber": 131,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -5811,7 +5882,7 @@
}
},
{
- "__docId__": 295,
+ "__docId__": 296,
"kind": "method",
"name": "init",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5826,7 +5897,7 @@
"return": null
},
{
- "__docId__": 296,
+ "__docId__": 297,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5848,7 +5919,7 @@
}
},
{
- "__docId__": 297,
+ "__docId__": 298,
"kind": "method",
"name": "sortByColumnIndex",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5884,7 +5955,7 @@
"return": null
},
{
- "__docId__": 298,
+ "__docId__": 299,
"kind": "method",
"name": "overrideSortableTable",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5899,7 +5970,7 @@
"return": null
},
{
- "__docId__": 299,
+ "__docId__": 300,
"kind": "method",
"name": "addSortType",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5922,7 +5993,7 @@
"return": null
},
{
- "__docId__": 300,
+ "__docId__": 301,
"kind": "method",
"name": "setSortTypes",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5933,11 +6004,12 @@
"access": "private",
"description": "Sets the sort types on a column basis",
"lineNumber": 388,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 302,
+ "__docId__": 303,
"kind": "method",
"name": "_addDateType",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5949,6 +6021,7 @@
"description": null,
"lineNumber": 458,
"undocument": true,
+ "ignore": true,
"params": [
{
"name": "colIndex",
@@ -5970,7 +6043,7 @@
}
},
{
- "__docId__": 303,
+ "__docId__": 304,
"kind": "method",
"name": "_addNumberType",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -5982,6 +6055,7 @@
"description": null,
"lineNumber": 472,
"undocument": true,
+ "ignore": true,
"params": [
{
"name": "colIndex",
@@ -6003,7 +6077,7 @@
}
},
{
- "__docId__": 304,
+ "__docId__": 305,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
@@ -6018,7 +6092,7 @@
"return": null
},
{
- "__docId__": 307,
+ "__docId__": 308,
"kind": "function",
"name": "ipAddress",
"memberof": "src/extensions/sort/adapterSortabletable.js",
@@ -6049,7 +6123,7 @@
"ignore": true
},
{
- "__docId__": 308,
+ "__docId__": 309,
"kind": "function",
"name": "sortIP",
"memberof": "src/extensions/sort/adapterSortabletable.js",
@@ -6086,7 +6160,7 @@
"ignore": true
},
{
- "__docId__": 309,
+ "__docId__": 310,
"kind": "file",
"name": "src/extensions/sort/sort.js",
"content": "import AdapterSortableTable from './adapterSortabletable';\nimport {root} from '../../root';\n\nif (!root.SortableTable) {\n require('script-loader!sortabletable');\n}\n\nexport default AdapterSortableTable;\n",
@@ -6097,7 +6171,7 @@
"lineNumber": 1
},
{
- "__docId__": 310,
+ "__docId__": 311,
"kind": "file",
"name": "src/feature.js",
"content": "\nconst NOT_IMPLEMENTED = 'Not implemented.';\n\n/**\n * Base class defining the interface of a TableFilter feature\n */\nexport class Feature {\n /**\n * Creates an instance of Feature\n * @param {Object} tf TableFilter instance\n * @param {String} feature Feature name known by TableFilter\n */\n constructor(tf, feature) {\n /**\n * TableFilter instance\n * @type {TableFilter}\n */\n this.tf = tf;\n\n /**\n * Feature name\n * @type {String}\n */\n this.feature = feature;\n\n /**\n * TableFilter feature setting\n * @type {Boolean}\n */\n this.enabled = tf[feature];\n\n /**\n * TableFilter configuration\n * @type {Object}\n */\n this.config = tf.config();\n\n /**\n * TableFilter emitter instance\n * @type {Emitter}\n */\n this.emitter = tf.emitter;\n\n /**\n * Field indicating whether Feature is initialized\n * @type {Boolean}\n */\n this.initialized = false;\n\n /** Subscribe to destroy event */\n this.emitter.on(['destroy'], () => this.destroy());\n }\n\n /**\n * Initialize the feature\n */\n init() {\n throw new Error(NOT_IMPLEMENTED);\n }\n\n /**\n * Reset the feature after being disabled\n */\n reset() {\n this.enable();\n this.init();\n }\n\n /**\n * Destroy the feature\n */\n destroy() {\n throw new Error(NOT_IMPLEMENTED);\n }\n\n /**\n * Enable the feature\n */\n enable() {\n this.enabled = true;\n }\n\n /**\n * Disable the feature\n */\n disable() {\n this.enabled = false;\n }\n\n /**\n * Indicate whether the feature is enabled or not\n * @returns {Boolean}\n */\n isEnabled() {\n return this.enabled === true;\n }\n}\n",
@@ -6108,7 +6182,7 @@
"lineNumber": 1
},
{
- "__docId__": 311,
+ "__docId__": 312,
"kind": "variable",
"name": "NOT_IMPLEMENTED",
"memberof": "src/feature.js",
@@ -6129,7 +6203,7 @@
"ignore": true
},
{
- "__docId__": 312,
+ "__docId__": 313,
"kind": "class",
"name": "Feature",
"memberof": "src/feature.js",
@@ -6144,7 +6218,7 @@
"interface": false
},
{
- "__docId__": 313,
+ "__docId__": 314,
"kind": "constructor",
"name": "constructor",
"memberof": "src/feature.js~Feature",
@@ -6179,7 +6253,7 @@
]
},
{
- "__docId__": 314,
+ "__docId__": 315,
"kind": "member",
"name": "tf",
"memberof": "src/feature.js~Feature",
@@ -6198,7 +6272,7 @@
}
},
{
- "__docId__": 315,
+ "__docId__": 316,
"kind": "member",
"name": "feature",
"memberof": "src/feature.js~Feature",
@@ -6217,7 +6291,7 @@
}
},
{
- "__docId__": 316,
+ "__docId__": 317,
"kind": "member",
"name": "enabled",
"memberof": "src/feature.js~Feature",
@@ -6236,7 +6310,7 @@
}
},
{
- "__docId__": 317,
+ "__docId__": 318,
"kind": "member",
"name": "config",
"memberof": "src/feature.js~Feature",
@@ -6255,7 +6329,7 @@
}
},
{
- "__docId__": 318,
+ "__docId__": 319,
"kind": "member",
"name": "emitter",
"memberof": "src/feature.js~Feature",
@@ -6274,7 +6348,7 @@
}
},
{
- "__docId__": 319,
+ "__docId__": 320,
"kind": "member",
"name": "initialized",
"memberof": "src/feature.js~Feature",
@@ -6293,7 +6367,7 @@
}
},
{
- "__docId__": 320,
+ "__docId__": 321,
"kind": "method",
"name": "init",
"memberof": "src/feature.js~Feature",
@@ -6308,7 +6382,7 @@
"return": null
},
{
- "__docId__": 321,
+ "__docId__": 322,
"kind": "method",
"name": "reset",
"memberof": "src/feature.js~Feature",
@@ -6323,7 +6397,7 @@
"return": null
},
{
- "__docId__": 322,
+ "__docId__": 323,
"kind": "method",
"name": "destroy",
"memberof": "src/feature.js~Feature",
@@ -6338,7 +6412,7 @@
"return": null
},
{
- "__docId__": 323,
+ "__docId__": 324,
"kind": "method",
"name": "enable",
"memberof": "src/feature.js~Feature",
@@ -6353,7 +6427,7 @@
"return": null
},
{
- "__docId__": 325,
+ "__docId__": 326,
"kind": "method",
"name": "disable",
"memberof": "src/feature.js~Feature",
@@ -6368,7 +6442,7 @@
"return": null
},
{
- "__docId__": 327,
+ "__docId__": 328,
"kind": "method",
"name": "isEnabled",
"memberof": "src/feature.js~Feature",
@@ -6396,7 +6470,7 @@
"params": []
},
{
- "__docId__": 328,
+ "__docId__": 329,
"kind": "file",
"name": "src/modules/alternateRows.js",
"content": "import {Feature} from '../feature';\nimport {addClass, removeClass} from '../dom';\nimport {defaultsStr} from '../settings';\n\n/**\n * Rows with alternating background color for improved readability\n */\nexport class AlternateRows extends Feature {\n\n /**\n * Creates an instance of AlternateRows.\n *\n * @param {Object} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'alternateRows');\n\n let config = this.config;\n /**\n * Css class for even rows (default: 'even')\n * @type {String}\n */\n this.evenCss = defaultsStr(config.even_row_css_class, 'even');\n\n /**\n * Css class for odd rows (default: 'odd')\n * @type {String}\n */\n this.oddCss = defaultsStr(config.odd_row_css_class, 'odd');\n }\n\n /**\n * Sets alternating rows color\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n this.processAll();\n\n // Subscribe to events\n this.emitter.on(['row-processed', 'row-paged'],\n (tf, rowIndex, arrIndex, isValid) =>\n this.processRow(rowIndex, arrIndex, isValid));\n this.emitter.on(['column-sorted', 'rows-changed'],\n () => this.processAll());\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Apply background to all valid rows\n */\n processAll() {\n if (!this.isEnabled()) {\n return;\n }\n let tf = this.tf;\n let validRowsIndex = tf.getValidRows(true);\n let indexLen = validRowsIndex.length;\n let idx = 0;\n\n //alternates bg color\n for (let j = 0; j < indexLen; j++) {\n let rowIdx = validRowsIndex[j];\n this.setRowBg(rowIdx, idx);\n idx++;\n }\n }\n\n /**\n * Set/remove row background based on row validation\n * @param {Number} rowIdx Row index\n * @param {Number} arrIdx Array index\n * @param {Boolean} isValid Valid row flag\n */\n processRow(rowIdx, arrIdx, isValid) {\n if (isValid) {\n this.setRowBg(rowIdx, arrIdx);\n } else {\n this.removeRowBg(rowIdx);\n }\n }\n\n /**\n * Sets row background color\n * @param {Number} rowIdx Row index\n * @param {Number} idx Valid rows collection index needed to calculate bg\n * color\n * @private\n */\n setRowBg(rowIdx, idx) {\n if (!this.isEnabled() || isNaN(rowIdx)) {\n return;\n }\n let rows = this.tf.dom().rows;\n let i = isNaN(idx) ? rowIdx : idx;\n this.removeRowBg(rowIdx);\n\n addClass(rows[rowIdx], (i % 2) ? this.evenCss : this.oddCss);\n }\n\n /**\n * Removes row background color\n * @param {Number} idx Row index\n * @private\n */\n removeRowBg(idx) {\n if (isNaN(idx)) {\n return;\n }\n let rows = this.tf.dom().rows;\n removeClass(rows[idx], this.oddCss);\n removeClass(rows[idx], this.evenCss);\n }\n\n /**\n * Removes all alternating backgrounds\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n let eachRow = this.tf.eachRow(0);\n eachRow((row, i) => this.removeRowBg(i));\n\n // Unsubscribe to events\n this.emitter.off(['row-processed', 'row-paged'],\n (tf, rowIndex, arrIndex, isValid) =>\n this.processRow(rowIndex, arrIndex, isValid));\n this.emitter.off(['column-sorted', 'rows-changed'],\n () => this.processAll());\n\n this.initialized = false;\n }\n\n}\n",
@@ -6407,7 +6481,7 @@
"lineNumber": 1
},
{
- "__docId__": 329,
+ "__docId__": 330,
"kind": "class",
"name": "AlternateRows",
"memberof": "src/modules/alternateRows.js",
@@ -6425,7 +6499,7 @@
]
},
{
- "__docId__": 330,
+ "__docId__": 331,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6450,7 +6524,7 @@
]
},
{
- "__docId__": 331,
+ "__docId__": 332,
"kind": "member",
"name": "evenCss",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6469,7 +6543,7 @@
}
},
{
- "__docId__": 332,
+ "__docId__": 333,
"kind": "member",
"name": "oddCss",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6488,7 +6562,7 @@
}
},
{
- "__docId__": 333,
+ "__docId__": 334,
"kind": "method",
"name": "init",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6503,7 +6577,7 @@
"return": null
},
{
- "__docId__": 334,
+ "__docId__": 335,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6525,7 +6599,7 @@
}
},
{
- "__docId__": 335,
+ "__docId__": 336,
"kind": "method",
"name": "processAll",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6540,7 +6614,7 @@
"return": null
},
{
- "__docId__": 336,
+ "__docId__": 337,
"kind": "method",
"name": "processRow",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6586,7 +6660,7 @@
"return": null
},
{
- "__docId__": 337,
+ "__docId__": 338,
"kind": "method",
"name": "setRowBg",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6619,10 +6693,11 @@
"description": "Valid rows collection index needed to calculate bg\ncolor"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 338,
+ "__docId__": 339,
"kind": "method",
"name": "removeRowBg",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6645,10 +6720,11 @@
"description": "Row index"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 339,
+ "__docId__": 340,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/alternateRows.js~AlternateRows",
@@ -6663,7 +6739,7 @@
"return": null
},
{
- "__docId__": 341,
+ "__docId__": 342,
"kind": "file",
"name": "src/modules/baseDropdown.js",
"content": "import {Feature} from '../feature';\nimport {\n ignoreCase, numSortAsc, numSortDesc,\n dateSortAsc, sortNumberStr, sortDateStr\n} from '../sort';\nimport {isArray, isObj, isEmpty} from '../types';\nimport {NUMBER, FORMATTED_NUMBER, DATE} from '../const';\n\n/**\n * Base class for Dropdown and CheckList UI components\n * @export\n * @class BaseDropdown\n * @extends {Feature}\n */\nexport class BaseDropdown extends Feature {\n\n /**\n * Creates an instance of BaseDropdown\n * @param {TableFilter} tf\n */\n constructor(tf) {\n super(tf, 'baseDropdown');\n\n let f = this.config;\n\n /**\n * Filter options custom sorter on a column basis\n * @type {Object}\n */\n this.customSorter = isObj(f.filter_options_sorter) &&\n isArray(f.filter_options_sorter.col) &&\n isArray(f.filter_options_sorter.comparer) ?\n f.filter_options_sorter :\n null;\n\n // TODO: move here all properties shared by Dropdown CheckList\n\n /**\n * Has custom options\n * @type {Boolean}\n * @private\n */\n this.isCustom = false;\n\n /**\n * List of options values\n * @type {Array}\n * @private\n */\n this.opts = [];\n\n /**\n * List of options texts for custom values\n * @type {Array}\n * @private\n */\n this.optsTxt = [];\n\n /**\n * List of options to be excluded from the checklist filter\n * @type {Array}\n * @private\n */\n this.excludedOpts = [];\n }\n\n /**\n * Sort passed options based on the type of the specified column\n * @param {Number} colIndex Column index\n * @param {Array} [options=[]] Collection of values\n * @return {Array} Sorted values\n * @private\n */\n sortOptions(colIndex, options = []) {\n let tf = this.tf;\n\n if (tf.isCustomOptions(colIndex) || !tf.sortSlc ||\n (isArray(tf.sortSlc) && tf.sortSlc.indexOf(colIndex) === -1)) {\n return options;\n }\n\n let { caseSensitive, sortNumDesc } = tf;\n let compareFn;\n\n if (this.customSorter &&\n this.customSorter.col.indexOf(colIndex) !== -1) {\n var idx = this.customSorter.col.indexOf(colIndex);\n compareFn = this.customSorter.comparer[idx];\n }\n else if (tf.hasType(colIndex, [NUMBER, FORMATTED_NUMBER])) {\n let decimal = tf.getDecimal(colIndex);\n let comparer = numSortAsc;\n if (sortNumDesc === true || sortNumDesc.indexOf(colIndex) !== -1) {\n comparer = numSortDesc;\n }\n compareFn = sortNumberStr(comparer, decimal);\n }\n else if (tf.hasType(colIndex, [DATE])) {\n let locale = tf.feature('dateType').getLocale(colIndex);\n let comparer = dateSortAsc;\n compareFn = sortDateStr(comparer, locale);\n } else { // string\n compareFn = caseSensitive ? undefined : ignoreCase;\n }\n\n return options.sort(compareFn);\n }\n\n /**\n * Regenerate filters of specified columns and maintain selection if any\n * @param {Array} colIndexes Collection of column indexes\n * @private\n */\n refreshFilters(colIndexes) {\n colIndexes.forEach((colIdx) => {\n let values = this.getValues(colIdx);\n this.build(colIdx, this.tf.linkedFilters);\n this.selectOptions(colIdx, values);\n });\n }\n\n /**\n * Check passed row contains a valid linked value\n * @param {Number} rowIdx Row index\n * @param {Number} activeFilterIdx Current active filter index\n * @returns {Boolean}\n */\n isValidLinkedValue(rowIdx, activeFilterIdx) {\n let tf = this.tf;\n\n if (tf.disableExcludedOptions) {\n return true;\n }\n\n if (tf.paging) {\n if (!isEmpty(activeFilterIdx) && tf.isRowValid(rowIdx)) {\n return true;\n }\n } else {\n if (tf.isRowDisplayed(rowIdx)) {\n return true;\n }\n }\n\n return false;\n }\n}\n",
@@ -6674,7 +6750,7 @@
"lineNumber": 1
},
{
- "__docId__": 342,
+ "__docId__": 343,
"kind": "class",
"name": "BaseDropdown",
"memberof": "src/modules/baseDropdown.js",
@@ -6698,7 +6774,7 @@
]
},
{
- "__docId__": 343,
+ "__docId__": 344,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
@@ -6723,7 +6799,7 @@
]
},
{
- "__docId__": 344,
+ "__docId__": 345,
"kind": "member",
"name": "customSorter",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
@@ -6742,7 +6818,7 @@
}
},
{
- "__docId__": 345,
+ "__docId__": 346,
"kind": "member",
"name": "isCustom",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
@@ -6758,10 +6834,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 346,
+ "__docId__": 347,
"kind": "member",
"name": "opts",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
@@ -6777,10 +6854,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 347,
+ "__docId__": 348,
"kind": "member",
"name": "optsTxt",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
@@ -6796,10 +6874,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 348,
+ "__docId__": 349,
"kind": "member",
"name": "excludedOpts",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
@@ -6815,10 +6894,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 349,
+ "__docId__": 350,
"kind": "method",
"name": "sortOptions",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
@@ -6860,10 +6940,11 @@
],
"spread": false,
"description": "Sorted values"
- }
+ },
+ "ignore": true
},
{
- "__docId__": 350,
+ "__docId__": 351,
"kind": "method",
"name": "refreshFilters",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
@@ -6886,10 +6967,11 @@
"description": "Collection of column indexes"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 351,
+ "__docId__": 352,
"kind": "method",
"name": "isValidLinkedValue",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
@@ -6938,7 +7020,7 @@
}
},
{
- "__docId__": 352,
+ "__docId__": 353,
"kind": "file",
"name": "src/modules/checkList.js",
"content": "import {BaseDropdown} from './baseDropdown';\nimport {\n addClass, createCheckItem, createText, createElm, elm, removeClass, tag\n} from '../dom';\nimport {has} from '../array';\nimport {matchCase, trim, rgxEsc} from '../string';\nimport {addEvt, removeEvt, targetEvt} from '../event';\nimport {isEmpty} from '../types';\nimport {CHECKLIST, NONE} from '../const';\nimport {defaultsStr, defaultsBool} from '../settings';\n\n/**\n * Checklist filter UI component\n * @export\n * @class CheckList\n * @extends {BaseDropdown}\n */\nexport class CheckList extends BaseDropdown {\n\n /**\n * Creates an instance of CheckList\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'checkList');\n\n let f = this.config;\n\n /**\n * List of container DOM elements\n * @type {Array}\n */\n this.containers = [];\n\n /**\n * Css class for the container of the checklist filter (div)\n * @type {String}\n */\n this.containerCssClass = defaultsStr(f.div_checklist_css_class,\n 'div_checklist');\n\n /**\n * Css class for the checklist filter element (ul)\n * @type {String}\n */\n this.filterCssClass = defaultsStr(f.checklist_css_class,\n 'flt_checklist');\n\n /**\n * Css class for the item of a checklist (li)\n * @type {String}\n */\n this.itemCssClass = defaultsStr(f.checklist_item_css_class,\n 'flt_checklist_item');\n\n /**\n * Css class for a selected item of a checklist (li)\n * @type {String}\n */\n this.selectedItemCssClass = defaultsStr(\n f.checklist_selected_item_css_class,\n 'flt_checklist_slc_item'\n );\n\n /**\n * Text placed in the filter's container when load filter on demand\n * feature is enabled\n * @type {String}\n */\n this.activateText = defaultsStr(\n f.activate_checklist_text,\n 'Click to load filter data'\n );\n\n /**\n * Css class for a disabled item of a checklist (li)\n * @type {String}\n */\n this.disabledItemCssClass = defaultsStr(\n f.checklist_item_disabled_css_class,\n 'flt_checklist_item_disabled'\n );\n\n /**\n * Enable the reset filter option as first item\n * @type {Boolean}\n */\n this.enableResetOption = defaultsBool(f.enable_checklist_reset_filter,\n true);\n\n /**\n * Prefix for container element ID\n * @type {String}\n * @private\n */\n this.prfx = 'chkdiv_';\n }\n\n /**\n * Checklist option click event handler\n * @param {Event} evt\n * @private\n */\n optionClick(evt) {\n let elm = targetEvt(evt);\n let tf = this.tf;\n\n this.emitter.emit('filter-focus', tf, elm);\n this.setCheckListValues(elm);\n tf.filter();\n }\n\n /**\n * Checklist container click event handler for load-on-demand feature\n * @param {Event} evt\n * @private\n */\n onCheckListClick(evt) {\n let elm = targetEvt(evt);\n if (this.tf.loadFltOnDemand && elm.getAttribute('filled') === '0') {\n let ct = elm.getAttribute('ct');\n let div = this.containers[ct];\n this.build(ct);\n removeEvt(div, 'click', (evt) => this.onCheckListClick(evt));\n }\n }\n\n /**\n * Refresh all checklist filters\n */\n refreshAll() {\n let colIdxs = this.tf.getFiltersByType(CHECKLIST, true);\n this.refreshFilters(colIdxs);\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.externalFltIds[colIndex] : null;\n\n let divCont = createElm('div',\n ['id', `${this.prfx}${colIndex}_${tf.id}`],\n ['ct', colIndex], ['filled', '0']);\n divCont.className = this.containerCssClass;\n\n //filter is appended in desired element\n if (externalFltTgtId) {\n elm(externalFltTgtId).appendChild(divCont);\n } else {\n container.appendChild(divCont);\n }\n\n this.containers[colIndex] = divCont;\n tf.fltIds.push(tf.buildFilterId(colIndex));\n\n if (!tf.loadFltOnDemand) {\n this.build(colIndex);\n } else {\n addEvt(divCont, 'click', (evt) => this.onCheckListClick(evt));\n divCont.appendChild(createText(this.activateText));\n }\n\n this.emitter.on(\n ['build-checklist-filter'],\n (tf, colIndex, isLinked) => this.build(colIndex, isLinked)\n );\n\n this.emitter.on(\n ['select-checklist-options'],\n (tf, colIndex, values) => this.selectOptions(colIndex, values)\n );\n\n this.emitter.on(['rows-changed'], () => this.refreshAll());\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Build checklist UI\n * @param {Number} colIndex Column index\n * @param {Boolean} isLinked Enable linked filters behaviour\n */\n build(colIndex, isLinked = false) {\n let tf = this.tf;\n colIndex = Number(colIndex);\n\n this.emitter.emit('before-populating-filter', tf, colIndex);\n\n /** @inherited */\n this.opts = [];\n /** @inherited */\n this.optsTxt = [];\n\n let flt = this.containers[colIndex];\n let ul = createElm('ul',\n ['id', tf.fltIds[colIndex]],\n ['colIndex', colIndex]);\n ul.className = this.filterCssClass;\n\n let caseSensitive = tf.caseSensitive;\n /** @inherited */\n this.isCustom = tf.isCustomOptions(colIndex);\n\n //Retrieves custom values\n if (this.isCustom) {\n let customValues = tf.getCustomOptions(colIndex);\n this.opts = customValues[0];\n this.optsTxt = customValues[1];\n }\n\n let activeIdx;\n let activeFilterId = tf.getActiveFilterId();\n\n if (isLinked && activeFilterId) {\n activeIdx = tf.getColumnIndexFromFilterId(activeFilterId);\n }\n\n let filteredDataCol = [];\n if (isLinked && tf.disableExcludedOptions) {\n /** @inherited */\n this.excludedOpts = [];\n }\n\n flt.innerHTML = '';\n\n let eachRow = tf.eachRow();\n eachRow(\n (row) => {\n let cellValue = tf.getCellValue(row.cells[colIndex]);\n //Vary Peter's patch\n let cellString = matchCase(cellValue, caseSensitive);\n // checks if celldata is already in array\n if (!has(this.opts, cellString, caseSensitive)) {\n this.opts.push(cellValue);\n }\n let filteredCol = filteredDataCol[colIndex];\n if (isLinked && tf.disableExcludedOptions) {\n if (!filteredCol) {\n filteredCol = tf.getVisibleColumnValues(colIndex);\n }\n if (!has(filteredCol, cellString, caseSensitive) &&\n !has(this.excludedOpts, cellString, caseSensitive)) {\n this.excludedOpts.push(cellValue);\n }\n }\n },\n // continue conditions function\n (row, k) => {\n // excluded rows don't need to appear on selects as always valid\n if (tf.excludeRows.indexOf(k) !== -1) {\n return true;\n }\n\n // checks if row has expected number of cells\n if (row.cells.length !== tf.nbCells || this.isCustom) {\n return true;\n }\n\n if (isLinked && !this.isValidLinkedValue(k, activeIdx)) {\n return true;\n }\n }\n );\n\n //sort options\n this.opts = this.sortOptions(colIndex, this.opts);\n if (this.excludedOpts) {\n this.excludedOpts = this.sortOptions(colIndex, this.excludedOpts);\n }\n\n this.addChecks(colIndex, ul);\n\n if (tf.loadFltOnDemand) {\n flt.innerHTML = '';\n }\n flt.appendChild(ul);\n flt.setAttribute('filled', '1');\n\n this.emitter.emit('after-populating-filter', tf, colIndex, flt);\n }\n\n /**\n * Add checklist options\n * @param {Number} colIndex Column index\n * @param {Object} ul Ul element\n * @private\n */\n addChecks(colIndex, ul) {\n let tf = this.tf;\n let chkCt = this.addTChecks(colIndex, ul);\n\n for (let y = 0; y < this.opts.length; y++) {\n let val = this.opts[y]; //item value\n let lbl = this.isCustom ? this.optsTxt[y] : val; //item text\n let fltId = tf.fltIds[colIndex];\n let li = createCheckItem(`${fltId}_${(y + chkCt)}`, val, lbl);\n li.className = this.itemCssClass;\n\n if (tf.linkedFilters && tf.disableExcludedOptions &&\n has(this.excludedOpts, matchCase(val, tf.caseSensitive),\n tf.caseSensitive)) {\n addClass(li, this.disabledItemCssClass);\n li.check.disabled = true;\n li.disabled = true;\n } else {\n addEvt(li.check, 'click', evt => 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 * @private\n */\n addTChecks(colIndex, ul) {\n let tf = this.tf;\n let chkCt = 1;\n let fltId = tf.fltIds[colIndex];\n let li0 = createCheckItem(`${fltId}_0`, '',\n tf.getClearFilterText(colIndex));\n li0.className = this.itemCssClass;\n ul.appendChild(li0);\n\n addEvt(li0.check, 'click', evt => this.optionClick(evt));\n\n if (!this.enableResetOption) {\n li0.style.display = NONE;\n }\n\n if (tf.enableEmptyOption) {\n let li1 = createCheckItem(`${fltId}_1`, tf.emOperator,\n tf.emptyText);\n li1.className = this.itemCssClass;\n ul.appendChild(li1);\n addEvt(li1.check, 'click', evt => this.optionClick(evt));\n chkCt++;\n }\n\n if (tf.enableNonEmptyOption) {\n let li2 = createCheckItem(`${fltId}_2`, tf.nmOperator,\n tf.nonEmptyText);\n li2.className = this.itemCssClass;\n ul.appendChild(li2);\n addEvt(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 * @private\n */\n setCheckListValues(o) {\n if (!o) {\n return;\n }\n\n let tf = this.tf;\n let chkValue = o.value; //checked item value\n // TODO: provide helper to extract column index, ugly!\n let chkIndex = parseInt(o.id.split('_')[2], 10);\n let colIdx = tf.getColumnIndexFromFilterId(o.id);\n let itemTag = 'LI';\n\n let n = tf.getFilterElement(parseInt(colIdx, 10));\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 < indSplit.length; u++) {\n //checked item\n let cChk = elm(tf.fltIds[colIndex] + '_' +\n indSplit[u]);\n if (cChk) {\n cChk.checked = false;\n removeClass(n.childNodes[indSplit[u]],\n this.selectedItemCssClass);\n }\n }\n }\n n.setAttribute('value', '');\n n.setAttribute('indexes', '');\n\n } else {\n fltValue = (fltValue) ? fltValue : '';\n chkValue = trim(fltValue + ' ' + chkValue + ' ' +\n tf.orOperator);\n chkIndex = fltIndexes + chkIndex + tf.separator;\n n.setAttribute('value', chkValue);\n n.setAttribute('indexes', chkIndex);\n //1st option unchecked\n if (elm(tf.fltIds[colIndex] + '_0')) {\n elm(tf.fltIds[colIndex] + '_0').checked = false;\n }\n }\n\n if (li.nodeName === itemTag) {\n removeClass(n.childNodes[0], this.selectedItemCssClass);\n addClass(li, this.selectedItemCssClass);\n }\n } else { //removes values and indexes\n if (chkValue !== '') {\n let replaceValue = new RegExp(\n rgxEsc(chkValue + ' ' + tf.orOperator));\n fltValue = fltValue.replace(replaceValue, '');\n n.setAttribute('value', trim(fltValue));\n\n let replaceIndex = new RegExp(\n rgxEsc(chkIndex + tf.separator));\n fltIndexes = fltIndexes.replace(replaceIndex, '');\n n.setAttribute('indexes', fltIndexes);\n }\n if (li.nodeName === itemTag) {\n removeClass(li, this.selectedItemCssClass);\n }\n }\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 let flt = tf.getFilterElement(colIndex);\n if (tf.getFilterType(colIndex) !== CHECKLIST || !flt ||\n values.length === 0) {\n return;\n }\n\n let lis = tag(flt, 'li');\n\n flt.setAttribute('value', '');\n flt.setAttribute('indexes', '');\n\n [].forEach.call(lis, (li) => {\n let chk = tag(li, 'input')[0];\n let chkVal = matchCase(chk.value, tf.caseSensitive);\n\n if (chkVal !== '' && has(values, chkVal, tf.caseSensitive)) {\n chk.checked = true;\n } else {\n // Check non-empty-text or empty-text option\n if (values.indexOf(tf.nmOperator) !== -1 &&\n chkVal === matchCase(tf.nonEmptyText, tf.caseSensitive)) {\n chk.checked = true;\n }\n else if (values.indexOf(tf.emOperator) !== -1 &&\n chkVal === matchCase(tf.emptyText, tf.caseSensitive)) {\n chk.checked = true;\n } else {\n chk.checked = false;\n }\n }\n this.setCheckListValues(chk);\n });\n }\n\n /**\n * Get filter values for a given column index\n * @param {Number} colIndex Column index\n * @returns {Array} values Collection of selected values\n */\n getValues(colIndex) {\n let tf = this.tf;\n let flt = tf.getFilterElement(colIndex);\n let fltAttr = flt.getAttribute('value');\n let values = isEmpty(fltAttr) ? '' : fltAttr;\n //removes last operator ||\n values = values.substr(0, values.length - 3);\n //turn || separated values into array\n values = values.split(' ' + tf.orOperator + ' ');\n\n return values;\n }\n\n /**\n * Destroy CheckList instance\n */\n destroy() {\n this.emitter.off(\n ['build-checklist-filter'],\n (tf, colIndex, isLinked) => this.build(colIndex, isLinked)\n );\n this.emitter.off(\n ['select-checklist-options'],\n (tf, colIndex, values) => this.selectOptions(colIndex, values)\n );\n this.emitter.off(['rows-changed'], () => this.refreshAll());\n\n this.initialized = false;\n }\n}\n",
@@ -6949,7 +7031,7 @@
"lineNumber": 1
},
{
- "__docId__": 353,
+ "__docId__": 354,
"kind": "class",
"name": "CheckList",
"memberof": "src/modules/checkList.js",
@@ -6973,7 +7055,7 @@
]
},
{
- "__docId__": 354,
+ "__docId__": 355,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/checkList.js~CheckList",
@@ -6998,7 +7080,7 @@
]
},
{
- "__docId__": 355,
+ "__docId__": 356,
"kind": "member",
"name": "containers",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7017,7 +7099,7 @@
}
},
{
- "__docId__": 356,
+ "__docId__": 357,
"kind": "member",
"name": "containerCssClass",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7036,7 +7118,7 @@
}
},
{
- "__docId__": 357,
+ "__docId__": 358,
"kind": "member",
"name": "filterCssClass",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7055,7 +7137,7 @@
}
},
{
- "__docId__": 358,
+ "__docId__": 359,
"kind": "member",
"name": "itemCssClass",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7074,7 +7156,7 @@
}
},
{
- "__docId__": 359,
+ "__docId__": 360,
"kind": "member",
"name": "selectedItemCssClass",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7093,7 +7175,7 @@
}
},
{
- "__docId__": 360,
+ "__docId__": 361,
"kind": "member",
"name": "activateText",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7112,7 +7194,7 @@
}
},
{
- "__docId__": 361,
+ "__docId__": 362,
"kind": "member",
"name": "disabledItemCssClass",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7131,7 +7213,7 @@
}
},
{
- "__docId__": 362,
+ "__docId__": 363,
"kind": "member",
"name": "enableResetOption",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7150,7 +7232,7 @@
}
},
{
- "__docId__": 363,
+ "__docId__": 364,
"kind": "member",
"name": "prfx",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7166,10 +7248,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 364,
+ "__docId__": 365,
"kind": "method",
"name": "optionClick",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7192,10 +7275,11 @@
"description": ""
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 365,
+ "__docId__": 366,
"kind": "method",
"name": "onCheckListClick",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7218,10 +7302,11 @@
"description": ""
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 366,
+ "__docId__": 367,
"kind": "method",
"name": "refreshAll",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7236,7 +7321,7 @@
"return": null
},
{
- "__docId__": 367,
+ "__docId__": 368,
"kind": "method",
"name": "init",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7282,7 +7367,7 @@
"return": null
},
{
- "__docId__": 368,
+ "__docId__": 369,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7304,7 +7389,7 @@
}
},
{
- "__docId__": 369,
+ "__docId__": 370,
"kind": "method",
"name": "build",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7340,7 +7425,7 @@
"return": null
},
{
- "__docId__": 370,
+ "__docId__": 371,
"kind": "member",
"name": "opts",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7362,7 +7447,7 @@
}
},
{
- "__docId__": 371,
+ "__docId__": 372,
"kind": "member",
"name": "optsTxt",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7384,7 +7469,7 @@
}
},
{
- "__docId__": 372,
+ "__docId__": 373,
"kind": "member",
"name": "isCustom",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7406,7 +7491,7 @@
}
},
{
- "__docId__": 375,
+ "__docId__": 376,
"kind": "member",
"name": "excludedOpts",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7428,7 +7513,7 @@
}
},
{
- "__docId__": 378,
+ "__docId__": 379,
"kind": "method",
"name": "addChecks",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7461,10 +7546,11 @@
"description": "Ul element"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 379,
+ "__docId__": 380,
"kind": "method",
"name": "addTChecks",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7497,6 +7583,7 @@
"description": "Ul element"
}
],
+ "ignore": true,
"return": {
"types": [
"*"
@@ -7504,7 +7591,7 @@
}
},
{
- "__docId__": 380,
+ "__docId__": 381,
"kind": "method",
"name": "setCheckListValues",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7527,10 +7614,11 @@
"description": "checklist option DOM element"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 381,
+ "__docId__": 382,
"kind": "method",
"name": "selectOptions",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7566,7 +7654,7 @@
"return": null
},
{
- "__docId__": 382,
+ "__docId__": 383,
"kind": "method",
"name": "getValues",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7605,7 +7693,7 @@
}
},
{
- "__docId__": 383,
+ "__docId__": 384,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/checkList.js~CheckList",
@@ -7620,7 +7708,7 @@
"return": null
},
{
- "__docId__": 385,
+ "__docId__": 386,
"kind": "file",
"name": "src/modules/clearButton.js",
"content": "import {Feature} from '../feature';\nimport {createElm, createText, elm, removeElm} from '../dom';\nimport {addEvt} from '../event';\nimport {defaultsStr} from '../settings';\nimport {isNull} from '../types';\nimport {RIGHT} from './toolbar';\n\n/**\n * Clear button UI component\n */\nexport class ClearButton extends Feature {\n\n /**\n * Creates an instance of ClearButton\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'btnReset');\n\n let f = this.config.btn_reset || {};\n\n /**\n * Container element ID\n * @type {String}\n */\n this.targetId = defaultsStr(f.target_id, null);\n\n /**\n * Text for the clear button\n * @type {String}\n */\n this.text = defaultsStr(f.text, null);\n\n /**\n * Css class for reset button\n * @type {String}\n */\n this.cssClass = defaultsStr(f.css_class, 'reset');\n\n /**\n * Tooltip text for the clear button\n * @type {String}\n */\n this.tooltip = f.tooltip || 'Clear filters';\n\n /**\n * Custom Html string for the clear button\n * @type {String}\n */\n this.html = defaultsStr(f.html,\n (!tf.enableIcons || this.text ? null :\n ''));\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, RIGHT);\n\n /**\n * Clear button container element\n * @type {DOMElement}\n * @private\n */\n this.container = null;\n\n /**\n * Clear button element\n * @type {DOMElement}\n * @private\n */\n this.element = null;\n }\n\n /**\n * Click event handler for clear button\n * @private\n */\n onClick() {\n if (!this.isEnabled()) {\n return;\n }\n this.tf.clearFilters();\n }\n\n /**\n * Initialize clear button component\n */\n init() {\n let tf = this.tf;\n\n if (this.initialized) {\n return;\n }\n\n this.emitter.emit('initializing-feature', this, !isNull(this.targetId));\n\n let cont = createElm('span');\n\n let targetEl = !this.targetId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.targetId);\n targetEl.appendChild(cont);\n\n if (!this.html) {\n let fltReset = createElm('a', ['href', 'javascript:void(0);']);\n fltReset.className = this.cssClass;\n fltReset.appendChild(createText(this.text));\n cont.appendChild(fltReset);\n addEvt(fltReset, 'click', () => this.onClick());\n } else {\n cont.innerHTML = this.html;\n let resetEl = cont.firstChild;\n addEvt(resetEl, 'click', () => this.onClick());\n }\n this.element = cont.firstChild;\n this.container = cont;\n\n /** @inherited */\n this.initialized = true;\n\n this.emitter.emit('feature-initialized', this);\n }\n\n /**\n * Destroy ClearButton instance\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n removeElm(this.element);\n removeElm(this.container);\n this.element = null;\n this.container = null;\n this.initialized = false;\n }\n}\n",
@@ -7631,7 +7719,7 @@
"lineNumber": 1
},
{
- "__docId__": 386,
+ "__docId__": 387,
"kind": "class",
"name": "ClearButton",
"memberof": "src/modules/clearButton.js",
@@ -7649,7 +7737,7 @@
]
},
{
- "__docId__": 387,
+ "__docId__": 388,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7674,7 +7762,7 @@
]
},
{
- "__docId__": 388,
+ "__docId__": 389,
"kind": "member",
"name": "targetId",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7693,7 +7781,7 @@
}
},
{
- "__docId__": 389,
+ "__docId__": 390,
"kind": "member",
"name": "text",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7712,7 +7800,7 @@
}
},
{
- "__docId__": 390,
+ "__docId__": 391,
"kind": "member",
"name": "cssClass",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7731,7 +7819,7 @@
}
},
{
- "__docId__": 391,
+ "__docId__": 392,
"kind": "member",
"name": "tooltip",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7750,7 +7838,7 @@
}
},
{
- "__docId__": 392,
+ "__docId__": 393,
"kind": "member",
"name": "html",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7769,7 +7857,7 @@
}
},
{
- "__docId__": 393,
+ "__docId__": 394,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7788,7 +7876,7 @@
}
},
{
- "__docId__": 394,
+ "__docId__": 395,
"kind": "member",
"name": "container",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7804,10 +7892,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 395,
+ "__docId__": 396,
"kind": "member",
"name": "element",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7823,10 +7912,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 396,
+ "__docId__": 397,
"kind": "method",
"name": "onClick",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7837,11 +7927,12 @@
"access": "private",
"description": "Click event handler for clear button",
"lineNumber": 80,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 397,
+ "__docId__": 398,
"kind": "method",
"name": "init",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7856,7 +7947,7 @@
"return": null
},
{
- "__docId__": 400,
+ "__docId__": 401,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7878,7 +7969,7 @@
}
},
{
- "__docId__": 401,
+ "__docId__": 402,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/clearButton.js~ClearButton",
@@ -7893,7 +7984,7 @@
"return": null
},
{
- "__docId__": 405,
+ "__docId__": 406,
"kind": "file",
"name": "src/modules/dateType.js",
"content": "import {Date as SugarDate} from 'sugar-date';\nimport 'sugar-date/locales';\nimport {Feature} from '../feature';\nimport {isObj, isArray} from '../types';\nimport {DATE} from '../const';\nimport {root} from '../root';\n\n/**\n * Wrapper for Sugar Date module providing datetime helpers and locales\n * @export\n * @class DateType\n */\nexport class DateType extends Feature {\n\n /**\n * Creates an instance of DateType\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'dateType');\n\n /**\n * Global locale\n * @type {String}\n */\n this.locale = tf.locale;\n\n /**\n * Sugar Date instance\n * @type {Object}\n */\n this.datetime = SugarDate;\n\n this.enable();\n }\n\n /**\n * Initialize DateType instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n // Set global locale\n this.datetime.setLocale(this.locale);\n\n // Add formats from column types configuration if any\n this.addConfigFormats(this.tf.colTypes);\n\n this.emitter.on(\n ['add-date-type-formats'],\n (tf, types) => this.addConfigFormats(types)\n );\n\n // Broadcast date-type initialization\n this.emitter.emit('date-type-initialized', this.tf, this);\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Parse a string representation of a date for a specified locale and return\n * a date object\n * @param {String} dateStr String representation of a date\n * @param {String} localeCode Locale code (ie 'en-us')\n * @returns {Date}\n */\n parse(dateStr, localeCode) {\n return this.datetime.create(dateStr, localeCode);\n }\n\n /**\n * Check string representation of a date for a specified locale is valid\n * @param {any} dateStr String representation of a date\n * @param {any} localeCode Locale code (ie 'en-us')\n * @returns {Boolean}\n */\n isValid(dateStr, localeCode) {\n return this.datetime.isValid(this.parse(dateStr, localeCode));\n }\n\n /**\n * Return the type object of a specified column as per configuration or\n * passed collection\n * @param {Number} colIndex Column index\n * @param {Array} types Collection of column types, optional\n * @returns {Object}\n */\n getOptions(colIndex, types) {\n types = types || this.tf.colTypes;\n let colType = types[colIndex];\n return isObj(colType) ? colType : {};\n }\n\n /**\n * Return the locale code for supplied column index as per configuration\n * or global setting\n * @param {Number} colIndex Column index\n * @returns {String} Locale code (ie: 'en-us')\n */\n getLocale(colIndex) {\n return this.getOptions(colIndex).locale || this.locale;\n }\n\n /**\n * Add date time format(s) to a locale as specified by the passed\n * collection of column types, ie:\n * [\n * 'string',\n * 'number',\n * { type: 'date', locale: 'en', format: ['{dd}/{MM}/{yyyy}']}\n * ]\n *\n * @param {Array} [types=[]] Collection of column types\n */\n addConfigFormats(types=[]) {\n types.forEach((type, idx) => {\n let options = this.getOptions(idx, types);\n if (options.type === DATE && options.hasOwnProperty('format')) {\n let locale = this.datetime.getLocale(\n options.locale || this.locale\n );\n let formats = isArray(options.format) ?\n options.format : [options.format];\n\n // Sugar date module throws exceptions with locale.addFormat\n try {\n formats.forEach((format) => {\n locale.addFormat(format);\n });\n } catch (ex) {\n root.console.error(ex);\n }\n }\n });\n }\n\n /**\n * Remove DateType instance\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n // TODO: remove added formats\n\n this.emitter.off(\n ['add-date-type-formats'],\n (tf, types) => this.addConfigFormats(types)\n );\n\n this.initialized = false;\n }\n}\n",
@@ -7904,7 +7995,7 @@
"lineNumber": 1
},
{
- "__docId__": 406,
+ "__docId__": 407,
"kind": "class",
"name": "DateType",
"memberof": "src/modules/dateType.js",
@@ -7928,7 +8019,7 @@
]
},
{
- "__docId__": 407,
+ "__docId__": 408,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/dateType.js~DateType",
@@ -7953,7 +8044,7 @@
]
},
{
- "__docId__": 408,
+ "__docId__": 409,
"kind": "member",
"name": "locale",
"memberof": "src/modules/dateType.js~DateType",
@@ -7972,7 +8063,7 @@
}
},
{
- "__docId__": 409,
+ "__docId__": 410,
"kind": "member",
"name": "datetime",
"memberof": "src/modules/dateType.js~DateType",
@@ -7991,7 +8082,7 @@
}
},
{
- "__docId__": 410,
+ "__docId__": 411,
"kind": "method",
"name": "init",
"memberof": "src/modules/dateType.js~DateType",
@@ -8006,7 +8097,7 @@
"return": null
},
{
- "__docId__": 411,
+ "__docId__": 412,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/dateType.js~DateType",
@@ -8028,7 +8119,7 @@
}
},
{
- "__docId__": 412,
+ "__docId__": 413,
"kind": "method",
"name": "parse",
"memberof": "src/modules/dateType.js~DateType",
@@ -8077,7 +8168,7 @@
}
},
{
- "__docId__": 413,
+ "__docId__": 414,
"kind": "method",
"name": "isValid",
"memberof": "src/modules/dateType.js~DateType",
@@ -8126,7 +8217,7 @@
}
},
{
- "__docId__": 414,
+ "__docId__": 415,
"kind": "method",
"name": "getOptions",
"memberof": "src/modules/dateType.js~DateType",
@@ -8175,7 +8266,7 @@
}
},
{
- "__docId__": 415,
+ "__docId__": 416,
"kind": "method",
"name": "getLocale",
"memberof": "src/modules/dateType.js~DateType",
@@ -8214,7 +8305,7 @@
}
},
{
- "__docId__": 416,
+ "__docId__": 417,
"kind": "method",
"name": "addConfigFormats",
"memberof": "src/modules/dateType.js~DateType",
@@ -8242,7 +8333,7 @@
"return": null
},
{
- "__docId__": 417,
+ "__docId__": 418,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/dateType.js~DateType",
@@ -8257,7 +8348,7 @@
"return": null
},
{
- "__docId__": 419,
+ "__docId__": 420,
"kind": "file",
"name": "src/modules/dropdown.js",
"content": "import {BaseDropdown} from './baseDropdown';\nimport {createElm, createOpt, elm} from '../dom';\nimport {has} from '../array';\nimport {matchCase} from '../string';\nimport {addEvt, targetEvt} from '../event';\nimport {SELECT, MULTIPLE, NONE} from '../const';\nimport {defaultsStr, defaultsBool} from '../settings';\n\n/**\n * Dropdown filter UI component\n * @export\n * @class Dropdown\n * @extends {BaseDropdown}\n */\nexport class Dropdown extends BaseDropdown {\n\n /**\n * Creates an instance of Dropdown\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'dropdown');\n\n // Configuration object\n let f = this.config;\n\n /**\n * Enable the reset filter option as first item\n * @type {Boolean}\n */\n this.enableSlcResetFilter =\n defaultsBool(f.enable_slc_reset_filter, true);\n\n /**\n * Non empty option text\n * @type {String}\n */\n this.nonEmptyText = defaultsStr(f.non_empty_text, '(Non empty)');\n\n /**\n * Tooltip text appearing on multiple select\n * @type {String}\n */\n this.multipleSlcTooltip = defaultsStr(f.multiple_slc_tooltip,\n 'Use Ctrl/Cmd key for multiple selections');\n }\n\n\n /**\n * Drop-down filter focus event handler\n * @param {Event} e DOM Event\n * @private\n */\n onSlcFocus(e) {\n let elm = targetEvt(e);\n let tf = this.tf;\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, elm);\n }\n\n /**\n * Drop-down filter change event handler\n * @private\n */\n onSlcChange() {\n if (this.tf.onSlcChange) {\n this.tf.filter();\n }\n }\n\n /**\n * Refresh all drop-down filters\n */\n refreshAll() {\n let selectFlts = this.tf.getFiltersByType(SELECT, true);\n let multipleFlts = this.tf.getFiltersByType(MULTIPLE, true);\n let colIdxs = selectFlts.concat(multipleFlts);\n this.refreshFilters(colIdxs);\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.externalFltIds[colIndex] : null;\n\n let slc = createElm(SELECT,\n ['id', tf.buildFilterId(colIndex)],\n ['ct', colIndex], ['filled', '0']\n );\n\n if (col === MULTIPLE) {\n slc.multiple = MULTIPLE;\n slc.title = this.multipleSlcTooltip;\n }\n slc.className = col.toLowerCase() === SELECT ?\n tf.fltCssClass : tf.fltMultiCssClass;\n\n //filter is appended in container element\n if (externalFltTgtId) {\n elm(externalFltTgtId).appendChild(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 = createOpt(tf.getClearFilterText(colIndex), '');\n slc.appendChild(opt0);\n }\n\n addEvt(slc, 'change', () => this.onSlcChange());\n addEvt(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 this.emitter.on(['rows-changed'], () => this.refreshAll());\n\n /** @inherited */\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 filters behaviour\n */\n build(colIndex, isLinked = false) {\n let tf = this.tf;\n colIndex = Number(colIndex);\n\n this.emitter.emit('before-populating-filter', tf, colIndex);\n\n /** @inherited */\n this.opts = [];\n /** @inherited */\n this.optsTxt = [];\n\n let slc = tf.getFilterElement(colIndex);\n\n //custom select test\n /** @inherited */\n this.isCustom = tf.isCustomOptions(colIndex);\n\n //Retrieves custom values\n if (this.isCustom) {\n let customValues = tf.getCustomOptions(colIndex);\n this.opts = customValues[0];\n this.optsTxt = customValues[1];\n }\n\n //custom selects text\n let activeIdx;\n let activeFilterId = tf.getActiveFilterId();\n if (isLinked && activeFilterId) {\n activeIdx = tf.getColumnIndexFromFilterId(activeFilterId);\n }\n\n let excludedOpts = null,\n filteredDataCol = null;\n if (isLinked && tf.disableExcludedOptions) {\n excludedOpts = [];\n filteredDataCol = [];\n }\n\n let eachRow = tf.eachRow();\n eachRow(\n (row) => {\n let cellValue = tf.getCellValue(row.cells[colIndex]);\n //Vary Peter's patch\n let cellString = matchCase(cellValue, tf.caseSensitive);\n\n // checks if celldata is already in array\n if (!has(this.opts, cellString, tf.caseSensitive)) {\n this.opts.push(cellValue);\n }\n\n if (isLinked && tf.disableExcludedOptions) {\n let filteredCol = filteredDataCol[colIndex];\n if (!filteredCol) {\n filteredCol = tf.getVisibleColumnValues(colIndex);\n }\n if (!has(filteredCol, cellString, tf.caseSensitive) &&\n !has(excludedOpts, cellString, tf.caseSensitive)) {\n excludedOpts.push(cellValue);\n }\n }\n },\n // continue conditions function\n (row, k) => {\n // excluded rows don't need to appear on selects as always valid\n if (tf.excludeRows.indexOf(k) !== -1) {\n return true;\n }\n\n // checks if row has expected number of cells\n if (row.cells.length !== tf.nbCells || this.isCustom) {\n return true;\n }\n\n if (isLinked && !this.isValidLinkedValue(k, activeIdx)) {\n return true;\n }\n }\n );\n\n //sort options\n this.opts = this.sortOptions(colIndex, this.opts);\n if (excludedOpts) {\n excludedOpts = this.sortOptions(colIndex, excludedOpts);\n }\n\n //populates drop-down\n this.addOptions(colIndex, slc, isLinked, excludedOpts);\n\n this.emitter.emit('after-populating-filter', tf, colIndex, slc);\n }\n\n /**\n * Add drop-down options\n * @param {Number} colIndex Column index\n * @param {Object} slc Select Dom element\n * @param {Boolean} isLinked Enable linked refresh behaviour\n * @param {Array} excludedOpts Array of excluded options\n */\n addOptions(colIndex, slc, isLinked, excludedOpts) {\n let tf = this.tf,\n slcValue = slc.value;\n\n slc.innerHTML = '';\n slc = this.addFirstOption(slc);\n\n for (let y = 0; y < this.opts.length; y++) {\n if (this.opts[y] === '') {\n continue;\n }\n let val = this.opts[y]; //option value\n let lbl = this.isCustom ? this.optsTxt[y] : val; //option text\n let isDisabled = false;\n if (isLinked && tf.disableExcludedOptions &&\n has(excludedOpts, matchCase(val, tf.caseSensitive),\n tf.caseSensitive)) {\n isDisabled = true;\n }\n\n let opt;\n //fill select on demand\n if (tf.loadFltOnDemand && slcValue === this.opts[y] &&\n tf.getFilterType(colIndex) === SELECT) {\n opt = createOpt(lbl, val, true);\n } else {\n opt = createOpt(lbl, val, false);\n }\n if (isDisabled) {\n opt.disabled = true;\n }\n slc.appendChild(opt);\n }// for y\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 let colIdx = tf.getColumnIndexFromFilterId(slc.id);\n let opt0 = createOpt((!this.enableSlcResetFilter ?\n '' : tf.getClearFilterText(colIdx)), '');\n if (!this.enableSlcResetFilter) {\n opt0.style.display = NONE;\n }\n slc.appendChild(opt0);\n if (tf.enableEmptyOption) {\n let opt1 = createOpt(tf.emptyText, tf.emOperator);\n slc.appendChild(opt1);\n }\n if (tf.enableNonEmptyOption) {\n let opt2 = createOpt(tf.nonEmptyText, tf.nmOperator);\n slc.appendChild(opt2);\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 (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 !== '' && has(values, option.value, true)) {\n option.selected = true;\n }//if\n });\n }\n\n /**\n * Get filter values for a given column index\n * @param {Number} colIndex Column index\n * @returns {Array} values Array of selected values\n */\n getValues(colIndex) {\n let tf = this.tf;\n let slc = tf.getFilterElement(colIndex);\n let values = [];\n\n // IE >= 9 does not support the selectedOptions property :(\n if (slc.selectedOptions) {\n [].forEach.call(slc.selectedOptions,\n option => values.push(option.value));\n } else {\n [].forEach.call(slc.options, (option) => {\n if (option.selected) {\n values.push(option.value);\n }\n });\n }\n\n return values;\n }\n\n /**\n * Destroy Dropdown instance\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 this.emitter.off(['rows-changed'], () => this.refreshAll());\n this.initialized = false;\n }\n}\n",
@@ -8268,7 +8359,7 @@
"lineNumber": 1
},
{
- "__docId__": 420,
+ "__docId__": 421,
"kind": "class",
"name": "Dropdown",
"memberof": "src/modules/dropdown.js",
@@ -8292,7 +8383,7 @@
]
},
{
- "__docId__": 421,
+ "__docId__": 422,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8317,7 +8408,7 @@
]
},
{
- "__docId__": 422,
+ "__docId__": 423,
"kind": "member",
"name": "enableSlcResetFilter",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8336,7 +8427,7 @@
}
},
{
- "__docId__": 423,
+ "__docId__": 424,
"kind": "member",
"name": "nonEmptyText",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8355,7 +8446,7 @@
}
},
{
- "__docId__": 424,
+ "__docId__": 425,
"kind": "member",
"name": "multipleSlcTooltip",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8374,7 +8465,7 @@
}
},
{
- "__docId__": 425,
+ "__docId__": 426,
"kind": "method",
"name": "onSlcFocus",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8397,10 +8488,11 @@
"description": "DOM Event"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 426,
+ "__docId__": 427,
"kind": "method",
"name": "onSlcChange",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8411,11 +8503,12 @@
"access": "private",
"description": "Drop-down filter change event handler",
"lineNumber": 69,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 427,
+ "__docId__": 428,
"kind": "method",
"name": "refreshAll",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8430,7 +8523,7 @@
"return": null
},
{
- "__docId__": 428,
+ "__docId__": 429,
"kind": "method",
"name": "init",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8476,7 +8569,7 @@
"return": null
},
{
- "__docId__": 429,
+ "__docId__": 430,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8498,7 +8591,7 @@
}
},
{
- "__docId__": 430,
+ "__docId__": 431,
"kind": "method",
"name": "build",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8534,7 +8627,7 @@
"return": null
},
{
- "__docId__": 431,
+ "__docId__": 432,
"kind": "member",
"name": "opts",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8556,7 +8649,7 @@
}
},
{
- "__docId__": 432,
+ "__docId__": 433,
"kind": "member",
"name": "optsTxt",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8578,7 +8671,7 @@
}
},
{
- "__docId__": 433,
+ "__docId__": 434,
"kind": "member",
"name": "isCustom",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8600,7 +8693,7 @@
}
},
{
- "__docId__": 437,
+ "__docId__": 438,
"kind": "method",
"name": "addOptions",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8656,7 +8749,7 @@
"return": null
},
{
- "__docId__": 438,
+ "__docId__": 439,
"kind": "method",
"name": "addFirstOption",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8686,7 +8779,7 @@
}
},
{
- "__docId__": 439,
+ "__docId__": 440,
"kind": "method",
"name": "selectOptions",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8722,7 +8815,7 @@
"return": null
},
{
- "__docId__": 440,
+ "__docId__": 441,
"kind": "method",
"name": "getValues",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8761,7 +8854,7 @@
}
},
{
- "__docId__": 441,
+ "__docId__": 442,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/dropdown.js~Dropdown",
@@ -8776,7 +8869,7 @@
"return": null
},
{
- "__docId__": 443,
+ "__docId__": 444,
"kind": "file",
"name": "src/modules/gridLayout.js",
"content": "import {Feature} from '../feature';\nimport {createElm, removeElm, elm, tag} from '../dom';\nimport {addEvt, targetEvt} from '../event';\nimport {contains} from '../string';\nimport {NONE} from '../const';\nimport {\n defaultsBool, defaultsStr, defaultsNb, defaultsArr\n} from '../settings';\n\n/**\n * Grid layout, table with fixed headers\n */\nexport class GridLayout extends Feature {\n\n /**\n * Creates an instance of GridLayout\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'gridLayout');\n\n let f = this.config.grid_layout || {};\n\n /**\n * Grid-layout container width as CSS string\n * @type {String}\n */\n this.width = defaultsStr(f.width, null);\n\n /**\n * Grid-layout container height as CSS string\n * @type {String}\n */\n this.height = defaultsStr(f.height, null);\n\n /**\n * Css class for main container element\n * @type {String}\n */\n this.mainContCssClass = defaultsStr(f.cont_css_class, 'grd_Cont');\n\n /**\n * Css class for body table container element\n * @type {String}\n */\n this.contCssClass = defaultsStr(f.tbl_cont_css_class, 'grd_tblCont');\n\n /**\n * Css class for headers table container element\n * @type {String}\n */\n this.headContCssClass = defaultsStr(f.tbl_head_css_class,\n 'grd_headTblCont');\n\n /**\n * Css class for toolbar container element (rows counter, paging etc.)\n * @type {String}\n */\n this.infDivCssClass = defaultsStr(f.inf_grid_css_class, 'grd_inf');\n\n /**\n * Index of the headers row, default: 0\n * @type {Number}\n */\n this.headRowIndex = defaultsNb(f.headers_row_index, 0);\n\n /**\n * Collection of the header row indexes to be moved into headers table\n * @type {Array}\n */\n this.headRows = defaultsArr(f.headers_rows, [0]);\n\n /**\n * Enable or disable column filters generation, default: true\n * @type {Boolean}\n */\n this.filters = defaultsBool(f.filters, true);\n\n /**\n * Enable or disable column headers, default: false\n * @type {Boolean}\n */\n this.noHeaders = Boolean(f.no_headers);\n\n /**\n * Grid-layout default column widht as CSS string\n * @type {String}\n */\n this.defaultColWidth = defaultsStr(f.default_col_width, '100px');\n\n /**\n * List of column elements\n * @type {Array}\n * @private\n */\n this.colElms = [];\n\n /**\n * Prefix for grid-layout filter's cell ID\n * @type {String}\n * @private\n */\n this.prfxGridFltTd = '_td_';\n\n /**\n * Prefix for grid-layout header's cell ID\n * @type {String}\n * @private\n */\n this.prfxGridTh = 'tblHeadTh_';\n\n /**\n * Mark-up of original HTML table\n * @type {String}\n * @private\n */\n this.sourceTblHtml = tf.dom().outerHTML;\n\n /**\n * Indicates if working table has column elements\n * @type {Boolean}\n * @private\n */\n this.tblHasColTag = tag(tf.dom(), 'col').length > 0 ? true : false;\n\n /**\n * Main container element\n * @private\n */\n this.tblMainCont = null;\n\n /**\n * Table container element\n * @private\n */\n this.tblCont = null;\n\n /**\n * Headers' table container element\n * @private\n */\n this.headTblCont = null;\n\n /**\n * Headers' table element\n * @private\n */\n this.headTbl = null;\n\n // filters flag at TF level\n tf.fltGrid = this.filters;\n }\n\n /**\n * Generates a grid with fixed headers\n * TODO: reduce size of init by extracting single purposed methods\n */\n init() {\n let tf = this.tf;\n let tbl = tf.dom();\n\n if (this.initialized) {\n return;\n }\n\n // Override relevant TableFilter properties\n this.setOverrides();\n\n // Assign default column widths\n this.setDefaultColWidths();\n\n //Main container: it will contain all the elements\n this.tblMainCont = this.createContainer(\n 'div', this.mainContCssClass);\n if (this.width) {\n this.tblMainCont.style.width = this.width;\n }\n tbl.parentNode.insertBefore(this.tblMainCont, tbl);\n\n //Table container: div wrapping content table\n this.tblCont = this.createContainer('div', this.contCssClass);\n this.setConfigWidth(this.tblCont);\n if (this.height) {\n this.tblCont.style.height = this.height;\n }\n tbl.parentNode.insertBefore(this.tblCont, tbl);\n let t = removeElm(tbl);\n this.tblCont.appendChild(t);\n\n //In case table width is expressed in %\n if (tbl.style.width === '') {\n let tblW = this.initialTableWidth();\n tbl.style.width = (contains('%', tblW) ?\n tbl.clientWidth : tblW) + 'px';\n }\n\n let d = removeElm(this.tblCont);\n this.tblMainCont.appendChild(d);\n\n //Headers table container: div wrapping headers table\n this.headTblCont = this.createContainer(\n 'div', this.headContCssClass);\n\n //Headers table\n this.headTbl = createElm('table');\n let tH = createElm('tHead');\n\n //1st row should be headers row, ids are added if not set\n //Those ids are used by the sort feature\n let hRow = tbl.rows[this.headRowIndex];\n let sortTriggers = this.getSortTriggerIds(hRow);\n\n //Filters row is created\n let filtersRow = this.createFiltersRow();\n\n //Headers row are moved from content table to headers table\n this.setHeadersRow(tH);\n\n this.headTbl.appendChild(tH);\n if (tf.filtersRowIndex === 0) {\n tH.insertBefore(filtersRow, hRow);\n } else {\n tH.appendChild(filtersRow);\n }\n\n this.headTblCont.appendChild(this.headTbl);\n this.tblCont.parentNode.insertBefore(this.headTblCont, this.tblCont);\n\n //THead needs to be removed in content table for sort feature\n let thead = tag(tbl, 'thead');\n if (thead.length > 0) {\n tbl.removeChild(thead[0]);\n }\n\n // ensure table layout is always set even if already set in css\n // definitions, potentially with custom css class this could be lost\n this.headTbl.style.tableLayout = 'fixed';\n tbl.style.tableLayout = 'fixed';\n\n //content table without headers needs col widths to be reset\n tf.setColWidths(this.headTbl);\n\n //Headers container width\n this.headTbl.style.width = tbl.style.width;\n //\n\n //scroll synchronisation\n addEvt(this.tblCont, 'scroll', (evt) => {\n let elm = targetEvt(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 // TODO: Trigger a custom event handled by sort extension\n let sort = tf.extension('sort');\n if (sort) {\n sort.asyncSort = true;\n sort.triggerIds = sortTriggers;\n }\n\n //Col elements are enough to keep column widths after sorting and\n //filtering\n this.setColumnElements();\n\n if (tf.popupFilters) {\n filtersRow.style.display = NONE;\n }\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Overrides TableFilter instance properties to adjust to grid layout mode\n * @private\n */\n setOverrides() {\n let tf = this.tf;\n tf.refRow = 0;\n tf.headersRow = 0;\n tf.filtersRowIndex = 1;\n }\n\n /**\n * Set grid-layout default column widths if column widths are not defined\n * @private\n */\n setDefaultColWidths() {\n let tf = this.tf;\n if (tf.colWidths.length > 0) {\n return;\n }\n\n tf.eachCol((k) => {\n let colW;\n let cell = tf.dom().rows[tf.getHeadersRowIndex()].cells[k];\n if (cell.width !== '') {\n colW = cell.width;\n } else if (cell.style.width !== '') {\n colW = parseInt(cell.style.width, 10);\n } else {\n colW = this.defaultColWidth;\n }\n tf.colWidths[k] = colW;\n });\n\n tf.setColWidths();\n }\n\n /**\n * Initial table width\n * @returns {Number}\n * @private\n */\n initialTableWidth() {\n let tbl = this.tf.dom();\n let width; //initial table width\n\n if (tbl.width !== '') {\n width = tbl.width;\n }\n else if (tbl.style.width !== '') {\n width = tbl.style.width;\n } else {\n width = tbl.clientWidth;\n }\n return parseInt(width, 10);\n }\n\n /**\n * Creates container element\n * @param {String} tag Tag name\n * @param {String} className Css class to assign to element\n * @returns {DOMElement}\n * @private\n */\n createContainer(tag, className) {\n let element = createElm(tag);\n element.className = className;\n return element;\n }\n\n /**\n * Creates filters row with cells\n * @returns {HTMLTableRowElement}\n * @private\n */\n createFiltersRow() {\n let tf = this.tf;\n let filtersRow = createElm('tr');\n if (this.filters && tf.fltGrid) {\n tf.externalFltIds = [];\n tf.eachCol((j) => {\n let fltTdId = `${tf.prfxFlt + j + this.prfxGridFltTd + tf.id}`;\n let cl = createElm(tf.fltCellTag, ['id', fltTdId]);\n filtersRow.appendChild(cl);\n tf.externalFltIds[j] = fltTdId;\n });\n }\n return filtersRow;\n }\n\n /**\n * Generates column elements if necessary and assigns their widths\n * @private\n */\n setColumnElements() {\n let tf = this.tf;\n let cols = tag(tf.dom(), 'col');\n this.tblHasColTag = cols.length > 0;\n\n for (let k = (tf.getCellsNb() - 1); k >= 0; k--) {\n let col;\n\n if (!this.tblHasColTag) {\n col = createElm('col');\n tf.dom().insertBefore(col, tf.dom().firstChild);\n } else {\n col = cols[k];\n }\n col.style.width = tf.colWidths[k];\n this.colElms[k] = col;\n }\n this.tblHasColTag = true;\n }\n\n /**\n * Sets headers row in headers table\n * @param {HTMLHeadElement} tableHead Table head element\n * @private\n */\n setHeadersRow(tableHead) {\n if (this.noHeaders) {\n // Handle table with no headers, assuming here headers do not\n // exist\n tableHead.appendChild(createElm('tr'));\n } else {\n // Headers row are moved from content table to headers table\n for (let i = 0; i < this.headRows.length; i++) {\n let row = this.tf.dom().rows[this.headRows[i]];\n tableHead.appendChild(row);\n }\n }\n }\n\n /**\n * Sets width defined in configuration to passed element\n * @param {DOMElement} element DOM element\n * @private\n */\n setConfigWidth(element) {\n if (!this.width) {\n return;\n }\n if (this.width.indexOf('%') !== -1) {\n element.style.width = '100%';\n } else {\n element.style.width = this.width;\n }\n }\n\n /**\n * Returns a list of header IDs used for specifing external sort triggers\n * @param {HTMLTableRowElement} row DOM row element\n * @returns {Array} List of IDs\n * @private\n */\n getSortTriggerIds(row) {\n let tf = this.tf;\n let sortTriggers = [];\n tf.eachCol((n) => {\n let c = row.cells[n];\n let thId = c.getAttribute('id');\n if (!thId || thId === '') {\n thId = `${this.prfxGridTh + n}_${tf.id}`;\n c.setAttribute('id', thId);\n }\n sortTriggers.push(thId);\n });\n return sortTriggers;\n }\n\n /**\n * Removes the grid layout\n */\n destroy() {\n let tf = this.tf;\n let tbl = tf.dom();\n\n if (!this.initialized) {\n return;\n }\n let t = removeElm(tbl);\n this.tblMainCont.parentNode.insertBefore(t, this.tblMainCont);\n removeElm(this.tblMainCont);\n\n this.tblMainCont = null;\n this.headTblCont = null;\n this.headTbl = null;\n this.tblCont = null;\n\n tbl.outerHTML = this.sourceTblHtml;\n //needed to keep reference of table element for future usage\n this.tf.tbl = elm(tf.id);\n\n this.initialized = false;\n }\n}\n",
@@ -8787,7 +8880,7 @@
"lineNumber": 1
},
{
- "__docId__": 444,
+ "__docId__": 445,
"kind": "class",
"name": "GridLayout",
"memberof": "src/modules/gridLayout.js",
@@ -8805,7 +8898,7 @@
]
},
{
- "__docId__": 445,
+ "__docId__": 446,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -8830,7 +8923,7 @@
]
},
{
- "__docId__": 446,
+ "__docId__": 447,
"kind": "member",
"name": "width",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -8849,7 +8942,7 @@
}
},
{
- "__docId__": 447,
+ "__docId__": 448,
"kind": "member",
"name": "height",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -8868,7 +8961,7 @@
}
},
{
- "__docId__": 448,
+ "__docId__": 449,
"kind": "member",
"name": "mainContCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -8887,7 +8980,7 @@
}
},
{
- "__docId__": 449,
+ "__docId__": 450,
"kind": "member",
"name": "contCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -8906,7 +8999,7 @@
}
},
{
- "__docId__": 450,
+ "__docId__": 451,
"kind": "member",
"name": "headContCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -8925,7 +9018,7 @@
}
},
{
- "__docId__": 451,
+ "__docId__": 452,
"kind": "member",
"name": "infDivCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -8944,7 +9037,7 @@
}
},
{
- "__docId__": 452,
+ "__docId__": 453,
"kind": "member",
"name": "headRowIndex",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -8963,7 +9056,7 @@
}
},
{
- "__docId__": 453,
+ "__docId__": 454,
"kind": "member",
"name": "headRows",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -8982,7 +9075,7 @@
}
},
{
- "__docId__": 454,
+ "__docId__": 455,
"kind": "member",
"name": "filters",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9001,7 +9094,7 @@
}
},
{
- "__docId__": 455,
+ "__docId__": 456,
"kind": "member",
"name": "noHeaders",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9020,7 +9113,7 @@
}
},
{
- "__docId__": 456,
+ "__docId__": 457,
"kind": "member",
"name": "defaultColWidth",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9039,7 +9132,7 @@
}
},
{
- "__docId__": 457,
+ "__docId__": 458,
"kind": "member",
"name": "colElms",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9055,10 +9148,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 458,
+ "__docId__": 459,
"kind": "member",
"name": "prfxGridFltTd",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9074,10 +9168,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 459,
+ "__docId__": 460,
"kind": "member",
"name": "prfxGridTh",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9093,10 +9188,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 460,
+ "__docId__": 461,
"kind": "member",
"name": "sourceTblHtml",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9112,10 +9208,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 461,
+ "__docId__": 462,
"kind": "member",
"name": "tblHasColTag",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9131,10 +9228,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 462,
+ "__docId__": 463,
"kind": "member",
"name": "tblMainCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9143,22 +9241,7 @@
"access": "private",
"description": "Main container element",
"lineNumber": 130,
- "type": {
- "types": [
- "*"
- ]
- }
- },
- {
- "__docId__": 463,
- "kind": "member",
- "name": "tblCont",
- "memberof": "src/modules/gridLayout.js~GridLayout",
- "static": false,
- "longname": "src/modules/gridLayout.js~GridLayout#tblCont",
- "access": "private",
- "description": "Table container element",
- "lineNumber": 136,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -9168,13 +9251,14 @@
{
"__docId__": 464,
"kind": "member",
- "name": "headTblCont",
+ "name": "tblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
- "longname": "src/modules/gridLayout.js~GridLayout#headTblCont",
+ "longname": "src/modules/gridLayout.js~GridLayout#tblCont",
"access": "private",
- "description": "Headers' table container element",
- "lineNumber": 142,
+ "description": "Table container element",
+ "lineNumber": 136,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -9184,13 +9268,14 @@
{
"__docId__": 465,
"kind": "member",
- "name": "headTbl",
+ "name": "headTblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
- "longname": "src/modules/gridLayout.js~GridLayout#headTbl",
+ "longname": "src/modules/gridLayout.js~GridLayout#headTblCont",
"access": "private",
- "description": "Headers' table element",
- "lineNumber": 148,
+ "description": "Headers' table container element",
+ "lineNumber": 142,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -9199,6 +9284,23 @@
},
{
"__docId__": 466,
+ "kind": "member",
+ "name": "headTbl",
+ "memberof": "src/modules/gridLayout.js~GridLayout",
+ "static": false,
+ "longname": "src/modules/gridLayout.js~GridLayout#headTbl",
+ "access": "private",
+ "description": "Headers' table element",
+ "lineNumber": 148,
+ "ignore": true,
+ "type": {
+ "types": [
+ "*"
+ ]
+ }
+ },
+ {
+ "__docId__": 467,
"kind": "method",
"name": "init",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9213,7 +9315,7 @@
"return": null
},
{
- "__docId__": 471,
+ "__docId__": 472,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9235,7 +9337,7 @@
}
},
{
- "__docId__": 472,
+ "__docId__": 473,
"kind": "method",
"name": "setOverrides",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9246,11 +9348,12 @@
"access": "private",
"description": "Overrides TableFilter instance properties to adjust to grid layout mode",
"lineNumber": 292,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 473,
+ "__docId__": 474,
"kind": "method",
"name": "setDefaultColWidths",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9261,11 +9364,12 @@
"access": "private",
"description": "Set grid-layout default column widths if column widths are not defined",
"lineNumber": 303,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 474,
+ "__docId__": 475,
"kind": "method",
"name": "initialTableWidth",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9290,10 +9394,11 @@
"spread": false,
"description": ""
},
+ "ignore": true,
"params": []
},
{
- "__docId__": 475,
+ "__docId__": 476,
"kind": "method",
"name": "createContainer",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9339,10 +9444,11 @@
],
"spread": false,
"description": ""
- }
+ },
+ "ignore": true
},
{
- "__docId__": 476,
+ "__docId__": 477,
"kind": "method",
"name": "createFiltersRow",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9367,10 +9473,11 @@
"spread": false,
"description": ""
},
+ "ignore": true,
"params": []
},
{
- "__docId__": 477,
+ "__docId__": 478,
"kind": "method",
"name": "setColumnElements",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9381,11 +9488,12 @@
"access": "private",
"description": "Generates column elements if necessary and assigns their widths",
"lineNumber": 382,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 480,
+ "__docId__": 481,
"kind": "method",
"name": "setHeadersRow",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9408,10 +9516,11 @@
"description": "Table head element"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 481,
+ "__docId__": 482,
"kind": "method",
"name": "setConfigWidth",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9434,10 +9543,11 @@
"description": "DOM element"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 482,
+ "__docId__": 483,
"kind": "method",
"name": "getSortTriggerIds",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9473,10 +9583,11 @@
],
"spread": false,
"description": "List of IDs"
- }
+ },
+ "ignore": true
},
{
- "__docId__": 483,
+ "__docId__": 484,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/gridLayout.js~GridLayout",
@@ -9491,7 +9602,7 @@
"return": null
},
{
- "__docId__": 489,
+ "__docId__": 490,
"kind": "file",
"name": "src/modules/hash.js",
"content": "import {addEvt, removeEvt} from '../event';\nimport {root} from '../root';\n\nconst JSON = root.JSON;\nconst location = root.location;\nconst decodeURIComponent = root.decodeURIComponent;\nconst encodeURIComponent = root.encodeURIComponent;\n\n/**\n * Checks if browser has onhashchange event\n */\nexport const hasHashChange = () => {\n let docMode = root.documentMode;\n return ('onhashchange' in root) && (docMode === undefined || docMode > 7);\n};\n\n/**\n * Manages state via URL hash changes\n *\n * @export\n * @class Hash\n */\nexport class Hash {\n\n /**\n * Creates an instance of Hash\n *\n * @param {State} state Instance of State\n */\n constructor(state) {\n /**\n * State object\n * @type {State}\n */\n this.state = state;\n\n /**\n * Cached URL hash\n * @type {String} Hash string\n * @private\n */\n this.lastHash = null;\n\n /**\n * Application event emitter instance\n * @type {Emitter}\n */\n this.emitter = state.emitter;\n\n /**\n * Bound sync wrapper for future use\n * @private\n */\n this.boundSync = null;\n }\n\n /**\n * Initializes the Hash object\n */\n init() {\n if (!hasHashChange()) {\n return;\n }\n\n this.lastHash = location.hash;\n //Store a bound sync wrapper\n this.boundSync = this.sync.bind(this);\n this.emitter.on(['state-changed'], (tf, state) => this.update(state));\n this.emitter.on(['initialized'], this.boundSync);\n addEvt(root, 'hashchange', this.boundSync);\n }\n\n /**\n * Updates the URL hash based on a state change\n *\n * @param {State} state Instance of State\n */\n update(state) {\n let hash = `#${encodeURIComponent(JSON.stringify(state))}`;\n if (this.lastHash === hash) {\n return;\n }\n\n location.hash = hash;\n this.lastHash = hash;\n }\n\n /**\n * Converts a URL hash into a state JSON object\n *\n * @param {String} hash URL hash fragment\n * @returns {Object} JSON object\n */\n parse(hash) {\n if (hash.indexOf('#') === -1) {\n return null;\n }\n hash = hash.substr(1);\n return JSON.parse(decodeURIComponent(hash));\n }\n\n /**\n * Applies current hash state to features\n */\n sync() {\n let state = this.parse(location.hash);\n if (!state) {\n return;\n }\n // override current state with persisted one and sync features\n this.state.overrideAndSync(state);\n }\n\n /**\n * Release Hash event subscriptions and clear fields\n */\n destroy() {\n this.emitter.off(['state-changed'], (tf, state) => this.update(state));\n this.emitter.off(['initialized'], this.boundSync);\n removeEvt(root, 'hashchange', this.boundSync);\n\n this.state = null;\n this.lastHash = null;\n this.emitter = null;\n }\n}\n",
@@ -9502,7 +9613,7 @@
"lineNumber": 1
},
{
- "__docId__": 490,
+ "__docId__": 491,
"kind": "variable",
"name": "JSON",
"memberof": "src/modules/hash.js",
@@ -9523,7 +9634,7 @@
"ignore": true
},
{
- "__docId__": 491,
+ "__docId__": 492,
"kind": "variable",
"name": "location",
"memberof": "src/modules/hash.js",
@@ -9544,7 +9655,7 @@
"ignore": true
},
{
- "__docId__": 492,
+ "__docId__": 493,
"kind": "variable",
"name": "decodeURIComponent",
"memberof": "src/modules/hash.js",
@@ -9565,7 +9676,7 @@
"ignore": true
},
{
- "__docId__": 493,
+ "__docId__": 494,
"kind": "variable",
"name": "encodeURIComponent",
"memberof": "src/modules/hash.js",
@@ -9586,7 +9697,7 @@
"ignore": true
},
{
- "__docId__": 494,
+ "__docId__": 495,
"kind": "function",
"name": "hasHashChange",
"memberof": "src/modules/hash.js",
@@ -9608,7 +9719,7 @@
}
},
{
- "__docId__": 495,
+ "__docId__": 496,
"kind": "class",
"name": "Hash",
"memberof": "src/modules/hash.js",
@@ -9629,7 +9740,7 @@
"interface": false
},
{
- "__docId__": 496,
+ "__docId__": 497,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/hash.js~Hash",
@@ -9654,7 +9765,7 @@
]
},
{
- "__docId__": 497,
+ "__docId__": 498,
"kind": "member",
"name": "state",
"memberof": "src/modules/hash.js~Hash",
@@ -9673,7 +9784,7 @@
}
},
{
- "__docId__": 498,
+ "__docId__": 499,
"kind": "member",
"name": "lastHash",
"memberof": "src/modules/hash.js~Hash",
@@ -9689,10 +9800,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 499,
+ "__docId__": 500,
"kind": "member",
"name": "emitter",
"memberof": "src/modules/hash.js~Hash",
@@ -9711,7 +9823,7 @@
}
},
{
- "__docId__": 500,
+ "__docId__": 501,
"kind": "member",
"name": "boundSync",
"memberof": "src/modules/hash.js~Hash",
@@ -9720,6 +9832,7 @@
"access": "private",
"description": "Bound sync wrapper for future use",
"lineNumber": 54,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -9727,7 +9840,7 @@
}
},
{
- "__docId__": 501,
+ "__docId__": 502,
"kind": "method",
"name": "init",
"memberof": "src/modules/hash.js~Hash",
@@ -9742,7 +9855,7 @@
"return": null
},
{
- "__docId__": 504,
+ "__docId__": 505,
"kind": "method",
"name": "update",
"memberof": "src/modules/hash.js~Hash",
@@ -9768,7 +9881,7 @@
"return": null
},
{
- "__docId__": 506,
+ "__docId__": 507,
"kind": "method",
"name": "parse",
"memberof": "src/modules/hash.js~Hash",
@@ -9807,7 +9920,7 @@
}
},
{
- "__docId__": 507,
+ "__docId__": 508,
"kind": "method",
"name": "sync",
"memberof": "src/modules/hash.js~Hash",
@@ -9822,7 +9935,7 @@
"return": null
},
{
- "__docId__": 508,
+ "__docId__": 509,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/hash.js~Hash",
@@ -9837,7 +9950,7 @@
"return": null
},
{
- "__docId__": 512,
+ "__docId__": 513,
"kind": "file",
"name": "src/modules/help.js",
"content": "import {Feature} from '../feature';\nimport {createElm, createText, elm, removeElm} from '../dom';\nimport {addEvt, targetEvt, removeEvt} from '../event';\nimport {NONE} from '../const';\nimport {root} from '../root';\nimport {isEmpty, isNull} from '../types';\nimport {defaultsStr} from '../settings';\nimport {RIGHT} from './toolbar';\n\nconst WIKI_URL = 'https://github.com/koalyptus/TableFilter/wiki/' +\n '4.-Filter-operators';\nconst WEBSITE_URL = 'http://koalyptus.github.io/TableFilter/';\n\n/**\n * Help UI component\n */\nexport class Help extends Feature {\n\n /**\n * Creates an instance of Help\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'help');\n\n let f = this.config.help_instructions || {};\n\n /**\n * ID of main custom container element\n * @type {String}\n */\n this.tgtId = defaultsStr(f.target_id, null);\n\n /**\n * ID of custom container element for instructions\n * @type {String}\n */\n this.contTgtId = defaultsStr(f.container_target_id, null);\n\n /**\n * Instructions text (accepts HTML)\n * @type {String}\n */\n this.instrText = !isEmpty(f.text) ? f.text :\n 'Use the filters above each column to filter and limit table ' +\n 'data. Advanced searches can be performed by using the following ' +\n 'operators:
<, <=, >, ' +\n '>=, =, *, !, {, }, ' +\n '||,&&, [empty], [nonempty], ' +\n 'rgx:
' +\n 'Learn more
';\n\n /**\n * Instructions HTML\n * @type {String}\n */\n this.instrHtml = defaultsStr(f.html, null);\n\n /**\n * Help button text ('?')\n * @type {String}\n */\n this.btnText = defaultsStr(f.btn_text, '?');\n\n /**\n * Custom help button HTML\n * @type {String}\n */\n this.btnHtml = defaultsStr(f.btn_html, null);\n\n /**\n * Css class for help button\n * @type {String}\n */\n this.btnCssClass = defaultsStr(f.btn_css_class, 'helpBtn');\n\n /**\n * Css class for help container element\n * @type {String}\n */\n this.contCssClass = defaultsStr(f.container_css_class, 'helpCont');\n\n /**\n * Button DOM element\n * @type {DOMElement}\n */\n this.btn = null;\n\n /**\n * Help container DOM element\n * @type {DOMElement}\n */\n this.cont = null;\n\n /**\n * Bound mouseup wrapper\n * @private\n */\n this.boundMouseup = null;\n\n /**\n * Default HTML appended to instructions text\n * @type {String}\n */\n this.defaultHtml = '';\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, RIGHT);\n\n this.emitter.on(['init-help'], () => this.init());\n }\n\n /**\n * Mouse-up event handler handling popup auto-close behaviour\n * @private\n */\n onMouseup(evt) {\n let targetElm = targetEvt(evt);\n\n while (targetElm && targetElm !== this.cont && targetElm !== this.btn) {\n targetElm = targetElm.parentNode;\n }\n\n if (targetElm !== this.cont && targetElm !== this.btn) {\n this.toggle();\n }\n\n return;\n }\n\n /**\n * Initialise Help instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n this.emitter.emit('initializing-feature', this, !isNull(this.tgtId));\n\n let tf = this.tf;\n\n let btn = createElm('span');\n let cont = createElm('div');\n\n this.boundMouseup = this.onMouseup.bind(this);\n\n //help button is added to defined element\n let targetEl = !this.tgtId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.tgtId);\n targetEl.appendChild(btn);\n\n let divContainer = !this.contTgtId ? btn : elm(this.contTgtId);\n\n if (!this.btnHtml) {\n divContainer.appendChild(cont);\n let helplink = createElm('a', ['href', 'javascript:void(0);']);\n helplink.className = this.btnCssClass;\n helplink.appendChild(createText(this.btnText));\n btn.appendChild(helplink);\n addEvt(helplink, 'click', () => this.toggle());\n } else {\n btn.innerHTML = this.btnHtml;\n let helpEl = btn.firstChild;\n addEvt(helpEl, 'click', () => this.toggle());\n divContainer.appendChild(cont);\n }\n\n if (!this.instrHtml) {\n cont.innerHTML = this.instrText;\n cont.className = this.contCssClass;\n } else {\n if (this.contTgtId) {\n divContainer.appendChild(cont);\n }\n cont.innerHTML = this.instrHtml;\n if (!this.contTgtId) {\n cont.className = this.contCssClass;\n }\n }\n cont.innerHTML += this.defaultHtml;\n addEvt(cont, 'click', () => this.toggle());\n\n this.cont = cont;\n this.btn = btn;\n /** @inherited */\n this.initialized = true;\n\n this.emitter.emit('feature-initialized', this);\n }\n\n /**\n * Toggle help pop-up\n */\n toggle() {\n // check only if explicitily disabled as in this case undefined\n // signifies the help feature is enabled by default\n if (!this.isEnabled()) {\n return;\n }\n\n // ensure mouseup event handler is removed\n removeEvt(root, 'mouseup', this.boundMouseup);\n\n let divDisplay = this.cont.style.display;\n if (divDisplay === '' || divDisplay === NONE) {\n this.cont.style.display = 'inline';\n addEvt(root, 'mouseup', this.boundMouseup);\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 removeElm(this.btn);\n this.btn = null;\n\n removeElm(this.cont);\n this.cont = null;\n\n this.boundMouseup = null;\n this.initialized = false;\n }\n\n}\n",
@@ -9848,7 +9961,7 @@
"lineNumber": 1
},
{
- "__docId__": 513,
+ "__docId__": 514,
"kind": "variable",
"name": "WIKI_URL",
"memberof": "src/modules/help.js",
@@ -9869,7 +9982,7 @@
"ignore": true
},
{
- "__docId__": 514,
+ "__docId__": 515,
"kind": "variable",
"name": "WEBSITE_URL",
"memberof": "src/modules/help.js",
@@ -9890,7 +10003,7 @@
"ignore": true
},
{
- "__docId__": 515,
+ "__docId__": 516,
"kind": "class",
"name": "Help",
"memberof": "src/modules/help.js",
@@ -9908,7 +10021,7 @@
]
},
{
- "__docId__": 516,
+ "__docId__": 517,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/help.js~Help",
@@ -9933,7 +10046,7 @@
]
},
{
- "__docId__": 517,
+ "__docId__": 518,
"kind": "member",
"name": "tgtId",
"memberof": "src/modules/help.js~Help",
@@ -9952,7 +10065,7 @@
}
},
{
- "__docId__": 518,
+ "__docId__": 519,
"kind": "member",
"name": "contTgtId",
"memberof": "src/modules/help.js~Help",
@@ -9971,7 +10084,7 @@
}
},
{
- "__docId__": 519,
+ "__docId__": 520,
"kind": "member",
"name": "instrText",
"memberof": "src/modules/help.js~Help",
@@ -9990,7 +10103,7 @@
}
},
{
- "__docId__": 520,
+ "__docId__": 521,
"kind": "member",
"name": "instrHtml",
"memberof": "src/modules/help.js~Help",
@@ -10009,7 +10122,7 @@
}
},
{
- "__docId__": 521,
+ "__docId__": 522,
"kind": "member",
"name": "btnText",
"memberof": "src/modules/help.js~Help",
@@ -10028,7 +10141,7 @@
}
},
{
- "__docId__": 522,
+ "__docId__": 523,
"kind": "member",
"name": "btnHtml",
"memberof": "src/modules/help.js~Help",
@@ -10047,7 +10160,7 @@
}
},
{
- "__docId__": 523,
+ "__docId__": 524,
"kind": "member",
"name": "btnCssClass",
"memberof": "src/modules/help.js~Help",
@@ -10066,7 +10179,7 @@
}
},
{
- "__docId__": 524,
+ "__docId__": 525,
"kind": "member",
"name": "contCssClass",
"memberof": "src/modules/help.js~Help",
@@ -10085,7 +10198,7 @@
}
},
{
- "__docId__": 525,
+ "__docId__": 526,
"kind": "member",
"name": "btn",
"memberof": "src/modules/help.js~Help",
@@ -10104,7 +10217,7 @@
}
},
{
- "__docId__": 526,
+ "__docId__": 527,
"kind": "member",
"name": "cont",
"memberof": "src/modules/help.js~Help",
@@ -10123,7 +10236,7 @@
}
},
{
- "__docId__": 527,
+ "__docId__": 528,
"kind": "member",
"name": "boundMouseup",
"memberof": "src/modules/help.js~Help",
@@ -10132,6 +10245,7 @@
"access": "private",
"description": "Bound mouseup wrapper",
"lineNumber": 99,
+ "ignore": true,
"type": {
"types": [
"*"
@@ -10139,7 +10253,7 @@
}
},
{
- "__docId__": 528,
+ "__docId__": 529,
"kind": "member",
"name": "defaultHtml",
"memberof": "src/modules/help.js~Help",
@@ -10158,7 +10272,7 @@
}
},
{
- "__docId__": 529,
+ "__docId__": 530,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/modules/help.js~Help",
@@ -10177,7 +10291,7 @@
}
},
{
- "__docId__": 530,
+ "__docId__": 531,
"kind": "method",
"name": "onMouseup",
"memberof": "src/modules/help.js~Help",
@@ -10188,6 +10302,7 @@
"access": "private",
"description": "Mouse-up event handler handling popup auto-close behaviour",
"lineNumber": 125,
+ "ignore": true,
"params": [
{
"name": "evt",
@@ -10199,7 +10314,7 @@
"return": null
},
{
- "__docId__": 531,
+ "__docId__": 532,
"kind": "method",
"name": "init",
"memberof": "src/modules/help.js~Help",
@@ -10214,7 +10329,7 @@
"return": null
},
{
- "__docId__": 535,
+ "__docId__": 536,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/help.js~Help",
@@ -10236,7 +10351,7 @@
}
},
{
- "__docId__": 536,
+ "__docId__": 537,
"kind": "method",
"name": "toggle",
"memberof": "src/modules/help.js~Help",
@@ -10251,7 +10366,7 @@
"return": null
},
{
- "__docId__": 537,
+ "__docId__": 538,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/help.js~Help",
@@ -10266,7 +10381,7 @@
"return": null
},
{
- "__docId__": 542,
+ "__docId__": 543,
"kind": "file",
"name": "src/modules/highlightKeywords.js",
"content": "import {createText, createElm, getText} from '../dom';\nimport {isArray} from '../types';\nimport {rgxEsc} from '../string';\nimport {defaultsStr} from '../settings';\n\n/**\n * Highlight matched keywords upon filtering\n *\n * @export\n * @class HighlightKeyword\n */\nexport class HighlightKeyword {\n\n /**\n * Creates an instance of HighlightKeyword\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n let f = tf.config();\n\n /**\n * Css class for highlighted term\n * @type {String}\n */\n this.highlightCssClass = defaultsStr(f.highlight_css_class, 'keyword');\n\n /**\n * TableFilter instance\n * @type {TableFilter}\n */\n this.tf = tf;\n\n /**\n * TableFilter's emitter instance\n * @type {Emitter}\n */\n this.emitter = tf.emitter;\n }\n\n /**\n * Initializes HighlightKeyword instance\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, term) => this._processTerm(cell, term)\n );\n }\n\n /**\n * Highlight occurences of searched term in passed node\n * @param {Node} node\n * @param {String} term Searched term\n * @param {String} cssClass Css class name\n *\n * TODO: refactor this method\n */\n highlight(node, term, cssClass) {\n // Iterate into this nodes childNodes\n if (node.hasChildNodes) {\n let children = node.childNodes;\n for (let i = 0; i < children.length; i++) {\n this.highlight(children[i], term, cssClass);\n }\n }\n\n if (node.nodeType === 3) {\n let nodeVal = node.nodeValue.toLowerCase();\n let termIdx = nodeVal.indexOf(term.toLowerCase());\n\n if (termIdx !== -1) {\n let pn = node.parentNode;\n if (pn && pn.className !== cssClass) {\n // term not highlighted yet\n let nv = node.nodeValue,\n // Create a load of replacement nodes\n before = createText(nv.substr(0, termIdx)),\n value = nv.substr(termIdx, term.length),\n after = createText(nv.substr(termIdx + term.length)),\n text = createText(value),\n container = createElm('span');\n container.className = cssClass;\n container.appendChild(text);\n pn.insertBefore(before, node);\n pn.insertBefore(container, node);\n pn.insertBefore(after, node);\n pn.removeChild(node);\n }\n }\n }\n }\n\n /**\n * Removes highlight to nodes matching passed string\n * @param {String} term\n * @param {String} cssClass Css class to remove\n */\n unhighlight(term, cssClass) {\n let highlightedNodes = this.tf.dom().querySelectorAll(`.${cssClass}`);\n for (let i = 0; i < highlightedNodes.length; i++) {\n let n = highlightedNodes[i];\n let nodeVal = getText(n);\n\n if (nodeVal.toLowerCase().indexOf(term.toLowerCase()) !== -1) {\n let parentNode = n.parentNode;\n parentNode.replaceChild(createText(nodeVal), n);\n parentNode.normalize();\n }\n }\n }\n\n /**\n * Clear all occurrences of highlighted nodes\n */\n unhighlightAll() {\n if (!this.tf.highlightKeywords) {\n return;\n }\n // iterate filters values to unhighlight all values\n this.tf.getFiltersValue().forEach((val) => {\n if (isArray(val)) {\n val.forEach((item) =>\n this.unhighlight(item, this.highlightCssClass));\n } else {\n this.unhighlight(val, this.highlightCssClass);\n }\n });\n }\n\n /** Remove feature */\n destroy() {\n this.emitter.off(\n ['before-filtering', 'destroy'],\n () => this.unhighlightAll()\n );\n this.emitter.off(\n ['highlight-keyword'],\n (tf, cell, term) => this._processTerm(cell, term)\n );\n }\n\n /**\n * Ensure filtering operators are handled before highlighting any match\n * @param {any} Table cell to look searched term into\n * @param {any} Searched termIdx\n */\n _processTerm(cell, term) {\n let tf = this.tf;\n let reLk = new RegExp(rgxEsc(tf.lkOperator));\n let reEq = new RegExp(tf.eqOperator);\n let reSt = new RegExp(tf.stOperator);\n let reEn = new RegExp(tf.enOperator);\n let reLe = new RegExp(tf.leOperator);\n let reGe = new RegExp(tf.geOperator);\n let reL = new RegExp(tf.lwOperator);\n let reG = new RegExp(tf.grOperator);\n let reD = new RegExp(tf.dfOperator);\n\n term = term\n .replace(reLk, '')\n .replace(reEq, '')\n .replace(reSt, '')\n .replace(reEn, '');\n\n if (reLe.test(term) || reGe.test(term) || reL.test(term) ||\n reG.test(term) || reD.test(term)) {\n term = getText(cell);\n }\n\n if (term === '') {\n return;\n }\n\n this.highlight(cell, term, this.highlightCssClass);\n }\n}\n",
@@ -10277,7 +10392,7 @@
"lineNumber": 1
},
{
- "__docId__": 543,
+ "__docId__": 544,
"kind": "class",
"name": "HighlightKeyword",
"memberof": "src/modules/highlightKeywords.js",
@@ -10298,7 +10413,7 @@
"interface": false
},
{
- "__docId__": 544,
+ "__docId__": 545,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10323,7 +10438,7 @@
]
},
{
- "__docId__": 545,
+ "__docId__": 546,
"kind": "member",
"name": "highlightCssClass",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10342,7 +10457,7 @@
}
},
{
- "__docId__": 546,
+ "__docId__": 547,
"kind": "member",
"name": "tf",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10361,7 +10476,7 @@
}
},
{
- "__docId__": 547,
+ "__docId__": 548,
"kind": "member",
"name": "emitter",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10380,7 +10495,7 @@
}
},
{
- "__docId__": 548,
+ "__docId__": 549,
"kind": "method",
"name": "init",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10395,7 +10510,7 @@
"return": null
},
{
- "__docId__": 549,
+ "__docId__": 550,
"kind": "method",
"name": "highlight",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10441,7 +10556,7 @@
"return": null
},
{
- "__docId__": 550,
+ "__docId__": 551,
"kind": "method",
"name": "unhighlight",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10477,7 +10592,7 @@
"return": null
},
{
- "__docId__": 551,
+ "__docId__": 552,
"kind": "method",
"name": "unhighlightAll",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10492,7 +10607,7 @@
"return": null
},
{
- "__docId__": 552,
+ "__docId__": 553,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10507,7 +10622,7 @@
"return": null
},
{
- "__docId__": 553,
+ "__docId__": 554,
"kind": "method",
"name": "_processTerm",
"memberof": "src/modules/highlightKeywords.js~HighlightKeyword",
@@ -10540,10 +10655,11 @@
"description": "termIdx"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 554,
+ "__docId__": 555,
"kind": "file",
"name": "src/modules/loader.js",
"content": "import {Feature} from '../feature';\nimport {createElm, createText, elm, removeElm} from '../dom';\nimport {EMPTY_FN} from '../types';\nimport {root} from '../root';\nimport {NONE} from '../const';\nimport {defaultsStr, defaultsFn} from '../settings';\n\nconst EVENTS = [\n 'before-filtering',\n 'before-populating-filter',\n 'before-page-change',\n 'before-clearing-filters',\n 'before-page-length-change',\n 'before-reset-page',\n 'before-reset-page-length',\n 'before-loading-extensions',\n 'before-loading-themes'\n];\n\n/**\n * Activity indicator\n *\n * @export\n * @class Loader\n * @extends {Feature}\n */\nexport class Loader extends Feature {\n\n /**\n * Creates an instance of Loader.\n *\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'loader');\n\n let f = this.config.loader || {};\n\n /**\n * ID of custom container element\n * @type {String}\n */\n this.targetId = defaultsStr(f.target_id, null);\n\n /**\n * Loader container DOM element\n * @type {DOMElement}\n */\n this.cont = null;\n\n /**\n * Text displayed when indicator is visible\n * @type {String}\n */\n this.text = defaultsStr(f.text, 'Loading...');\n\n /**\n * Custom HTML injected in Loader's container element\n * @type {String}\n */\n this.html = defaultsStr(f.html, null);\n\n /**\n * Css class for Loader's container element\n * @type {String}\n */\n this.cssClass = defaultsStr(f.css_class, 'loader');\n\n /**\n * Close delay in milliseconds\n * @type {Number}\n */\n this.closeDelay = 250;\n\n /**\n * Callback fired when loader is displayed\n * @type {Function}\n */\n this.onShow = defaultsFn(f.on_show_loader, EMPTY_FN);\n\n /**\n * Callback fired when loader is closed\n * @type {Function}\n */\n this.onHide = defaultsFn(f.on_hide_loader, EMPTY_FN);\n }\n\n /**\n * Initializes Loader instance\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 = createElm('div');\n containerDiv.className = this.cssClass;\n\n let targetEl = !this.targetId ?\n tf.dom().parentNode : elm(this.targetId);\n if (!this.targetId) {\n targetEl.insertBefore(containerDiv, tf.dom());\n } else {\n targetEl.appendChild(containerDiv);\n }\n this.cont = containerDiv;\n if (!this.html) {\n this.cont.appendChild(createText(this.text));\n } else {\n this.cont.innerHTML = this.html;\n }\n\n this.show(NONE);\n\n // Subscribe to events\n emitter.on(EVENTS, () => this.show(''));\n emitter.on(EVENTS, () => this.show(NONE));\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Shows or hides activity indicator\n * @param {String} Two possible values: '' or 'none'\n */\n show(p) {\n if (!this.isEnabled()) {\n return;\n }\n\n let displayLoader = () => {\n if (!this.cont) {\n return;\n }\n if (p !== NONE) {\n this.onShow(this);\n }\n this.cont.style.display = p;\n if (p === NONE) {\n this.onHide(this);\n }\n };\n\n let t = p === NONE ? this.closeDelay : 1;\n root.setTimeout(displayLoader, t);\n }\n\n /**\n * Removes feature\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n let emitter = this.emitter;\n\n removeElm(this.cont);\n this.cont = null;\n\n // Unsubscribe to events\n emitter.off(EVENTS, () => this.show(''));\n emitter.off(EVENTS, () => this.show(NONE));\n\n this.initialized = false;\n }\n}\n",
@@ -10554,7 +10670,7 @@
"lineNumber": 1
},
{
- "__docId__": 555,
+ "__docId__": 556,
"kind": "variable",
"name": "EVENTS",
"memberof": "src/modules/loader.js",
@@ -10575,7 +10691,7 @@
"ignore": true
},
{
- "__docId__": 556,
+ "__docId__": 557,
"kind": "class",
"name": "Loader",
"memberof": "src/modules/loader.js",
@@ -10599,7 +10715,7 @@
]
},
{
- "__docId__": 557,
+ "__docId__": 558,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/loader.js~Loader",
@@ -10624,7 +10740,7 @@
]
},
{
- "__docId__": 558,
+ "__docId__": 559,
"kind": "member",
"name": "targetId",
"memberof": "src/modules/loader.js~Loader",
@@ -10643,7 +10759,7 @@
}
},
{
- "__docId__": 559,
+ "__docId__": 560,
"kind": "member",
"name": "cont",
"memberof": "src/modules/loader.js~Loader",
@@ -10662,7 +10778,7 @@
}
},
{
- "__docId__": 560,
+ "__docId__": 561,
"kind": "member",
"name": "text",
"memberof": "src/modules/loader.js~Loader",
@@ -10681,7 +10797,7 @@
}
},
{
- "__docId__": 561,
+ "__docId__": 562,
"kind": "member",
"name": "html",
"memberof": "src/modules/loader.js~Loader",
@@ -10700,7 +10816,7 @@
}
},
{
- "__docId__": 562,
+ "__docId__": 563,
"kind": "member",
"name": "cssClass",
"memberof": "src/modules/loader.js~Loader",
@@ -10719,7 +10835,7 @@
}
},
{
- "__docId__": 563,
+ "__docId__": 564,
"kind": "member",
"name": "closeDelay",
"memberof": "src/modules/loader.js~Loader",
@@ -10738,7 +10854,7 @@
}
},
{
- "__docId__": 564,
+ "__docId__": 565,
"kind": "member",
"name": "onShow",
"memberof": "src/modules/loader.js~Loader",
@@ -10757,7 +10873,7 @@
}
},
{
- "__docId__": 565,
+ "__docId__": 566,
"kind": "member",
"name": "onHide",
"memberof": "src/modules/loader.js~Loader",
@@ -10776,7 +10892,7 @@
}
},
{
- "__docId__": 566,
+ "__docId__": 567,
"kind": "method",
"name": "init",
"memberof": "src/modules/loader.js~Loader",
@@ -10791,7 +10907,7 @@
"return": null
},
{
- "__docId__": 568,
+ "__docId__": 569,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/loader.js~Loader",
@@ -10813,7 +10929,7 @@
}
},
{
- "__docId__": 569,
+ "__docId__": 570,
"kind": "method",
"name": "show",
"memberof": "src/modules/loader.js~Loader",
@@ -10839,7 +10955,7 @@
"return": null
},
{
- "__docId__": 570,
+ "__docId__": 571,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/loader.js~Loader",
@@ -10854,7 +10970,7 @@
"return": null
},
{
- "__docId__": 573,
+ "__docId__": 574,
"kind": "file",
"name": "src/modules/markActiveColumns.js",
"content": "import {Feature} from '../feature';\nimport {addClass, removeClass, hasClass} from '../dom';\nimport {EMPTY_FN} from '../types';\nimport {defaultsStr, defaultsFn} from '../settings';\n\n/**\n * Visual indicator for filtered columns\n * @export\n * @class MarkActiveColumns\n * @extends {Feature}\n */\nexport class MarkActiveColumns extends Feature {\n\n /**\n * Create an instance of MarkActiveColumns\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'markActiveColumns');\n\n let config = this.config.mark_active_columns || {};\n\n /**\n * Css class for filtered (active) columns\n * @type {String}\n */\n this.headerCssClass = defaultsStr(config.header_css_class,\n 'activeHeader');\n\n /**\n * Css class for filtered (active) column cells\n * @type {String}\n */\n this.cellCssClass = defaultsStr(config.cell_css_class,\n 'activeCell');\n\n /**\n * Enable/disable column highlighting\n * @type {Boolean}\n */\n this.highlightColumn = Boolean(config.highlight_column);\n\n /**\n * Callback fired before a column is marked as filtered\n * @type {Function}\n */\n this.onBeforeActiveColumn = defaultsFn(config.on_before_active_column,\n EMPTY_FN);\n\n /**\n * Callback fired after a column is marked as filtered\n * @type {Function}\n */\n this.onAfterActiveColumn = defaultsFn(config.on_after_active_column,\n EMPTY_FN);\n }\n\n /**\n * Initialise MarkActiveColumns instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n this.emitter.on(['before-filtering'], () => this.clearActiveColumns());\n this.emitter.on(\n ['cell-processed'],\n (tf, colIndex) => this.markActiveColumn(colIndex)\n );\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Clear filtered columns visual indicator (background color)\n */\n clearActiveColumns() {\n let tf = this.tf;\n tf.eachCol((idx) => {\n removeClass(tf.getHeaderElement(idx), this.headerCssClass);\n\n if (this.highlightColumn) {\n this.eachColumnCell(idx,\n (cell) => removeClass(cell, this.cellCssClass));\n }\n });\n }\n\n /**\n * Mark currently filtered column\n * @param {Number} colIndex Column index\n */\n markActiveColumn(colIndex) {\n let tf = this.tf;\n let header = tf.getHeaderElement(colIndex);\n if (hasClass(header, this.headerCssClass)) {\n return;\n }\n\n this.onBeforeActiveColumn(this, colIndex);\n\n addClass(header, this.headerCssClass);\n\n if (this.highlightColumn) {\n this.eachColumnCell(colIndex,\n (cell) => addClass(cell, this.cellCssClass));\n }\n\n this.onAfterActiveColumn(this, colIndex);\n }\n\n /**\n * Column cells iterator\n * TODO: make public and move into TableFilter if used elsewhere\n * @param {Number} colIndex\n * @param {Function} fn\n * @param {DOMElement} tbl\n * @private\n */\n eachColumnCell(colIndex, fn = EMPTY_FN, tbl = this.tf.dom()) {\n // TODO: remove [].forEach when polyfill for PhanthomJs is available\n [].forEach.call(\n tbl.querySelectorAll(`tbody td:nth-child(${colIndex + 1})`), fn);\n }\n\n /**\n * Remove feature\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n this.clearActiveColumns();\n this.emitter.off(['before-filtering'], () => this.clearActiveColumns());\n this.emitter.off(\n ['cell-processed'],\n (tf, colIndex) => this.markActiveColumn(colIndex)\n );\n\n /** @inherited */\n this.initialized = false;\n }\n}\n",
@@ -10865,7 +10981,7 @@
"lineNumber": 1
},
{
- "__docId__": 574,
+ "__docId__": 575,
"kind": "class",
"name": "MarkActiveColumns",
"memberof": "src/modules/markActiveColumns.js",
@@ -10889,7 +11005,7 @@
]
},
{
- "__docId__": 575,
+ "__docId__": 576,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -10914,7 +11030,7 @@
]
},
{
- "__docId__": 576,
+ "__docId__": 577,
"kind": "member",
"name": "headerCssClass",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -10933,7 +11049,7 @@
}
},
{
- "__docId__": 577,
+ "__docId__": 578,
"kind": "member",
"name": "cellCssClass",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -10952,7 +11068,7 @@
}
},
{
- "__docId__": 578,
+ "__docId__": 579,
"kind": "member",
"name": "highlightColumn",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -10971,7 +11087,7 @@
}
},
{
- "__docId__": 579,
+ "__docId__": 580,
"kind": "member",
"name": "onBeforeActiveColumn",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -10990,7 +11106,7 @@
}
},
{
- "__docId__": 580,
+ "__docId__": 581,
"kind": "member",
"name": "onAfterActiveColumn",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -11009,7 +11125,7 @@
}
},
{
- "__docId__": 581,
+ "__docId__": 582,
"kind": "method",
"name": "init",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -11024,7 +11140,7 @@
"return": null
},
{
- "__docId__": 582,
+ "__docId__": 583,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -11046,7 +11162,7 @@
}
},
{
- "__docId__": 583,
+ "__docId__": 584,
"kind": "method",
"name": "clearActiveColumns",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -11061,7 +11177,7 @@
"return": null
},
{
- "__docId__": 584,
+ "__docId__": 585,
"kind": "method",
"name": "markActiveColumn",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -11087,7 +11203,7 @@
"return": null
},
{
- "__docId__": 585,
+ "__docId__": 586,
"kind": "method",
"name": "eachColumnCell",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -11130,10 +11246,11 @@
"description": ""
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 586,
+ "__docId__": 587,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/markActiveColumns.js~MarkActiveColumns",
@@ -11148,7 +11265,7 @@
"return": null
},
{
- "__docId__": 588,
+ "__docId__": 589,
"kind": "file",
"name": "src/modules/noResults.js",
"content": "import {Feature} from '../feature';\nimport {createElm, elm, removeElm} from '../dom';\nimport {isEmpty, EMPTY_FN} from '../types';\nimport {NONE} from '../const';\nimport {defaultsStr, defaultsFn} from '../settings';\n\n/**\n * UI when filtering yields no matches\n * @export\n * @class NoResults\n * @extends {Feature}\n */\nexport class NoResults extends Feature {\n\n /**\n * Creates an instance of NoResults\n * @param {TableFilter} 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 /**\n * Text (accepts HTML)\n * @type {String}\n */\n this.content = defaultsStr(f.content, 'No results');\n\n /**\n * Custom container DOM element\n * @type {DOMElement}\n */\n this.customContainer = defaultsStr(f.custom_container, null);\n\n /**\n * ID of custom container element\n * @type {String}\n */\n this.customContainerId = defaultsStr(f.custom_container_id, null);\n\n /**\n * Indicates if UI is contained in a external element\n * @type {Boolean}\n * @private\n */\n this.isExternal = !isEmpty(this.customContainer) ||\n !isEmpty(this.customContainerId);\n\n /**\n * Css class assigned to container element\n * @type {String}\n */\n this.cssClass = defaultsStr(f.css_class, 'no-results');\n\n /**\n * Stores container DOM element\n * @type {DOMElement}\n */\n this.cont = null;\n\n /**\n * Callback fired before the message is displayed\n * @type {Function}\n */\n this.onBeforeShow = defaultsFn(f.on_before_show_msg, EMPTY_FN);\n\n /**\n * Callback fired after the message is displayed\n * @type {Function}\n */\n this.onAfterShow = defaultsFn(f.on_after_show_msg, EMPTY_FN);\n\n /**\n * Callback fired before the message is hidden\n * @type {Function}\n */\n this.onBeforeHide = defaultsFn(f.on_before_hide_msg, EMPTY_FN);\n\n /**\n * Callback fired after the message is hidden\n * @type {Function}\n */\n this.onAfterHide = defaultsFn(f.on_after_hide_msg, EMPTY_FN);\n }\n\n /**\n * Initializes NoResults instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n let tf = this.tf;\n let target = this.customContainer || elm(this.customContainerId) ||\n tf.dom();\n\n //container\n let cont = createElm('div');\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 /** @inherited */\n this.initialized = true;\n\n this.hide();\n }\n\n /**\n * Toggle no results message\n */\n toggle() {\n if (this.tf.getValidRowsNb() > 0) {\n this.hide();\n } else {\n this.show();\n }\n }\n\n /**\n * Show no results message\n */\n show() {\n if (!this.initialized || !this.isEnabled()) {\n return;\n }\n this.onBeforeShow(this.tf, this);\n\n this.setWidth();\n this.cont.style.display = 'block';\n\n this.onAfterShow(this.tf, this);\n }\n\n /**\n * Hide no results message\n */\n hide() {\n if (!this.initialized || !this.isEnabled()) {\n return;\n }\n this.onBeforeHide(this.tf, this);\n\n this.cont.style.display = NONE;\n\n this.onAfterHide(this.tf, this);\n }\n\n /**\n * Sets no results container width\n * @private\n */\n setWidth() {\n if (!this.initialized || this.isExternal || !this.isEnabled()) {\n return;\n }\n let tf = this.tf;\n if (tf.gridLayout) {\n let gridLayout = tf.feature('gridLayout');\n this.cont.style.width = gridLayout.headTbl.clientWidth + 'px';\n } else {\n this.cont.style.width = (tf.dom().tHead ?\n tf.dom().tHead.clientWidth :\n tf.dom().tBodies[0].clientWidth) + 'px';\n }\n }\n\n /**\n * Remove feature\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n removeElm(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",
@@ -11159,7 +11276,7 @@
"lineNumber": 1
},
{
- "__docId__": 589,
+ "__docId__": 590,
"kind": "class",
"name": "NoResults",
"memberof": "src/modules/noResults.js",
@@ -11183,7 +11300,7 @@
]
},
{
- "__docId__": 590,
+ "__docId__": 591,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11208,7 +11325,7 @@
]
},
{
- "__docId__": 591,
+ "__docId__": 592,
"kind": "member",
"name": "content",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11227,7 +11344,7 @@
}
},
{
- "__docId__": 592,
+ "__docId__": 593,
"kind": "member",
"name": "customContainer",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11246,7 +11363,7 @@
}
},
{
- "__docId__": 593,
+ "__docId__": 594,
"kind": "member",
"name": "customContainerId",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11265,7 +11382,7 @@
}
},
{
- "__docId__": 594,
+ "__docId__": 595,
"kind": "member",
"name": "isExternal",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11281,10 +11398,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 595,
+ "__docId__": 596,
"kind": "member",
"name": "cssClass",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11303,7 +11421,7 @@
}
},
{
- "__docId__": 596,
+ "__docId__": 597,
"kind": "member",
"name": "cont",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11322,7 +11440,7 @@
}
},
{
- "__docId__": 597,
+ "__docId__": 598,
"kind": "member",
"name": "onBeforeShow",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11341,7 +11459,7 @@
}
},
{
- "__docId__": 598,
+ "__docId__": 599,
"kind": "member",
"name": "onAfterShow",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11360,7 +11478,7 @@
}
},
{
- "__docId__": 599,
+ "__docId__": 600,
"kind": "member",
"name": "onBeforeHide",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11379,7 +11497,7 @@
}
},
{
- "__docId__": 600,
+ "__docId__": 601,
"kind": "member",
"name": "onAfterHide",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11398,7 +11516,7 @@
}
},
{
- "__docId__": 601,
+ "__docId__": 602,
"kind": "method",
"name": "init",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11413,7 +11531,7 @@
"return": null
},
{
- "__docId__": 603,
+ "__docId__": 604,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11435,7 +11553,7 @@
}
},
{
- "__docId__": 604,
+ "__docId__": 605,
"kind": "method",
"name": "toggle",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11450,7 +11568,7 @@
"return": null
},
{
- "__docId__": 605,
+ "__docId__": 606,
"kind": "method",
"name": "show",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11465,7 +11583,7 @@
"return": null
},
{
- "__docId__": 606,
+ "__docId__": 607,
"kind": "method",
"name": "hide",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11480,7 +11598,7 @@
"return": null
},
{
- "__docId__": 607,
+ "__docId__": 608,
"kind": "method",
"name": "setWidth",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11491,11 +11609,12 @@
"access": "private",
"description": "Sets no results container width",
"lineNumber": 165,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 608,
+ "__docId__": 609,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/noResults.js~NoResults",
@@ -11510,10 +11629,10 @@
"return": null
},
{
- "__docId__": 611,
+ "__docId__": 612,
"kind": "file",
"name": "src/modules/paging.js",
- "content": "import {Feature} from '../feature';\nimport {createElm, createOpt, createText, elm, removeElm} from '../dom';\nimport {isArray, isNull, EMPTY_FN} from '../types';\nimport {addEvt, keyCode, removeEvt} from '../event';\nimport {INPUT, SELECT, NONE, ENTER_KEY} from '../const';\nimport {\n defaultsStr, defaultsNb, defaultsBool, defaultsArr, defaultsFn\n} from '../settings';\nimport {CENTER, RIGHT} from './toolbar';\n\n/**\n * Paging UI component\n * @export\n * @class Paging\n * @extends {Feature}\n */\nexport class Paging extends Feature {\n\n /**\n * Creates an instance of Paging\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'paging');\n\n // Configuration object\n let f = this.config.paging || {};\n\n /**\n * Css class for the paging buttons (previous, next, etc.)\n * @type {String}\n */\n this.btnCssClass = defaultsStr(f.btn_css_class, 'pgInp');\n\n /**\n * Main select DOM element\n * @type {DOMElement}\n */\n this.pageSlc = null;\n\n /**\n * Results per page select DOM element\n * @type {DOMElement}\n */\n this.pageLengthSlc = null;\n\n /**\n * ID of custom container element\n * @type {String}\n */\n this.tgtId = defaultsStr(f.target_id, null);\n\n /**\n * Number of rows contained in a page\n * @type {Number}\n */\n this.pageLength = defaultsNb(f.length, 10);\n\n /**\n * ID of custom container element for the results per page selector\n * @type {String}\n */\n this.pageLengthTgtId = defaultsStr(f.results_per_page_target_id, null);\n\n /**\n * Css class for the paging select element\n * @type {String}\n */\n this.pgSlcCssClass = defaultsStr(f.slc_css_class, 'pgSlc');\n\n /**\n * Css class for the paging input element\n * @type {String}\n */\n this.pgInpCssClass = defaultsStr(f.inp_css_class, 'pgNbInp');\n\n /**\n * Label and values for the results per page select, example of usage:\n * ['Records: ', [10,25,50,100]]\n * @type {Array}\n */\n this.resultsPerPage = defaultsArr(f.results_per_page, null);\n\n /**\n * Determines if results per page is configured\n * @type {Boolean}\n */\n this.hasResultsPerPage = isArray(this.resultsPerPage);\n\n /**\n * Css class for the results per page select\n * @type {String}\n */\n this.resultsSlcCssClass = defaultsStr(f.results_slc_css_class, 'rspg');\n\n /**\n * Css class for the label preceding results per page select\n * @type {String}\n */\n this.resultsSpanCssClass = defaultsStr(f.results_span_css_class,\n 'rspgSpan');\n\n /**\n * Index of the first row of current page\n * @type {Number}\n * @private\n */\n this.startPagingRow = 0;\n\n /**\n * Total number of pages\n * @type {Number}\n * @private\n */\n this.nbPages = 0;\n\n /**\n * Current page number\n * @type {Number}\n * @private\n */\n this.currentPageNb = 1;\n\n /**\n * Next page button text\n * @type {String}\n */\n this.btnNextPageText = defaultsStr(f.btn_next_page_text, '>');\n\n /**\n * Previous page button text\n * @type {String}\n */\n this.btnPrevPageText = defaultsStr(f.btn_prev_page_text, '<');\n\n /**\n * Last page button text\n * @type {String}\n */\n this.btnLastPageText = defaultsStr(f.btn_last_page_text, '>|');\n\n /**\n * First page button text\n * @type {String}\n */\n this.btnFirstPageText = defaultsStr(f.btn_first_page_text, '|<');\n\n /**\n * Next page button HTML\n * @type {String}\n */\n this.btnNextPageHtml = defaultsStr(f.btn_next_page_html,\n (!tf.enableIcons ? null :\n ''));\n\n /**\n * Previous page button HTML\n * @type {String}\n */\n this.btnPrevPageHtml = defaultsStr(f.btn_prev_page_html,\n (!tf.enableIcons ? null :\n ''));\n\n /**\n * First page button HTML\n * @type {String}\n */\n this.btnFirstPageHtml = defaultsStr(f.btn_first_page_html,\n (!tf.enableIcons ? null :\n ''));\n\n /**\n * Last page button HTML\n * @type {String}\n */\n this.btnLastPageHtml = defaultsStr(f.btn_last_page_html,\n (!tf.enableIcons ? null :\n ''));\n\n /**\n * Text preceeding page selector drop-down\n * @type {String}\n */\n this.pageText = defaultsStr(f.page_text, ' Page ');\n\n /**\n * Text after page selector drop-down\n * @type {String}\n */\n this.ofText = defaultsStr(f.of_text, ' of ');\n\n /**\n * Css class for the span containing total number of pages\n * @type {String}\n */\n this.nbPgSpanCssClass = defaultsStr(f.nb_pages_css_class, 'nbpg');\n\n /**\n * Determines if paging buttons are enabled (default: true)\n * @type {Boolean}\n */\n this.hasBtns = defaultsBool(f.btns, true);\n\n /**\n * Defines page selector type, two possible values: 'select', 'input'\n * @type {String}\n */\n this.pageSelectorType = defaultsStr(f.page_selector_type, SELECT);\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, CENTER);\n\n /**\n * Callback fired before the page is changed\n * @type {Function}\n */\n this.onBeforeChangePage = defaultsFn(f.on_before_change_page, EMPTY_FN);\n\n /**\n * Callback fired after the page is changed\n * @type {Function}\n */\n this.onAfterChangePage = defaultsFn(f.on_after_change_page, EMPTY_FN);\n\n /**\n * Label preciding results per page select\n * @type {DOMElement}\n * @private\n */\n this.slcResultsTxt = null;\n /**\n * Span containing next page button\n * @type {DOMElement}\n * @private\n */\n this.btnNextCont = null;\n /**\n * Span containing previous page button\n * @type {DOMElement}\n * @private\n */\n this.btnPrevCont = null;\n /**\n * Span containing last page button\n * @type {DOMElement}\n * @private\n */\n this.btnLastCont = null;\n /**\n * Span containing first page button\n * @type {DOMElement}\n * @private\n */\n this.btnFirstCont = null;\n /**\n * Span for tot nb pages\n * @type {DOMElement}\n * @private\n */\n this.pgCont = null;\n /**\n * Span preceding pages select (contains 'Page')\n * @type {DOMElement}\n * @private\n */\n this.pgBefore = null;\n /**\n * Span following pages select (contains ' of ')\n * @type {DOMElement}\n * @private\n */\n this.pgAfter = null;\n\n let startRow = tf.refRow;\n let nrows = tf.getRowsNb(true);\n //calculates page nb\n this.nbPages = Math.ceil((nrows - startRow) / this.pageLength);\n\n let o = this;\n /**\n * Paging DOM events handlers\n * @type {String}\n * @private\n */\n this.evt = {\n slcIndex() {\n return (o.pageSelectorType === SELECT) ?\n o.pageSlc.options.selectedIndex :\n parseInt(o.pageSlc.value, 10) - 1;\n },\n nbOpts() {\n return (o.pageSelectorType === SELECT) ?\n parseInt(o.pageSlc.options.length, 10) - 1 :\n (o.nbPages - 1);\n },\n next() {\n let nextIndex = o.evt.slcIndex() < o.evt.nbOpts() ?\n o.evt.slcIndex() + 1 : 0;\n o.changePage(nextIndex);\n },\n prev() {\n let 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 let key = keyCode(e);\n if (key === ENTER_KEY) {\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 let slcPages;\n let tf = this.tf;\n let evt = this.evt;\n\n if (this.initialized) {\n return;\n }\n\n this.emitter.emit('initializing-feature', this, !isNull(this.tgtId));\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.pageLength = this.resultsPerPage[1][0];\n this.setResultsPerPage();\n }\n }\n\n evt.slcPagesChange = (event) => {\n let slc = event.target;\n this.changePage(slc.selectedIndex);\n };\n\n // Paging drop-down list selector\n if (this.pageSelectorType === SELECT) {\n slcPages = createElm(SELECT);\n slcPages.className = this.pgSlcCssClass;\n addEvt(slcPages, 'change', evt.slcPagesChange);\n }\n\n // Paging input selector\n if (this.pageSelectorType === INPUT) {\n slcPages = createElm(INPUT, ['value', this.currentPageNb]);\n slcPages.className = this.pgInpCssClass;\n addEvt(slcPages, 'keypress', evt._detectKey);\n }\n\n // btns containers\n let btnNextSpan = createElm('span');\n let btnPrevSpan = createElm('span');\n let btnLastSpan = createElm('span');\n let btnFirstSpan = createElm('span');\n\n if (this.hasBtns) {\n // Next button\n if (!this.btnNextPageHtml) {\n let btnNext = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnNextPageText],\n ['title', 'Next']\n );\n btnNext.className = this.btnCssClass;\n addEvt(btnNext, 'click', evt.next);\n btnNextSpan.appendChild(btnNext);\n } else {\n btnNextSpan.innerHTML = this.btnNextPageHtml;\n addEvt(btnNextSpan, 'click', evt.next);\n }\n // Previous button\n if (!this.btnPrevPageHtml) {\n let btnPrev = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnPrevPageText],\n ['title', 'Previous']\n );\n btnPrev.className = this.btnCssClass;\n addEvt(btnPrev, 'click', evt.prev);\n btnPrevSpan.appendChild(btnPrev);\n } else {\n btnPrevSpan.innerHTML = this.btnPrevPageHtml;\n addEvt(btnPrevSpan, 'click', evt.prev);\n }\n // Last button\n if (!this.btnLastPageHtml) {\n let btnLast = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnLastPageText],\n ['title', 'Last']\n );\n btnLast.className = this.btnCssClass;\n addEvt(btnLast, 'click', evt.last);\n btnLastSpan.appendChild(btnLast);\n } else {\n btnLastSpan.innerHTML = this.btnLastPageHtml;\n addEvt(btnLastSpan, 'click', evt.last);\n }\n // First button\n if (!this.btnFirstPageHtml) {\n let btnFirst = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnFirstPageText],\n ['title', 'First']\n );\n btnFirst.className = this.btnCssClass;\n addEvt(btnFirst, 'click', evt.first);\n btnFirstSpan.appendChild(btnFirst);\n } else {\n btnFirstSpan.innerHTML = this.btnFirstPageHtml;\n addEvt(btnFirstSpan, 'click', evt.first);\n }\n }\n\n // paging elements (buttons+drop-down list) are added to defined element\n let targetEl = !this.tgtId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.tgtId);\n targetEl.appendChild(btnFirstSpan);\n targetEl.appendChild(btnPrevSpan);\n\n let pgBeforeSpan = createElm('span');\n pgBeforeSpan.appendChild(createText(this.pageText));\n pgBeforeSpan.className = this.nbPgSpanCssClass;\n targetEl.appendChild(pgBeforeSpan);\n targetEl.appendChild(slcPages);\n let pgAfterSpan = createElm('span');\n pgAfterSpan.appendChild(createText(this.ofText));\n pgAfterSpan.className = this.nbPgSpanCssClass;\n targetEl.appendChild(pgAfterSpan);\n let pgSpan = createElm('span');\n pgSpan.className = this.nbPgSpanCssClass;\n pgSpan.appendChild(createText(' ' + this.nbPages + ' '));\n targetEl.appendChild(pgSpan);\n targetEl.appendChild(btnNextSpan);\n targetEl.appendChild(btnLastSpan);\n\n this.btnNextCont = btnNextSpan;\n this.btnPrevCont = btnPrevSpan;\n this.btnLastCont = btnLastSpan;\n this.btnFirstCont = btnFirstSpan;\n this.pgCont = pgSpan;\n this.pgBefore = pgBeforeSpan;\n this.pgAfter = pgAfterSpan;\n this.pageSlc = slcPages;\n\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(['change-page'],\n (tf, pageNumber) => this.setPage(pageNumber));\n this.emitter.on(['change-page-results'],\n (tf, pageLength) => this.changeResultsPerPage(pageLength));\n\n /** @inherited */\n this.initialized = true;\n\n this.emitter.emit('feature-initialized', this);\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 this.enable();\n this.init();\n\n if (filterTable) {\n this.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 let tf = this.tf;\n let cont = !this.tgtId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.tgtId);\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.pageLength);\n //refresh page nb span\n this.pgCont.innerHTML = this.nbPages;\n //select clearing shortcut\n if (this.pageSelectorType === SELECT) {\n this.pageSlc.innerHTML = '';\n }\n\n if (this.nbPages > 0) {\n cont.style.visibility = 'visible';\n if (this.pageSelectorType === SELECT) {\n for (let z = 0; z < this.nbPages; z++) {\n let opt = createOpt(z + 1, z * this.pageLength, false);\n this.pageSlc.options[z] = opt;\n }\n } else {\n //input type\n this.pageSlc.value = this.currentPageNb;\n }\n\n } else {\n /*** if no results paging select and buttons are hidden ***/\n cont.style.visibility = 'hidden';\n }\n this.groupByPage(tf.validRowsIndex);\n }\n\n /**\n * Group table rows by page and display valid rows\n * @param {Array} validRows Collection of valid rows\n */\n groupByPage(validRows) {\n let tf = this.tf;\n let rows = tf.dom().rows;\n let startPagingRow = parseInt(this.startPagingRow, 10);\n let endPagingRow = startPagingRow + parseInt(this.pageLength, 10);\n\n //store valid rows indexes\n if (validRows) {\n tf.validRowsIndex = validRows;\n }\n\n //this loop shows valid rows of current page\n for (let h = 0, len = tf.getValidRowsNb(true); h < len; h++) {\n let validRowIdx = tf.validRowsIndex[h];\n let r = rows[validRowIdx];\n let isRowValid = r.getAttribute('validRow');\n let rowDisplayed = false;\n\n if (h >= startPagingRow && h < endPagingRow) {\n if (isNull(isRowValid) || Boolean(isRowValid === 'true')) {\n r.style.display = '';\n rowDisplayed = true;\n }\n } else {\n r.style.display = NONE;\n }\n this.emitter.emit('row-paged', tf, validRowIdx, h, rowDisplayed);\n }\n\n // broadcast grouping by page\n this.emitter.emit('grouped-by-page', tf, this);\n }\n\n /**\n * Return the current page number\n * @return {Number} Page number\n */\n getPage() {\n return this.currentPageNb;\n }\n\n /**\n * Show page defined by passed argument (string or number):\n * @param {String}/{Number} cmd possible string values: 'next',\n * 'previous', 'last', 'first' or page number as per param\n */\n setPage(cmd) {\n let tf = this.tf;\n if (!tf.isInitialized() || !this.isEnabled()) {\n return;\n }\n let btnEvt = this.evt,\n cmdtype = typeof cmd;\n if (cmdtype === 'string') {\n switch (cmd.toLowerCase()) {\n case 'next':\n btnEvt.next();\n break;\n case 'previous':\n btnEvt.prev();\n break;\n case 'last':\n btnEvt.last();\n break;\n case 'first':\n btnEvt.first();\n break;\n default:\n btnEvt.next();\n break;\n }\n }\n else if (cmdtype === 'number') {\n this.changePage(cmd - 1);\n }\n }\n\n /**\n * Generates UI elements for the number of results per page drop-down\n */\n setResultsPerPage() {\n let tf = this.tf;\n let evt = this.evt;\n\n if (this.pageLengthSlc || !this.resultsPerPage) {\n return;\n }\n\n evt.slcResultsChange = (ev) => {\n this.onChangeResultsPerPage();\n ev.target.blur();\n };\n\n let slcR = createElm(SELECT);\n slcR.className = this.resultsSlcCssClass;\n let slcRText = this.resultsPerPage[0],\n slcROpts = this.resultsPerPage[1];\n let slcRSpan = createElm('span');\n slcRSpan.className = this.resultsSpanCssClass;\n\n // results per page select is added to external element\n let targetEl = !this.pageLengthTgtId ?\n tf.feature('toolbar').container(RIGHT) :\n elm(this.pageLengthTgtId);\n slcRSpan.appendChild(createText(slcRText));\n\n let help = tf.feature('help');\n if (help && help.btn) {\n help.btn.parentNode.insertBefore(slcRSpan, help.btn);\n help.btn.parentNode.insertBefore(slcR, help.btn);\n } else {\n targetEl.appendChild(slcRSpan);\n targetEl.appendChild(slcR);\n }\n\n for (let r = 0; r < slcROpts.length; r++) {\n let currOpt = new Option(slcROpts[r], slcROpts[r], false, false);\n slcR.options[r] = currOpt;\n }\n addEvt(slcR, 'change', evt.slcResultsChange);\n this.slcResultsTxt = slcRSpan;\n this.pageLengthSlc = slcR;\n }\n\n /**\n * Remove number of results per page UI elements\n */\n removeResultsPerPage() {\n let tf = this.tf;\n if (!tf.isInitialized() || !this.pageLengthSlc ||\n !this.resultsPerPage) {\n return;\n }\n if (this.pageLengthSlc) {\n removeElm(this.pageLengthSlc);\n }\n if (this.slcResultsTxt) {\n removeElm(this.slcResultsTxt);\n }\n this.pageLengthSlc = null;\n this.slcResultsTxt = null;\n }\n\n /**\n * Change the page based on passed index\n * @param {Number} index Index of the page (0-n)\n */\n changePage(index) {\n let tf = this.tf;\n\n if (!this.isEnabled()) {\n return;\n }\n\n this.emitter.emit('before-page-change', tf, (index + 1));\n\n if (index === null) {\n index = this.pageSelectorType === SELECT ?\n this.pageSlc.options.selectedIndex : this.pageSlc.value - 1;\n }\n if (index >= 0 && index <= (this.nbPages - 1)) {\n this.onBeforeChangePage(this, (index + 1));\n\n this.currentPageNb = parseInt(index, 10) + 1;\n if (this.pageSelectorType === SELECT) {\n this.pageSlc.options[index].selected = true;\n } else {\n this.pageSlc.value = this.currentPageNb;\n }\n\n this.startPagingRow = (this.pageSelectorType === SELECT) ?\n this.pageSlc.value : (index * this.pageLength);\n\n this.groupByPage();\n\n this.onAfterChangePage(this, (index + 1));\n }\n\n this.emitter.emit('after-page-change', tf, (index + 1));\n }\n\n /**\n * Change the number of results per page based on passed value\n * @param {String} val The number of results per page\n */\n changeResultsPerPage(val) {\n if (!this.isEnabled() || isNaN(val)) {\n return;\n }\n\n this.pageLengthSlc.value = val;\n this.onChangeResultsPerPage();\n }\n\n /**\n * Change rows according to page results drop-down\n */\n onChangeResultsPerPage() {\n let tf = this.tf;\n\n if (!this.isEnabled() || tf.getValidRowsNb() === 0) {\n return;\n }\n\n let {\n pageLengthSlc: slcR, pageSelectorType, pageSlc, emitter\n } = this;\n\n emitter.emit('before-page-length-change', tf);\n\n let slcIndex = slcR.selectedIndex;\n let slcPagesSelIndex = (pageSelectorType === SELECT) ?\n pageSlc.selectedIndex : parseInt(pageSlc.value - 1, 10);\n this.pageLength = parseInt(slcR.options[slcIndex].value, 10);\n this.startPagingRow = this.pageLength * slcPagesSelIndex;\n\n if (!isNaN(this.pageLength)) {\n if (this.startPagingRow >= tf.nbFilterableRows) {\n this.startPagingRow = (tf.nbFilterableRows - this.pageLength);\n }\n this.setPagingInfo();\n\n if (pageSelectorType === SELECT) {\n let slcIdx = (pageSlc.options.length - 1 <= slcPagesSelIndex) ?\n (pageSlc.options.length - 1) :\n slcPagesSelIndex;\n pageSlc.options[slcIdx].selected = true;\n }\n }\n\n emitter.emit('after-page-length-change', tf, this.pageLength);\n }\n\n /**\n * Re-set page nb at page re-load\n */\n resetPage() {\n let tf = this.tf;\n if (!this.isEnabled()) {\n return;\n }\n this.emitter.emit('before-reset-page', tf);\n let pgNb = tf.feature('store').getPageNb();\n if (pgNb !== '') {\n this.changePage((pgNb - 1));\n }\n this.emitter.emit('after-reset-page', tf, pgNb);\n }\n\n /**\n * Re-set page length value at page re-load\n */\n resetPageLength() {\n let tf = this.tf;\n if (!this.isEnabled()) {\n return;\n }\n this.emitter.emit('before-reset-page-length', tf);\n let pglenIndex = tf.feature('store').getPageLength();\n\n if (pglenIndex !== '') {\n this.pageLengthSlc.options[pglenIndex].selected = true;\n this.changeResultsPerPage();\n }\n this.emitter.emit('after-reset-page-length', tf, pglenIndex);\n }\n\n /**\n * Remove paging feature\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n let evt = this.evt;\n\n if (this.pageSlc) {\n if (this.pageSelectorType === SELECT) {\n removeEvt(this.pageSlc, 'change', evt.slcPagesChange);\n }\n else if (this.pageSelectorType === INPUT) {\n removeEvt(this.pageSlc, 'keypress', evt._detectKey);\n }\n removeElm(this.pageSlc);\n }\n\n if (this.btnNextCont) {\n removeEvt(this.btnNextCont, 'click', evt.next);\n removeElm(this.btnNextCont);\n this.btnNextCont = null;\n }\n\n if (this.btnPrevCont) {\n removeEvt(this.btnPrevCont, 'click', evt.prev);\n removeElm(this.btnPrevCont);\n this.btnPrevCont = null;\n }\n\n if (this.btnLastCont) {\n removeEvt(this.btnLastCont, 'click', evt.last);\n removeElm(this.btnLastCont);\n this.btnLastCont = null;\n }\n\n if (this.btnFirstCont) {\n removeEvt(this.btnFirstCont, 'click', evt.first);\n removeElm(this.btnFirstCont);\n this.btnFirstCont = null;\n }\n\n if (this.pgBefore) {\n removeElm(this.pgBefore);\n this.pgBefore = null;\n }\n\n if (this.pgAfter) {\n removeElm(this.pgAfter);\n this.pgAfter = null;\n }\n\n if (this.pgCont) {\n removeElm(this.pgCont);\n this.pgCont = null;\n }\n\n if (this.hasResultsPerPage) {\n this.removeResultsPerPage();\n }\n\n this.emitter.off(['after-filtering'], () => this.resetPagingInfo());\n this.emitter.off(['change-page'],\n (tf, pageNumber) => this.setPage(pageNumber));\n this.emitter.off(['change-page-results'],\n (tf, pageLength) => this.changeResultsPerPage(pageLength));\n\n this.pageSlc = null;\n this.nbPages = 0;\n\n this.initialized = false;\n }\n}\n",
+ "content": "import {Feature} from '../feature';\nimport {createElm, createOpt, createText, elm, removeElm} from '../dom';\nimport {isArray, isNull, EMPTY_FN} from '../types';\nimport {addEvt, removeEvt, isKeyPressed} from '../event';\nimport {INPUT, SELECT, NONE, ENTER_KEY} from '../const';\nimport {\n defaultsStr, defaultsNb, defaultsBool, defaultsArr, defaultsFn\n} from '../settings';\nimport {CENTER, RIGHT} from './toolbar';\n\n/**\n * Paging UI component\n * @export\n * @class Paging\n * @extends {Feature}\n */\nexport class Paging extends Feature {\n\n /**\n * Creates an instance of Paging\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'paging');\n\n // Configuration object\n let f = this.config.paging || {};\n\n /**\n * Css class for the paging buttons (previous, next, etc.)\n * @type {String}\n */\n this.btnCssClass = defaultsStr(f.btn_css_class, 'pgInp');\n\n /**\n * Main select DOM element\n * @type {DOMElement}\n */\n this.pageSlc = null;\n\n /**\n * Results per page select DOM element\n * @type {DOMElement}\n */\n this.pageLengthSlc = null;\n\n /**\n * ID of custom container element\n * @type {String}\n */\n this.tgtId = defaultsStr(f.target_id, null);\n\n /**\n * Number of rows contained in a page\n * @type {Number}\n */\n this.pageLength = defaultsNb(f.length, 10);\n\n /**\n * ID of custom container element for the results per page selector\n * @type {String}\n */\n this.pageLengthTgtId = defaultsStr(f.results_per_page_target_id, null);\n\n /**\n * Css class for the paging select element\n * @type {String}\n */\n this.pgSlcCssClass = defaultsStr(f.slc_css_class, 'pgSlc');\n\n /**\n * Css class for the paging input element\n * @type {String}\n */\n this.pgInpCssClass = defaultsStr(f.inp_css_class, 'pgNbInp');\n\n /**\n * Label and values for the results per page select, example of usage:\n * ['Records: ', [10,25,50,100]]\n * @type {Array}\n */\n this.resultsPerPage = defaultsArr(f.results_per_page, null);\n\n /**\n * Determines if results per page is configured\n * @type {Boolean}\n */\n this.hasResultsPerPage = isArray(this.resultsPerPage);\n\n /**\n * Css class for the results per page select\n * @type {String}\n */\n this.resultsSlcCssClass = defaultsStr(f.results_slc_css_class, 'rspg');\n\n /**\n * Css class for the label preceding results per page select\n * @type {String}\n */\n this.resultsSpanCssClass = defaultsStr(f.results_span_css_class,\n 'rspgSpan');\n\n /**\n * Index of the first row of current page\n * @type {Number}\n * @private\n */\n this.startPagingRow = 0;\n\n /**\n * Total number of pages\n * @type {Number}\n * @private\n */\n this.nbPages = 0;\n\n /**\n * Current page number\n * @type {Number}\n * @private\n */\n this.currentPageNb = 1;\n\n /**\n * Next page button text\n * @type {String}\n */\n this.btnNextPageText = defaultsStr(f.btn_next_page_text, '>');\n\n /**\n * Previous page button text\n * @type {String}\n */\n this.btnPrevPageText = defaultsStr(f.btn_prev_page_text, '<');\n\n /**\n * Last page button text\n * @type {String}\n */\n this.btnLastPageText = defaultsStr(f.btn_last_page_text, '>|');\n\n /**\n * First page button text\n * @type {String}\n */\n this.btnFirstPageText = defaultsStr(f.btn_first_page_text, '|<');\n\n /**\n * Next page button HTML\n * @type {String}\n */\n this.btnNextPageHtml = defaultsStr(f.btn_next_page_html,\n (!tf.enableIcons ? null :\n ''));\n\n /**\n * Previous page button HTML\n * @type {String}\n */\n this.btnPrevPageHtml = defaultsStr(f.btn_prev_page_html,\n (!tf.enableIcons ? null :\n ''));\n\n /**\n * First page button HTML\n * @type {String}\n */\n this.btnFirstPageHtml = defaultsStr(f.btn_first_page_html,\n (!tf.enableIcons ? null :\n ''));\n\n /**\n * Last page button HTML\n * @type {String}\n */\n this.btnLastPageHtml = defaultsStr(f.btn_last_page_html,\n (!tf.enableIcons ? null :\n ''));\n\n /**\n * Text preceeding page selector drop-down\n * @type {String}\n */\n this.pageText = defaultsStr(f.page_text, ' Page ');\n\n /**\n * Text after page selector drop-down\n * @type {String}\n */\n this.ofText = defaultsStr(f.of_text, ' of ');\n\n /**\n * Css class for the span containing total number of pages\n * @type {String}\n */\n this.nbPgSpanCssClass = defaultsStr(f.nb_pages_css_class, 'nbpg');\n\n /**\n * Determines if paging buttons are enabled (default: true)\n * @type {Boolean}\n */\n this.hasBtns = defaultsBool(f.btns, true);\n\n /**\n * Defines page selector type, two possible values: 'select', 'input'\n * @type {String}\n */\n this.pageSelectorType = defaultsStr(f.page_selector_type, SELECT);\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, CENTER);\n\n /**\n * Callback fired before the page is changed\n * @type {Function}\n */\n this.onBeforeChangePage = defaultsFn(f.on_before_change_page, EMPTY_FN);\n\n /**\n * Callback fired after the page is changed\n * @type {Function}\n */\n this.onAfterChangePage = defaultsFn(f.on_after_change_page, EMPTY_FN);\n\n /**\n * Label preciding results per page select\n * @type {DOMElement}\n * @private\n */\n this.slcResultsTxt = null;\n /**\n * Span containing next page button\n * @type {DOMElement}\n * @private\n */\n this.btnNextCont = null;\n /**\n * Span containing previous page button\n * @type {DOMElement}\n * @private\n */\n this.btnPrevCont = null;\n /**\n * Span containing last page button\n * @type {DOMElement}\n * @private\n */\n this.btnLastCont = null;\n /**\n * Span containing first page button\n * @type {DOMElement}\n * @private\n */\n this.btnFirstCont = null;\n /**\n * Span for tot nb pages\n * @type {DOMElement}\n * @private\n */\n this.pgCont = null;\n /**\n * Span preceding pages select (contains 'Page')\n * @type {DOMElement}\n * @private\n */\n this.pgBefore = null;\n /**\n * Span following pages select (contains ' of ')\n * @type {DOMElement}\n * @private\n */\n this.pgAfter = null;\n\n let startRow = tf.refRow;\n let nrows = tf.getRowsNb(true);\n //calculates page nb\n this.nbPages = Math.ceil((nrows - startRow) / this.pageLength);\n\n let o = this;\n /**\n * Paging DOM events handlers\n * @type {String}\n * @private\n */\n this.evt = {\n slcIndex() {\n return (o.pageSelectorType === SELECT) ?\n o.pageSlc.options.selectedIndex :\n parseInt(o.pageSlc.value, 10) - 1;\n },\n nbOpts() {\n return (o.pageSelectorType === SELECT) ?\n parseInt(o.pageSlc.options.length, 10) - 1 :\n (o.nbPages - 1);\n },\n next() {\n let nextIndex = o.evt.slcIndex() < o.evt.nbOpts() ?\n o.evt.slcIndex() + 1 : 0;\n o.changePage(nextIndex);\n },\n prev() {\n let 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 if (isKeyPressed(e, [ENTER_KEY])) {\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 let slcPages;\n let tf = this.tf;\n let evt = this.evt;\n\n if (this.initialized) {\n return;\n }\n\n this.emitter.emit('initializing-feature', this, !isNull(this.tgtId));\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.pageLength = this.resultsPerPage[1][0];\n this.setResultsPerPage();\n }\n }\n\n evt.slcPagesChange = (event) => {\n let slc = event.target;\n this.changePage(slc.selectedIndex);\n };\n\n // Paging drop-down list selector\n if (this.pageSelectorType === SELECT) {\n slcPages = createElm(SELECT);\n slcPages.className = this.pgSlcCssClass;\n addEvt(slcPages, 'change', evt.slcPagesChange);\n }\n\n // Paging input selector\n if (this.pageSelectorType === INPUT) {\n slcPages = createElm(INPUT, ['value', this.currentPageNb]);\n slcPages.className = this.pgInpCssClass;\n addEvt(slcPages, 'keypress', evt._detectKey);\n }\n\n // btns containers\n let btnNextSpan = createElm('span');\n let btnPrevSpan = createElm('span');\n let btnLastSpan = createElm('span');\n let btnFirstSpan = createElm('span');\n\n if (this.hasBtns) {\n // Next button\n if (!this.btnNextPageHtml) {\n let btnNext = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnNextPageText],\n ['title', 'Next']\n );\n btnNext.className = this.btnCssClass;\n addEvt(btnNext, 'click', evt.next);\n btnNextSpan.appendChild(btnNext);\n } else {\n btnNextSpan.innerHTML = this.btnNextPageHtml;\n addEvt(btnNextSpan, 'click', evt.next);\n }\n // Previous button\n if (!this.btnPrevPageHtml) {\n let btnPrev = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnPrevPageText],\n ['title', 'Previous']\n );\n btnPrev.className = this.btnCssClass;\n addEvt(btnPrev, 'click', evt.prev);\n btnPrevSpan.appendChild(btnPrev);\n } else {\n btnPrevSpan.innerHTML = this.btnPrevPageHtml;\n addEvt(btnPrevSpan, 'click', evt.prev);\n }\n // Last button\n if (!this.btnLastPageHtml) {\n let btnLast = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnLastPageText],\n ['title', 'Last']\n );\n btnLast.className = this.btnCssClass;\n addEvt(btnLast, 'click', evt.last);\n btnLastSpan.appendChild(btnLast);\n } else {\n btnLastSpan.innerHTML = this.btnLastPageHtml;\n addEvt(btnLastSpan, 'click', evt.last);\n }\n // First button\n if (!this.btnFirstPageHtml) {\n let btnFirst = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnFirstPageText],\n ['title', 'First']\n );\n btnFirst.className = this.btnCssClass;\n addEvt(btnFirst, 'click', evt.first);\n btnFirstSpan.appendChild(btnFirst);\n } else {\n btnFirstSpan.innerHTML = this.btnFirstPageHtml;\n addEvt(btnFirstSpan, 'click', evt.first);\n }\n }\n\n // paging elements (buttons+drop-down list) are added to defined element\n let targetEl = !this.tgtId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.tgtId);\n targetEl.appendChild(btnFirstSpan);\n targetEl.appendChild(btnPrevSpan);\n\n let pgBeforeSpan = createElm('span');\n pgBeforeSpan.appendChild(createText(this.pageText));\n pgBeforeSpan.className = this.nbPgSpanCssClass;\n targetEl.appendChild(pgBeforeSpan);\n targetEl.appendChild(slcPages);\n let pgAfterSpan = createElm('span');\n pgAfterSpan.appendChild(createText(this.ofText));\n pgAfterSpan.className = this.nbPgSpanCssClass;\n targetEl.appendChild(pgAfterSpan);\n let pgSpan = createElm('span');\n pgSpan.className = this.nbPgSpanCssClass;\n pgSpan.appendChild(createText(' ' + this.nbPages + ' '));\n targetEl.appendChild(pgSpan);\n targetEl.appendChild(btnNextSpan);\n targetEl.appendChild(btnLastSpan);\n\n this.btnNextCont = btnNextSpan;\n this.btnPrevCont = btnPrevSpan;\n this.btnLastCont = btnLastSpan;\n this.btnFirstCont = btnFirstSpan;\n this.pgCont = pgSpan;\n this.pgBefore = pgBeforeSpan;\n this.pgAfter = pgAfterSpan;\n this.pageSlc = slcPages;\n\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(['change-page'],\n (tf, pageNumber) => this.setPage(pageNumber));\n this.emitter.on(['change-page-results'],\n (tf, pageLength) => this.changeResultsPerPage(pageLength));\n\n /** @inherited */\n this.initialized = true;\n\n this.emitter.emit('feature-initialized', this);\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 this.enable();\n this.init();\n\n if (filterTable) {\n this.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 let tf = this.tf;\n let cont = !this.tgtId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.tgtId);\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.pageLength);\n //refresh page nb span\n this.pgCont.innerHTML = this.nbPages;\n //select clearing shortcut\n if (this.pageSelectorType === SELECT) {\n this.pageSlc.innerHTML = '';\n }\n\n if (this.nbPages > 0) {\n cont.style.visibility = 'visible';\n if (this.pageSelectorType === SELECT) {\n for (let z = 0; z < this.nbPages; z++) {\n let opt = createOpt(z + 1, z * this.pageLength, false);\n this.pageSlc.options[z] = opt;\n }\n } else {\n //input type\n this.pageSlc.value = this.currentPageNb;\n }\n\n } else {\n /*** if no results paging select and buttons are hidden ***/\n cont.style.visibility = 'hidden';\n }\n this.groupByPage(tf.validRowsIndex);\n }\n\n /**\n * Group table rows by page and display valid rows\n * @param {Array} validRows Collection of valid rows\n */\n groupByPage(validRows) {\n let tf = this.tf;\n let rows = tf.dom().rows;\n let startPagingRow = parseInt(this.startPagingRow, 10);\n let endPagingRow = startPagingRow + parseInt(this.pageLength, 10);\n\n //store valid rows indexes\n if (validRows) {\n tf.validRowsIndex = validRows;\n }\n\n //this loop shows valid rows of current page\n for (let h = 0, len = tf.getValidRowsNb(true); h < len; h++) {\n let validRowIdx = tf.validRowsIndex[h];\n let r = rows[validRowIdx];\n let isRowValid = r.getAttribute('validRow');\n let rowDisplayed = false;\n\n if (h >= startPagingRow && h < endPagingRow) {\n if (isNull(isRowValid) || Boolean(isRowValid === 'true')) {\n r.style.display = '';\n rowDisplayed = true;\n }\n } else {\n r.style.display = NONE;\n }\n this.emitter.emit('row-paged', tf, validRowIdx, h, rowDisplayed);\n }\n\n // broadcast grouping by page\n this.emitter.emit('grouped-by-page', tf, this);\n }\n\n /**\n * Return the current page number\n * @return {Number} Page number\n */\n getPage() {\n return this.currentPageNb;\n }\n\n /**\n * Show page defined by passed argument (string or number):\n * @param {String}/{Number} cmd possible string values: 'next',\n * 'previous', 'last', 'first' or page number as per param\n */\n setPage(cmd) {\n let tf = this.tf;\n if (!tf.isInitialized() || !this.isEnabled()) {\n return;\n }\n let btnEvt = this.evt,\n cmdtype = typeof cmd;\n if (cmdtype === 'string') {\n switch (cmd.toLowerCase()) {\n case 'next':\n btnEvt.next();\n break;\n case 'previous':\n btnEvt.prev();\n break;\n case 'last':\n btnEvt.last();\n break;\n case 'first':\n btnEvt.first();\n break;\n default:\n btnEvt.next();\n break;\n }\n }\n else if (cmdtype === 'number') {\n this.changePage(cmd - 1);\n }\n }\n\n /**\n * Generates UI elements for the number of results per page drop-down\n */\n setResultsPerPage() {\n let tf = this.tf;\n let evt = this.evt;\n\n if (this.pageLengthSlc || !this.resultsPerPage) {\n return;\n }\n\n evt.slcResultsChange = (ev) => {\n this.onChangeResultsPerPage();\n ev.target.blur();\n };\n\n let slcR = createElm(SELECT);\n slcR.className = this.resultsSlcCssClass;\n let slcRText = this.resultsPerPage[0],\n slcROpts = this.resultsPerPage[1];\n let slcRSpan = createElm('span');\n slcRSpan.className = this.resultsSpanCssClass;\n\n // results per page select is added to external element\n let targetEl = !this.pageLengthTgtId ?\n tf.feature('toolbar').container(RIGHT) :\n elm(this.pageLengthTgtId);\n slcRSpan.appendChild(createText(slcRText));\n\n let help = tf.feature('help');\n if (help && help.btn) {\n help.btn.parentNode.insertBefore(slcRSpan, help.btn);\n help.btn.parentNode.insertBefore(slcR, help.btn);\n } else {\n targetEl.appendChild(slcRSpan);\n targetEl.appendChild(slcR);\n }\n\n for (let r = 0; r < slcROpts.length; r++) {\n let currOpt = new Option(slcROpts[r], slcROpts[r], false, false);\n slcR.options[r] = currOpt;\n }\n addEvt(slcR, 'change', evt.slcResultsChange);\n this.slcResultsTxt = slcRSpan;\n this.pageLengthSlc = slcR;\n }\n\n /**\n * Remove number of results per page UI elements\n */\n removeResultsPerPage() {\n let tf = this.tf;\n if (!tf.isInitialized() || !this.pageLengthSlc ||\n !this.resultsPerPage) {\n return;\n }\n if (this.pageLengthSlc) {\n removeElm(this.pageLengthSlc);\n }\n if (this.slcResultsTxt) {\n removeElm(this.slcResultsTxt);\n }\n this.pageLengthSlc = null;\n this.slcResultsTxt = null;\n }\n\n /**\n * Change the page based on passed index\n * @param {Number} index Index of the page (0-n)\n */\n changePage(index) {\n let tf = this.tf;\n\n if (!this.isEnabled()) {\n return;\n }\n\n this.emitter.emit('before-page-change', tf, (index + 1));\n\n if (index === null) {\n index = this.pageSelectorType === SELECT ?\n this.pageSlc.options.selectedIndex : this.pageSlc.value - 1;\n }\n if (index >= 0 && index <= (this.nbPages - 1)) {\n this.onBeforeChangePage(this, (index + 1));\n\n this.currentPageNb = parseInt(index, 10) + 1;\n if (this.pageSelectorType === SELECT) {\n this.pageSlc.options[index].selected = true;\n } else {\n this.pageSlc.value = this.currentPageNb;\n }\n\n this.startPagingRow = (this.pageSelectorType === SELECT) ?\n this.pageSlc.value : (index * this.pageLength);\n\n this.groupByPage();\n\n this.onAfterChangePage(this, (index + 1));\n }\n\n this.emitter.emit('after-page-change', tf, (index + 1));\n }\n\n /**\n * Change the number of results per page based on passed value\n * @param {String} val The number of results per page\n */\n changeResultsPerPage(val) {\n if (!this.isEnabled() || isNaN(val)) {\n return;\n }\n\n this.pageLengthSlc.value = val;\n this.onChangeResultsPerPage();\n }\n\n /**\n * Change rows according to page results drop-down\n */\n onChangeResultsPerPage() {\n let tf = this.tf;\n\n if (!this.isEnabled() || tf.getValidRowsNb() === 0) {\n return;\n }\n\n let {\n pageLengthSlc: slcR, pageSelectorType, pageSlc, emitter\n } = this;\n\n emitter.emit('before-page-length-change', tf);\n\n let slcIndex = slcR.selectedIndex;\n let slcPagesSelIndex = (pageSelectorType === SELECT) ?\n pageSlc.selectedIndex : parseInt(pageSlc.value - 1, 10);\n this.pageLength = parseInt(slcR.options[slcIndex].value, 10);\n this.startPagingRow = this.pageLength * slcPagesSelIndex;\n\n if (!isNaN(this.pageLength)) {\n if (this.startPagingRow >= tf.nbFilterableRows) {\n this.startPagingRow = (tf.nbFilterableRows - this.pageLength);\n }\n this.setPagingInfo();\n\n if (pageSelectorType === SELECT) {\n let slcIdx = (pageSlc.options.length - 1 <= slcPagesSelIndex) ?\n (pageSlc.options.length - 1) :\n slcPagesSelIndex;\n pageSlc.options[slcIdx].selected = true;\n }\n }\n\n emitter.emit('after-page-length-change', tf, this.pageLength);\n }\n\n /**\n * Re-set page nb at page re-load\n */\n resetPage() {\n let tf = this.tf;\n if (!this.isEnabled()) {\n return;\n }\n this.emitter.emit('before-reset-page', tf);\n let pgNb = tf.feature('store').getPageNb();\n if (pgNb !== '') {\n this.changePage((pgNb - 1));\n }\n this.emitter.emit('after-reset-page', tf, pgNb);\n }\n\n /**\n * Re-set page length value at page re-load\n */\n resetPageLength() {\n let tf = this.tf;\n if (!this.isEnabled()) {\n return;\n }\n this.emitter.emit('before-reset-page-length', tf);\n let pglenIndex = tf.feature('store').getPageLength();\n\n if (pglenIndex !== '') {\n this.pageLengthSlc.options[pglenIndex].selected = true;\n this.changeResultsPerPage();\n }\n this.emitter.emit('after-reset-page-length', tf, pglenIndex);\n }\n\n /**\n * Remove paging feature\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n let evt = this.evt;\n\n if (this.pageSlc) {\n if (this.pageSelectorType === SELECT) {\n removeEvt(this.pageSlc, 'change', evt.slcPagesChange);\n }\n else if (this.pageSelectorType === INPUT) {\n removeEvt(this.pageSlc, 'keypress', evt._detectKey);\n }\n removeElm(this.pageSlc);\n }\n\n if (this.btnNextCont) {\n removeEvt(this.btnNextCont, 'click', evt.next);\n removeElm(this.btnNextCont);\n this.btnNextCont = null;\n }\n\n if (this.btnPrevCont) {\n removeEvt(this.btnPrevCont, 'click', evt.prev);\n removeElm(this.btnPrevCont);\n this.btnPrevCont = null;\n }\n\n if (this.btnLastCont) {\n removeEvt(this.btnLastCont, 'click', evt.last);\n removeElm(this.btnLastCont);\n this.btnLastCont = null;\n }\n\n if (this.btnFirstCont) {\n removeEvt(this.btnFirstCont, 'click', evt.first);\n removeElm(this.btnFirstCont);\n this.btnFirstCont = null;\n }\n\n if (this.pgBefore) {\n removeElm(this.pgBefore);\n this.pgBefore = null;\n }\n\n if (this.pgAfter) {\n removeElm(this.pgAfter);\n this.pgAfter = null;\n }\n\n if (this.pgCont) {\n removeElm(this.pgCont);\n this.pgCont = null;\n }\n\n if (this.hasResultsPerPage) {\n this.removeResultsPerPage();\n }\n\n this.emitter.off(['after-filtering'], () => this.resetPagingInfo());\n this.emitter.off(['change-page'],\n (tf, pageNumber) => this.setPage(pageNumber));\n this.emitter.off(['change-page-results'],\n (tf, pageLength) => this.changeResultsPerPage(pageLength));\n\n this.pageSlc = null;\n this.nbPages = 0;\n\n this.initialized = false;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/modules/paging.js",
"access": "public",
@@ -11521,7 +11640,7 @@
"lineNumber": 1
},
{
- "__docId__": 612,
+ "__docId__": 613,
"kind": "class",
"name": "Paging",
"memberof": "src/modules/paging.js",
@@ -11545,7 +11664,7 @@
]
},
{
- "__docId__": 613,
+ "__docId__": 614,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/paging.js~Paging",
@@ -11570,7 +11689,7 @@
]
},
{
- "__docId__": 614,
+ "__docId__": 615,
"kind": "member",
"name": "btnCssClass",
"memberof": "src/modules/paging.js~Paging",
@@ -11589,7 +11708,7 @@
}
},
{
- "__docId__": 615,
+ "__docId__": 616,
"kind": "member",
"name": "pageSlc",
"memberof": "src/modules/paging.js~Paging",
@@ -11608,7 +11727,7 @@
}
},
{
- "__docId__": 616,
+ "__docId__": 617,
"kind": "member",
"name": "pageLengthSlc",
"memberof": "src/modules/paging.js~Paging",
@@ -11627,7 +11746,7 @@
}
},
{
- "__docId__": 617,
+ "__docId__": 618,
"kind": "member",
"name": "tgtId",
"memberof": "src/modules/paging.js~Paging",
@@ -11646,7 +11765,7 @@
}
},
{
- "__docId__": 618,
+ "__docId__": 619,
"kind": "member",
"name": "pageLength",
"memberof": "src/modules/paging.js~Paging",
@@ -11665,7 +11784,7 @@
}
},
{
- "__docId__": 619,
+ "__docId__": 620,
"kind": "member",
"name": "pageLengthTgtId",
"memberof": "src/modules/paging.js~Paging",
@@ -11684,7 +11803,7 @@
}
},
{
- "__docId__": 620,
+ "__docId__": 621,
"kind": "member",
"name": "pgSlcCssClass",
"memberof": "src/modules/paging.js~Paging",
@@ -11703,7 +11822,7 @@
}
},
{
- "__docId__": 621,
+ "__docId__": 622,
"kind": "member",
"name": "pgInpCssClass",
"memberof": "src/modules/paging.js~Paging",
@@ -11722,7 +11841,7 @@
}
},
{
- "__docId__": 622,
+ "__docId__": 623,
"kind": "member",
"name": "resultsPerPage",
"memberof": "src/modules/paging.js~Paging",
@@ -11741,7 +11860,7 @@
}
},
{
- "__docId__": 623,
+ "__docId__": 624,
"kind": "member",
"name": "hasResultsPerPage",
"memberof": "src/modules/paging.js~Paging",
@@ -11760,7 +11879,7 @@
}
},
{
- "__docId__": 624,
+ "__docId__": 625,
"kind": "member",
"name": "resultsSlcCssClass",
"memberof": "src/modules/paging.js~Paging",
@@ -11779,7 +11898,7 @@
}
},
{
- "__docId__": 625,
+ "__docId__": 626,
"kind": "member",
"name": "resultsSpanCssClass",
"memberof": "src/modules/paging.js~Paging",
@@ -11798,7 +11917,7 @@
}
},
{
- "__docId__": 626,
+ "__docId__": 627,
"kind": "member",
"name": "startPagingRow",
"memberof": "src/modules/paging.js~Paging",
@@ -11814,10 +11933,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 627,
+ "__docId__": 628,
"kind": "member",
"name": "nbPages",
"memberof": "src/modules/paging.js~Paging",
@@ -11833,10 +11953,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 628,
+ "__docId__": 629,
"kind": "member",
"name": "currentPageNb",
"memberof": "src/modules/paging.js~Paging",
@@ -11852,10 +11973,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 629,
+ "__docId__": 630,
"kind": "member",
"name": "btnNextPageText",
"memberof": "src/modules/paging.js~Paging",
@@ -11874,7 +11996,7 @@
}
},
{
- "__docId__": 630,
+ "__docId__": 631,
"kind": "member",
"name": "btnPrevPageText",
"memberof": "src/modules/paging.js~Paging",
@@ -11893,7 +12015,7 @@
}
},
{
- "__docId__": 631,
+ "__docId__": 632,
"kind": "member",
"name": "btnLastPageText",
"memberof": "src/modules/paging.js~Paging",
@@ -11912,7 +12034,7 @@
}
},
{
- "__docId__": 632,
+ "__docId__": 633,
"kind": "member",
"name": "btnFirstPageText",
"memberof": "src/modules/paging.js~Paging",
@@ -11931,7 +12053,7 @@
}
},
{
- "__docId__": 633,
+ "__docId__": 634,
"kind": "member",
"name": "btnNextPageHtml",
"memberof": "src/modules/paging.js~Paging",
@@ -11950,7 +12072,7 @@
}
},
{
- "__docId__": 634,
+ "__docId__": 635,
"kind": "member",
"name": "btnPrevPageHtml",
"memberof": "src/modules/paging.js~Paging",
@@ -11969,7 +12091,7 @@
}
},
{
- "__docId__": 635,
+ "__docId__": 636,
"kind": "member",
"name": "btnFirstPageHtml",
"memberof": "src/modules/paging.js~Paging",
@@ -11988,7 +12110,7 @@
}
},
{
- "__docId__": 636,
+ "__docId__": 637,
"kind": "member",
"name": "btnLastPageHtml",
"memberof": "src/modules/paging.js~Paging",
@@ -12007,7 +12129,7 @@
}
},
{
- "__docId__": 637,
+ "__docId__": 638,
"kind": "member",
"name": "pageText",
"memberof": "src/modules/paging.js~Paging",
@@ -12026,7 +12148,7 @@
}
},
{
- "__docId__": 638,
+ "__docId__": 639,
"kind": "member",
"name": "ofText",
"memberof": "src/modules/paging.js~Paging",
@@ -12045,7 +12167,7 @@
}
},
{
- "__docId__": 639,
+ "__docId__": 640,
"kind": "member",
"name": "nbPgSpanCssClass",
"memberof": "src/modules/paging.js~Paging",
@@ -12064,7 +12186,7 @@
}
},
{
- "__docId__": 640,
+ "__docId__": 641,
"kind": "member",
"name": "hasBtns",
"memberof": "src/modules/paging.js~Paging",
@@ -12083,7 +12205,7 @@
}
},
{
- "__docId__": 641,
+ "__docId__": 642,
"kind": "member",
"name": "pageSelectorType",
"memberof": "src/modules/paging.js~Paging",
@@ -12102,7 +12224,7 @@
}
},
{
- "__docId__": 642,
+ "__docId__": 643,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/modules/paging.js~Paging",
@@ -12121,7 +12243,7 @@
}
},
{
- "__docId__": 643,
+ "__docId__": 644,
"kind": "member",
"name": "onBeforeChangePage",
"memberof": "src/modules/paging.js~Paging",
@@ -12140,7 +12262,7 @@
}
},
{
- "__docId__": 644,
+ "__docId__": 645,
"kind": "member",
"name": "onAfterChangePage",
"memberof": "src/modules/paging.js~Paging",
@@ -12159,7 +12281,7 @@
}
},
{
- "__docId__": 645,
+ "__docId__": 646,
"kind": "member",
"name": "slcResultsTxt",
"memberof": "src/modules/paging.js~Paging",
@@ -12175,10 +12297,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 646,
+ "__docId__": 647,
"kind": "member",
"name": "btnNextCont",
"memberof": "src/modules/paging.js~Paging",
@@ -12194,10 +12317,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 647,
+ "__docId__": 648,
"kind": "member",
"name": "btnPrevCont",
"memberof": "src/modules/paging.js~Paging",
@@ -12213,10 +12337,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 648,
+ "__docId__": 649,
"kind": "member",
"name": "btnLastCont",
"memberof": "src/modules/paging.js~Paging",
@@ -12232,10 +12357,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 649,
+ "__docId__": 650,
"kind": "member",
"name": "btnFirstCont",
"memberof": "src/modules/paging.js~Paging",
@@ -12251,10 +12377,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 650,
+ "__docId__": 651,
"kind": "member",
"name": "pgCont",
"memberof": "src/modules/paging.js~Paging",
@@ -12270,10 +12397,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 651,
+ "__docId__": 652,
"kind": "member",
"name": "pgBefore",
"memberof": "src/modules/paging.js~Paging",
@@ -12289,10 +12417,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 652,
+ "__docId__": 653,
"kind": "member",
"name": "pgAfter",
"memberof": "src/modules/paging.js~Paging",
@@ -12308,10 +12437,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 654,
+ "__docId__": 655,
"kind": "member",
"name": "evt",
"memberof": "src/modules/paging.js~Paging",
@@ -12327,10 +12457,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 655,
+ "__docId__": 656,
"kind": "method",
"name": "init",
"memberof": "src/modules/paging.js~Paging",
@@ -12340,12 +12471,12 @@
"longname": "src/modules/paging.js~Paging#init",
"access": "public",
"description": "Initialize DOM elements",
- "lineNumber": 342,
+ "lineNumber": 341,
"params": [],
"return": null
},
{
- "__docId__": 666,
+ "__docId__": 667,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/paging.js~Paging",
@@ -12353,7 +12484,7 @@
"longname": "src/modules/paging.js~Paging#initialized",
"access": "public",
"description": null,
- "lineNumber": 494,
+ "lineNumber": 493,
"unknown": [
{
"tagName": "@inherited",
@@ -12367,7 +12498,7 @@
}
},
{
- "__docId__": 667,
+ "__docId__": 668,
"kind": "method",
"name": "reset",
"memberof": "src/modules/paging.js~Paging",
@@ -12377,7 +12508,7 @@
"longname": "src/modules/paging.js~Paging#reset",
"access": "public",
"description": "Reset paging when filters are already instantiated",
- "lineNumber": 503,
+ "lineNumber": 502,
"params": [
{
"nullable": null,
@@ -12393,7 +12524,7 @@
"return": null
},
{
- "__docId__": 668,
+ "__docId__": 669,
"kind": "method",
"name": "resetPagingInfo",
"memberof": "src/modules/paging.js~Paging",
@@ -12403,12 +12534,12 @@
"longname": "src/modules/paging.js~Paging#resetPagingInfo",
"access": "public",
"description": "Reset paging info from scratch after a filtering process",
- "lineNumber": 515,
+ "lineNumber": 514,
"params": [],
"return": null
},
{
- "__docId__": 671,
+ "__docId__": 672,
"kind": "method",
"name": "setPagingInfo",
"memberof": "src/modules/paging.js~Paging",
@@ -12418,33 +12549,7 @@
"longname": "src/modules/paging.js~Paging#setPagingInfo",
"access": "public",
"description": "Calculate number of pages based on valid rows\nRefresh paging select according to number of pages",
- "lineNumber": 526,
- "params": [
- {
- "nullable": null,
- "types": [
- "Array"
- ],
- "spread": false,
- "optional": false,
- "name": "validRows",
- "description": "Collection of valid rows"
- }
- ],
- "return": null
- },
- {
- "__docId__": 673,
- "kind": "method",
- "name": "groupByPage",
- "memberof": "src/modules/paging.js~Paging",
- "generator": false,
- "async": false,
- "static": false,
- "longname": "src/modules/paging.js~Paging#groupByPage",
- "access": "public",
- "description": "Group table rows by page and display valid rows",
- "lineNumber": 567,
+ "lineNumber": 525,
"params": [
{
"nullable": null,
@@ -12462,6 +12567,32 @@
{
"__docId__": 674,
"kind": "method",
+ "name": "groupByPage",
+ "memberof": "src/modules/paging.js~Paging",
+ "generator": false,
+ "async": false,
+ "static": false,
+ "longname": "src/modules/paging.js~Paging#groupByPage",
+ "access": "public",
+ "description": "Group table rows by page and display valid rows",
+ "lineNumber": 566,
+ "params": [
+ {
+ "nullable": null,
+ "types": [
+ "Array"
+ ],
+ "spread": false,
+ "optional": false,
+ "name": "validRows",
+ "description": "Collection of valid rows"
+ }
+ ],
+ "return": null
+ },
+ {
+ "__docId__": 675,
+ "kind": "method",
"name": "getPage",
"memberof": "src/modules/paging.js~Paging",
"generator": false,
@@ -12470,7 +12601,7 @@
"longname": "src/modules/paging.js~Paging#getPage",
"access": "public",
"description": "Return the current page number",
- "lineNumber": 604,
+ "lineNumber": 603,
"return": {
"nullable": null,
"types": [
@@ -12482,7 +12613,7 @@
"params": []
},
{
- "__docId__": 675,
+ "__docId__": 676,
"kind": "method",
"name": "setPage",
"memberof": "src/modules/paging.js~Paging",
@@ -12492,7 +12623,7 @@
"longname": "src/modules/paging.js~Paging#setPage",
"access": "public",
"description": "Show page defined by passed argument (string or number):",
- "lineNumber": 613,
+ "lineNumber": 612,
"params": [
{
"nullable": null,
@@ -12508,7 +12639,7 @@
"return": null
},
{
- "__docId__": 676,
+ "__docId__": 677,
"kind": "method",
"name": "setResultsPerPage",
"memberof": "src/modules/paging.js~Paging",
@@ -12518,12 +12649,12 @@
"longname": "src/modules/paging.js~Paging#setResultsPerPage",
"access": "public",
"description": "Generates UI elements for the number of results per page drop-down",
- "lineNumber": 647,
+ "lineNumber": 646,
"params": [],
"return": null
},
{
- "__docId__": 679,
+ "__docId__": 680,
"kind": "method",
"name": "removeResultsPerPage",
"memberof": "src/modules/paging.js~Paging",
@@ -12533,12 +12664,12 @@
"longname": "src/modules/paging.js~Paging#removeResultsPerPage",
"access": "public",
"description": "Remove number of results per page UI elements",
- "lineNumber": 694,
+ "lineNumber": 693,
"params": [],
"return": null
},
{
- "__docId__": 682,
+ "__docId__": 683,
"kind": "method",
"name": "changePage",
"memberof": "src/modules/paging.js~Paging",
@@ -12548,7 +12679,7 @@
"longname": "src/modules/paging.js~Paging#changePage",
"access": "public",
"description": "Change the page based on passed index",
- "lineNumber": 714,
+ "lineNumber": 713,
"params": [
{
"nullable": null,
@@ -12564,7 +12695,7 @@
"return": null
},
{
- "__docId__": 685,
+ "__docId__": 686,
"kind": "method",
"name": "changeResultsPerPage",
"memberof": "src/modules/paging.js~Paging",
@@ -12574,7 +12705,7 @@
"longname": "src/modules/paging.js~Paging#changeResultsPerPage",
"access": "public",
"description": "Change the number of results per page based on passed value",
- "lineNumber": 752,
+ "lineNumber": 751,
"params": [
{
"nullable": null,
@@ -12590,7 +12721,7 @@
"return": null
},
{
- "__docId__": 686,
+ "__docId__": 687,
"kind": "method",
"name": "onChangeResultsPerPage",
"memberof": "src/modules/paging.js~Paging",
@@ -12600,12 +12731,12 @@
"longname": "src/modules/paging.js~Paging#onChangeResultsPerPage",
"access": "public",
"description": "Change rows according to page results drop-down",
- "lineNumber": 764,
+ "lineNumber": 763,
"params": [],
"return": null
},
{
- "__docId__": 690,
+ "__docId__": 691,
"kind": "method",
"name": "resetPage",
"memberof": "src/modules/paging.js~Paging",
@@ -12615,12 +12746,12 @@
"longname": "src/modules/paging.js~Paging#resetPage",
"access": "public",
"description": "Re-set page nb at page re-load",
- "lineNumber": 803,
+ "lineNumber": 802,
"params": [],
"return": null
},
{
- "__docId__": 691,
+ "__docId__": 692,
"kind": "method",
"name": "resetPageLength",
"memberof": "src/modules/paging.js~Paging",
@@ -12630,12 +12761,12 @@
"longname": "src/modules/paging.js~Paging#resetPageLength",
"access": "public",
"description": "Re-set page length value at page re-load",
- "lineNumber": 819,
+ "lineNumber": 818,
"params": [],
"return": null
},
{
- "__docId__": 692,
+ "__docId__": 693,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/paging.js~Paging",
@@ -12645,12 +12776,12 @@
"longname": "src/modules/paging.js~Paging#destroy",
"access": "public",
"description": "Remove paging feature",
- "lineNumber": 837,
+ "lineNumber": 836,
"params": [],
"return": null
},
{
- "__docId__": 703,
+ "__docId__": 704,
"kind": "file",
"name": "src/modules/popupFilter.js",
"content": "import {Feature} from '../feature';\nimport {isUndef, EMPTY_FN} from '../types';\nimport {createElm, removeElm} from '../dom';\nimport {addEvt, cancelEvt, stopEvt, targetEvt, removeEvt} from '../event';\nimport {INPUT, NONE, CHECKLIST, MULTIPLE} from '../const';\nimport {root} from '../root';\nimport {defaultsStr, defaultsBool, defaultsArr, defaultsFn} from '../settings';\n\n/**\n * Pop-up filter component\n * @export\n * @class PopupFilter\n * @extends {Feature}\n */\nexport class PopupFilter extends Feature {\n\n /**\n * Creates an instance of PopupFilter\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'popupFilters');\n\n // Configuration object\n let f = this.config.popup_filters || {};\n\n /**\n * Close active popup filter upon filtering, enabled by default\n * @type {Boolean}\n */\n this.closeOnFiltering = defaultsBool(f.close_on_filtering, true);\n\n /**\n * Filter icon path\n * @type {String}\n */\n this.iconPath = defaultsStr(f.image, tf.themesPath + 'icn_filter.gif');\n\n /**\n * Active filter icon path\n * @type {string}\n */\n this.activeIconPath = defaultsStr(f.image_active,\n tf.themesPath + 'icn_filterActive.gif');\n\n /**\n * HTML for the filter icon\n * @type {string}\n */\n this.iconHtml = defaultsStr(f.image_html,\n '
');\n\n /**\n * Css class assigned to the popup container element\n * @type {String}\n */\n this.placeholderCssClass = defaultsStr(f.placeholder_css_class,\n 'popUpPlaceholder');\n\n /**\n * Css class assigned to filter container element\n * @type {String}\n */\n this.containerCssClass = defaultsStr(f.div_css_class, 'popUpFilter');\n\n /**\n * Ensure filter's container element width matches column width, enabled\n * by default\n * @type {Boolean}\n */\n this.adjustToContainer = defaultsBool(f.adjust_to_container, true);\n\n /**\n * Callback fired before a popup filter is opened\n * @type {Function}\n */\n this.onBeforeOpen = defaultsFn(f.on_before_popup_filter_open, EMPTY_FN);\n\n /**\n * Callback fired after a popup filter is opened\n * @type {Function}\n */\n this.onAfterOpen = defaultsFn(f.on_after_popup_filter_open, EMPTY_FN);\n\n /**\n * Callback fired before a popup filter is closed\n * @type {Function}\n */\n this.onBeforeClose = defaultsFn(f.on_before_popup_filter_close,\n EMPTY_FN);\n\n /**\n * Callback fired after a popup filter is closed\n * @type {Function}\n */\n this.onAfterClose = defaultsFn(f.on_after_popup_filter_close, EMPTY_FN);\n\n /**\n * Collection of filters spans\n * @type {Array}\n * @private\n */\n this.fltSpans = [];\n\n /**\n * Collection of filters icons\n * @type {Array}\n * @private\n */\n this.fltIcons = [];\n\n /**\n * Collection of filters icons cached after pop-up filters are removed\n * @type {Array}\n * @private\n */\n this.filtersCache = null;\n\n /**\n * Collection of filters containers\n * @type {Array}\n * @private\n */\n this.fltElms = defaultsArr(this.filtersCache, []);\n\n /**\n * Prefix for pop-up filter container ID\n * @type {String}\n * @private\n */\n this.prfxDiv = 'popup_';\n\n /**\n * Column index of popup filter currently active\n * @type {Number}\n * @private\n */\n this.activeFilterIdx = -1;\n }\n\n /**\n * Click event handler for pop-up filter icon\n * @private\n */\n onClick(evt) {\n let elm = targetEvt(evt).parentNode;\n let colIndex = parseInt(elm.getAttribute('ci'), 10);\n\n this.closeAll(colIndex);\n this.toggle(colIndex);\n\n if (this.adjustToContainer) {\n let cont = this.fltElms[colIndex],\n header = this.tf.getHeaderElement(colIndex),\n headerWidth = header.clientWidth * 0.95;\n cont.style.width = parseInt(headerWidth, 10) + 'px';\n }\n cancelEvt(evt);\n stopEvt(evt);\n }\n\n /**\n * Mouse-up event handler handling popup filter auto-close behaviour\n * @private\n */\n onMouseup(evt) {\n if (this.activeFilterIdx === -1) {\n return;\n }\n let targetElm = targetEvt(evt);\n let activeFlt = this.fltElms[this.activeFilterIdx];\n let icon = this.fltIcons[this.activeFilterIdx];\n\n if (icon === targetElm) {\n return;\n }\n\n while (targetElm && targetElm !== activeFlt) {\n targetElm = targetElm.parentNode;\n }\n\n if (targetElm !== activeFlt) {\n this.close(this.activeFilterIdx);\n }\n\n return;\n }\n\n /**\n * Initialize DOM elements\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n let tf = this.tf;\n\n // Enable external filters\n tf.externalFltIds = [''];\n\n // Override filters row index supplied by configuration\n tf.filtersRowIndex = 0;\n\n // Override headers row index if no grouped headers\n // TODO: Because of the filters row generation, headers row index needs\n // adjusting: prevent useless row generation\n if (tf.headersRow <= 1 && isNaN(tf.config().headers_row_index)) {\n tf.headersRow = 0;\n }\n\n // Adjust headers row index for grid-layout mode\n // TODO: Because of the filters row generation, headers row index needs\n // adjusting: prevent useless row generation\n if (tf.gridLayout) {\n tf.headersRow--;\n this.buildIcons();\n }\n\n // subscribe to events\n this.emitter.on(['before-filtering'], () => this.setIconsState());\n this.emitter.on(['after-filtering'], () => this.closeAll());\n this.emitter.on(['cell-processed'],\n (tf, cellIndex) => this.changeState(cellIndex, true));\n this.emitter.on(['filters-row-inserted'], () => this.buildIcons());\n this.emitter.on(['before-filter-init'],\n (tf, colIndex) => this.build(colIndex));\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Reset previously destroyed feature\n */\n reset() {\n this.enable();\n this.init();\n this.buildIcons();\n this.buildAll();\n }\n\n /**\n * Build all filters icons\n */\n buildIcons() {\n let tf = this.tf;\n\n // TODO: Because of the filters row generation, headers row index needs\n // adjusting: prevent useless row generation\n tf.headersRow++;\n\n tf.eachCol(\n (i) => {\n let icon = createElm('span', ['ci', i]);\n icon.innerHTML = this.iconHtml;\n let header = tf.getHeaderElement(i);\n header.appendChild(icon);\n addEvt(icon, 'click', (evt) => this.onClick(evt));\n this.fltSpans[i] = icon;\n this.fltIcons[i] = icon.firstChild;\n },\n // continue condition function\n (i) => tf.getFilterType(i) === NONE\n );\n }\n\n /**\n * Build all pop-up filters elements\n */\n buildAll() {\n for (let i = 0; i < this.filtersCache.length; i++) {\n this.build(i, this.filtersCache[i]);\n }\n }\n\n /**\n * Build a specified pop-up filter elements\n * @param {Number} colIndex Column index\n * @param {Object} div Optional container DOM element\n */\n build(colIndex, div) {\n let tf = this.tf;\n let contId = `${this.prfxDiv}${tf.id}_${colIndex}`;\n let placeholder = createElm('div', ['class', this.placeholderCssClass]);\n let cont = div ||\n createElm('div', ['id', contId], ['class', this.containerCssClass]);\n tf.externalFltIds[colIndex] = cont.id;\n placeholder.appendChild(cont);\n\n let header = tf.getHeaderElement(colIndex);\n header.insertBefore(placeholder, header.firstChild);\n addEvt(cont, 'click', (evt) => stopEvt(evt));\n this.fltElms[colIndex] = cont;\n }\n\n /**\n * Toggle visibility of specified filter\n * @param {Number} colIndex Column index\n */\n toggle(colIndex) {\n if (!this.isOpen(colIndex)) {\n this.open(colIndex);\n } else {\n this.close(colIndex);\n }\n }\n\n /**\n * Open popup filter of specified column\n * @param {Number} colIndex Column index\n */\n open(colIndex) {\n let tf = this.tf,\n container = this.fltElms[colIndex];\n\n this.onBeforeOpen(this, container, colIndex);\n\n container.style.display = 'block';\n this.activeFilterIdx = colIndex;\n addEvt(root, 'mouseup', (evt) => this.onMouseup(evt));\n\n if (tf.getFilterType(colIndex) === INPUT) {\n let flt = tf.getFilterElement(colIndex);\n if (flt) {\n flt.focus();\n }\n }\n\n this.onAfterOpen(this, container, colIndex);\n }\n\n /**\n * Close popup filter of specified column\n * @param {Number} colIndex Column index\n */\n close(colIndex) {\n let container = this.fltElms[colIndex];\n\n this.onBeforeClose(this, container, colIndex);\n\n container.style.display = NONE;\n if (this.activeFilterIdx === colIndex) {\n this.activeFilterIdx = -1;\n }\n removeEvt(root, 'mouseup', (evt) => this.onMouseup(evt));\n\n this.onAfterClose(this, container, colIndex);\n }\n\n /**\n * Check if popup filter for specified column is open\n * @param {Number} colIndex Column index\n * @returns {Boolean}\n */\n isOpen(colIndex) {\n return this.fltElms[colIndex].style.display === 'block';\n }\n\n /**\n * Close all filters excepted for the specified one if any\n * @param {Number} exceptIdx Column index of the filter to not close\n */\n closeAll(exceptIdx) {\n // Do not close filters only if argument is undefined and close on\n // filtering option is disabled\n if (isUndef(exceptIdx) && !this.closeOnFiltering) {\n return;\n }\n for (let i = 0; i < this.fltElms.length; i++) {\n if (i === exceptIdx) {\n continue;\n }\n let fltType = this.tf.getFilterType(i);\n let isMultipleFilter =\n (fltType === CHECKLIST || fltType === MULTIPLE);\n\n // Always hide all single selection filter types but hide multiple\n // selection filter types only if index set\n if (!isMultipleFilter || !isUndef(exceptIdx)) {\n this.close(i);\n }\n }\n }\n\n /**\n * Build all the icons representing the pop-up filters\n */\n setIconsState() {\n for (let i = 0; i < this.fltIcons.length; i++) {\n this.changeState(i, false);\n }\n }\n\n /**\n * Apply specified icon state\n * @param {Number} colIndex Column index\n * @param {Boolean} active Apply active state\n */\n changeState(colIndex, active) {\n let icon = this.fltIcons[colIndex];\n if (icon) {\n icon.src = active ? this.activeIconPath : this.iconPath;\n }\n }\n\n /**\n * Remove pop-up filters\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n this.filtersCache = [];\n for (let i = 0; i < this.fltElms.length; i++) {\n let container = this.fltElms[i],\n placeholder = container.parentNode,\n icon = this.fltSpans[i],\n iconImg = this.fltIcons[i];\n if (container) {\n removeElm(container);\n this.filtersCache[i] = container;\n }\n container = null;\n if (placeholder) {\n removeElm(placeholder);\n }\n placeholder = null;\n if (icon) {\n removeElm(icon);\n }\n icon = null;\n if (iconImg) {\n removeElm(iconImg);\n }\n iconImg = null;\n }\n this.fltElms = [];\n this.fltSpans = [];\n this.fltIcons = [];\n\n // TODO: expose an API to handle external filter IDs\n this.tf.externalFltIds = [];\n\n // unsubscribe to events\n this.emitter.off(['before-filtering'], () => this.setIconsState());\n this.emitter.off(['after-filtering'], () => this.closeAll());\n this.emitter.off(['cell-processed'],\n (tf, cellIndex) => this.changeState(cellIndex, true));\n this.emitter.off(['filters-row-inserted'], () => this.buildIcons());\n this.emitter.off(['before-filter-init'],\n (tf, colIndex) => this.build(colIndex));\n\n this.initialized = false;\n }\n\n}\n",
@@ -12661,7 +12792,7 @@
"lineNumber": 1
},
{
- "__docId__": 704,
+ "__docId__": 705,
"kind": "class",
"name": "PopupFilter",
"memberof": "src/modules/popupFilter.js",
@@ -12685,7 +12816,7 @@
]
},
{
- "__docId__": 705,
+ "__docId__": 706,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12710,7 +12841,7 @@
]
},
{
- "__docId__": 706,
+ "__docId__": 707,
"kind": "member",
"name": "closeOnFiltering",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12729,7 +12860,7 @@
}
},
{
- "__docId__": 707,
+ "__docId__": 708,
"kind": "member",
"name": "iconPath",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12748,7 +12879,7 @@
}
},
{
- "__docId__": 708,
+ "__docId__": 709,
"kind": "member",
"name": "activeIconPath",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12767,7 +12898,7 @@
}
},
{
- "__docId__": 709,
+ "__docId__": 710,
"kind": "member",
"name": "iconHtml",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12786,7 +12917,7 @@
}
},
{
- "__docId__": 710,
+ "__docId__": 711,
"kind": "member",
"name": "placeholderCssClass",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12805,7 +12936,7 @@
}
},
{
- "__docId__": 711,
+ "__docId__": 712,
"kind": "member",
"name": "containerCssClass",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12824,7 +12955,7 @@
}
},
{
- "__docId__": 712,
+ "__docId__": 713,
"kind": "member",
"name": "adjustToContainer",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12843,7 +12974,7 @@
}
},
{
- "__docId__": 713,
+ "__docId__": 714,
"kind": "member",
"name": "onBeforeOpen",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12862,7 +12993,7 @@
}
},
{
- "__docId__": 714,
+ "__docId__": 715,
"kind": "member",
"name": "onAfterOpen",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12881,7 +13012,7 @@
}
},
{
- "__docId__": 715,
+ "__docId__": 716,
"kind": "member",
"name": "onBeforeClose",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12900,7 +13031,7 @@
}
},
{
- "__docId__": 716,
+ "__docId__": 717,
"kind": "member",
"name": "onAfterClose",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12919,7 +13050,7 @@
}
},
{
- "__docId__": 717,
+ "__docId__": 718,
"kind": "member",
"name": "fltSpans",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12935,10 +13066,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 718,
+ "__docId__": 719,
"kind": "member",
"name": "fltIcons",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12954,10 +13086,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 719,
+ "__docId__": 720,
"kind": "member",
"name": "filtersCache",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12973,10 +13106,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 720,
+ "__docId__": 721,
"kind": "member",
"name": "fltElms",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -12992,10 +13126,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 721,
+ "__docId__": 722,
"kind": "member",
"name": "prfxDiv",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13011,10 +13146,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 722,
+ "__docId__": 723,
"kind": "member",
"name": "activeFilterIdx",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13030,10 +13166,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 723,
+ "__docId__": 724,
"kind": "method",
"name": "onClick",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13044,28 +13181,7 @@
"access": "private",
"description": "Click event handler for pop-up filter icon",
"lineNumber": 145,
- "params": [
- {
- "name": "evt",
- "types": [
- "*"
- ]
- }
- ],
- "return": null
- },
- {
- "__docId__": 724,
- "kind": "method",
- "name": "onMouseup",
- "memberof": "src/modules/popupFilter.js~PopupFilter",
- "generator": false,
- "async": false,
- "static": false,
- "longname": "src/modules/popupFilter.js~PopupFilter#onMouseup",
- "access": "private",
- "description": "Mouse-up event handler handling popup filter auto-close behaviour",
- "lineNumber": 166,
+ "ignore": true,
"params": [
{
"name": "evt",
@@ -13079,6 +13195,29 @@
{
"__docId__": 725,
"kind": "method",
+ "name": "onMouseup",
+ "memberof": "src/modules/popupFilter.js~PopupFilter",
+ "generator": false,
+ "async": false,
+ "static": false,
+ "longname": "src/modules/popupFilter.js~PopupFilter#onMouseup",
+ "access": "private",
+ "description": "Mouse-up event handler handling popup filter auto-close behaviour",
+ "lineNumber": 166,
+ "ignore": true,
+ "params": [
+ {
+ "name": "evt",
+ "types": [
+ "*"
+ ]
+ }
+ ],
+ "return": null
+ },
+ {
+ "__docId__": 726,
+ "kind": "method",
"name": "init",
"memberof": "src/modules/popupFilter.js~PopupFilter",
"generator": false,
@@ -13092,7 +13231,7 @@
"return": null
},
{
- "__docId__": 726,
+ "__docId__": 727,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13114,7 +13253,7 @@
}
},
{
- "__docId__": 727,
+ "__docId__": 728,
"kind": "method",
"name": "reset",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13129,7 +13268,7 @@
"return": null
},
{
- "__docId__": 728,
+ "__docId__": 729,
"kind": "method",
"name": "buildIcons",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13144,7 +13283,7 @@
"return": null
},
{
- "__docId__": 729,
+ "__docId__": 730,
"kind": "method",
"name": "buildAll",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13159,7 +13298,7 @@
"return": null
},
{
- "__docId__": 730,
+ "__docId__": 731,
"kind": "method",
"name": "build",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13195,7 +13334,7 @@
"return": null
},
{
- "__docId__": 731,
+ "__docId__": 732,
"kind": "method",
"name": "toggle",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13221,7 +13360,7 @@
"return": null
},
{
- "__docId__": 732,
+ "__docId__": 733,
"kind": "method",
"name": "open",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13247,7 +13386,7 @@
"return": null
},
{
- "__docId__": 734,
+ "__docId__": 735,
"kind": "method",
"name": "close",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13273,7 +13412,7 @@
"return": null
},
{
- "__docId__": 736,
+ "__docId__": 737,
"kind": "method",
"name": "isOpen",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13312,7 +13451,7 @@
}
},
{
- "__docId__": 737,
+ "__docId__": 738,
"kind": "method",
"name": "closeAll",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13338,7 +13477,7 @@
"return": null
},
{
- "__docId__": 738,
+ "__docId__": 739,
"kind": "method",
"name": "setIconsState",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13353,7 +13492,7 @@
"return": null
},
{
- "__docId__": 739,
+ "__docId__": 740,
"kind": "method",
"name": "changeState",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13389,7 +13528,7 @@
"return": null
},
{
- "__docId__": 740,
+ "__docId__": 741,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/popupFilter.js~PopupFilter",
@@ -13404,7 +13543,7 @@
"return": null
},
{
- "__docId__": 746,
+ "__docId__": 747,
"kind": "file",
"name": "src/modules/rowsCounter.js",
"content": "import {Feature} from '../feature';\nimport {createElm, createText, elm, removeElm} from '../dom';\nimport {EMPTY_FN, isNull} from '../types';\nimport {defaultsStr, defaultsFn} from '../settings';\nimport {LEFT} from './toolbar';\n\n/**\n * Rows counter UI component\n * @export\n * @class RowsCounter\n * @extends {Feature}\n */\nexport class RowsCounter extends Feature {\n\n /**\n * Creates an instance of RowsCounter\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'rowsCounter');\n\n // TableFilter configuration\n let f = this.config.rows_counter || {};\n\n /**\n * ID of custom container element\n * @type {String}\n */\n this.targetId = defaultsStr(f.target_id, null);\n\n /**\n * Container DOM element\n * @type {DOMElement}\n * @private\n */\n this.container = null;\n\n /**\n * Container DOM element for label displaying the total number of rows\n * @type {DOMElement}\n * @private\n */\n this.label = null;\n\n /**\n * Text preceding the total number of rows\n * @type {String}\n */\n this.text = defaultsStr(f.text, 'Rows: ');\n\n /**\n * Separator symbol appearing between the first and last visible rows of\n * current page when paging is enabled. ie: Rows: 31-40 / 70\n * @type {String}\n */\n this.fromToTextSeparator = defaultsStr(f.separator, '-');\n\n /**\n * Separator symbol appearing between the first and last visible rows of\n * current page and the total number of filterable rows when paging is\n * enabled. ie: Rows: 31-40 / 70\n * @type {String}\n */\n this.overText = defaultsStr(f.over_text, ' / ');\n\n /**\n * Css class for container element\n * @type {String}\n */\n this.cssClass = defaultsStr(f.css_class, 'tot');\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, LEFT);\n\n /**\n * Callback fired before the counter is refreshed\n * @type {Function}\n */\n this.onBeforeRefreshCounter = defaultsFn(f.on_before_refresh_counter,\n EMPTY_FN);\n\n /**\n * Callback fired after the counter is refreshed\n * @type {Function}\n */\n this.onAfterRefreshCounter = defaultsFn(f.on_after_refresh_counter,\n EMPTY_FN);\n }\n\n /**\n * Initializes RowsCounter instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n this.emitter.emit('initializing-feature', this, !isNull(this.targetId));\n\n let tf = this.tf;\n\n //rows counter container\n let countDiv = createElm('div');\n countDiv.className = this.cssClass;\n //rows counter label\n let countSpan = createElm('span');\n let countText = createElm('span');\n countText.appendChild(createText(this.text));\n\n // counter is added to defined element\n let targetEl = !this.targetId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.targetId);\n\n //default container: 'lDiv'\n if (!this.targetId) {\n countDiv.appendChild(countText);\n countDiv.appendChild(countSpan);\n targetEl.appendChild(countDiv);\n } else {\n //custom container, no need to append statusDiv\n targetEl.appendChild(countText);\n targetEl.appendChild(countSpan);\n }\n this.container = countDiv;\n this.label = countSpan;\n\n // subscribe to events\n this.emitter.on(['after-filtering', 'grouped-by-page'],\n () => this.refresh(tf.getValidRowsNb()));\n this.emitter.on(['rows-changed'], () => this.refresh());\n\n /** @inherited */\n this.initialized = true;\n this.refresh();\n\n this.emitter.emit('feature-initialized', this);\n }\n\n /**\n * Refreshes the rows counter\n * @param {Number} p Optional parameter the total number of rows to display\n */\n refresh(p) {\n if (!this.initialized || !this.isEnabled()) {\n return;\n }\n\n let tf = this.tf;\n\n this.onBeforeRefreshCounter(tf, this.label);\n\n let totTxt;\n if (!tf.paging) {\n if (p && p !== '') {\n totTxt = p;\n } else {\n totTxt = tf.getFilterableRowsNb() - tf.nbHiddenRows;\n }\n } else {\n let paging = tf.feature('paging');\n if (paging) {\n let nbValidRows = tf.getValidRowsNb();\n //paging start row\n let pagingStartRow = parseInt(paging.startPagingRow, 10) +\n ((nbValidRows > 0) ? 1 : 0);\n let pagingEndRow =\n (pagingStartRow + paging.pageLength) - 1 <=\n nbValidRows ?\n pagingStartRow + paging.pageLength - 1 :\n nbValidRows;\n totTxt = pagingStartRow + this.fromToTextSeparator +\n pagingEndRow + this.overText + nbValidRows;\n }\n }\n\n this.label.innerHTML = totTxt;\n this.onAfterRefreshCounter(tf, this.label, totTxt);\n }\n\n /**\n * Remove feature\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n if (!this.targetId && this.container) {\n removeElm(this.container);\n } else {\n elm(this.targetId).innerHTML = '';\n }\n this.label = null;\n this.container = null;\n\n // unsubscribe to events\n this.emitter.off(['after-filtering', 'grouped-by-page'],\n () => this.refresh(tf.getValidRowsNb()));\n this.emitter.off(['rows-changed'], () => this.refresh());\n\n this.initialized = false;\n }\n}\n",
@@ -13415,7 +13554,7 @@
"lineNumber": 1
},
{
- "__docId__": 747,
+ "__docId__": 748,
"kind": "class",
"name": "RowsCounter",
"memberof": "src/modules/rowsCounter.js",
@@ -13439,7 +13578,7 @@
]
},
{
- "__docId__": 748,
+ "__docId__": 749,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13464,7 +13603,7 @@
]
},
{
- "__docId__": 749,
+ "__docId__": 750,
"kind": "member",
"name": "targetId",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13483,7 +13622,7 @@
}
},
{
- "__docId__": 750,
+ "__docId__": 751,
"kind": "member",
"name": "container",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13499,10 +13638,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 751,
+ "__docId__": 752,
"kind": "member",
"name": "label",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13518,10 +13658,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 752,
+ "__docId__": 753,
"kind": "member",
"name": "text",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13540,7 +13681,7 @@
}
},
{
- "__docId__": 753,
+ "__docId__": 754,
"kind": "member",
"name": "fromToTextSeparator",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13559,7 +13700,7 @@
}
},
{
- "__docId__": 754,
+ "__docId__": 755,
"kind": "member",
"name": "overText",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13578,7 +13719,7 @@
}
},
{
- "__docId__": 755,
+ "__docId__": 756,
"kind": "member",
"name": "cssClass",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13597,7 +13738,7 @@
}
},
{
- "__docId__": 756,
+ "__docId__": 757,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13616,7 +13757,7 @@
}
},
{
- "__docId__": 757,
+ "__docId__": 758,
"kind": "member",
"name": "onBeforeRefreshCounter",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13635,7 +13776,7 @@
}
},
{
- "__docId__": 758,
+ "__docId__": 759,
"kind": "member",
"name": "onAfterRefreshCounter",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13654,7 +13795,7 @@
}
},
{
- "__docId__": 759,
+ "__docId__": 760,
"kind": "method",
"name": "init",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13669,7 +13810,7 @@
"return": null
},
{
- "__docId__": 762,
+ "__docId__": 763,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13691,7 +13832,7 @@
}
},
{
- "__docId__": 763,
+ "__docId__": 764,
"kind": "method",
"name": "refresh",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13717,7 +13858,7 @@
"return": null
},
{
- "__docId__": 764,
+ "__docId__": 765,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/rowsCounter.js~RowsCounter",
@@ -13732,7 +13873,7 @@
"return": null
},
{
- "__docId__": 768,
+ "__docId__": 769,
"kind": "file",
"name": "src/modules/state.js",
"content": "import {Feature} from '../feature';\nimport {Hash} from './hash';\nimport {Storage} from './storage';\nimport {isEmpty} from '../string';\nimport {isArray, isNull, isString, isUndef} from '../types';\nimport {defaultsBool, defaultsNb} from '../settings';\n\n/**\n * Features state object persistable with localStorage, cookie or URL hash\n *\n * @export\n * @class State\n * @extends {Feature}\n */\nexport class State extends Feature {\n\n /**\n * Creates an instance of State\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'state');\n\n let cfg = this.config.state || {};\n\n /**\n * Determines whether state is persisted with URL hash\n * @type {Boolean}\n */\n this.enableHash = cfg === true ||\n (isArray(cfg.types) && cfg.types.indexOf('hash') !== -1);\n\n /**\n * Determines whether state is persisted with localStorage\n * @type {Boolean}\n */\n this.enableLocalStorage = isArray(cfg.types) &&\n cfg.types.indexOf('local_storage') !== -1;\n\n /**\n * Determines whether state is persisted with localStorage\n * @type {Boolean}\n */\n this.enableCookie = isArray(cfg.types) &&\n cfg.types.indexOf('cookie') !== -1;\n\n /**\n * Persist filters values, enabled by default\n * @type {Boolean}\n */\n this.persistFilters = defaultsBool(cfg.filters, true);\n\n /**\n * Persist current page number when paging is enabled\n * @type {Boolean}\n */\n this.persistPageNumber = Boolean(cfg.page_number);\n\n /**\n * Persist page length when paging is enabled\n * @type {Boolean}\n */\n this.persistPageLength = Boolean(cfg.page_length);\n\n /**\n * Persist column sorting\n * @type {Boolean}\n */\n this.persistSort = Boolean(cfg.sort);\n\n /**\n * Persist columns visibility\n * @type {Boolean}\n */\n this.persistColsVisibility = Boolean(cfg.columns_visibility);\n\n /**\n * Persist filters row visibility\n * @type {Boolean}\n */\n this.persistFiltersVisibility = Boolean(cfg.filters_visibility);\n\n /**\n * Cookie duration in hours\n * @type {Boolean}\n */\n this.cookieDuration = defaultsNb(parseInt(cfg.cookie_duration, 10),\n 87600);\n\n /**\n * Enable Storage if localStorage or cookie is required\n * @type {Boolean}\n * @private\n */\n this.enableStorage = this.enableLocalStorage || this.enableCookie;\n\n /**\n * Storage instance if storage is required\n * @type {Storage}\n * @private\n */\n this.storage = null;\n\n /**\n * Hash instance if URL hash is required\n * @type {Boolean}\n * @private\n */\n this.hash = null;\n\n /**\n * Current page number\n * @type {Number}\n * @private\n */\n this.pageNb = null;\n\n /**\n * Current page length\n * @type {Number}\n * @private\n */\n this.pageLength = null;\n\n /**\n * Current column sorting\n * @type {Object}\n * @private\n */\n this.sort = null;\n\n /**\n * Current hidden columns\n * @type {Object}\n * @private\n */\n this.hiddenCols = null;\n\n /**\n * Filters row visibility\n * @type {Boolean}\n * @private\n */\n this.filtersVisibility = null;\n\n /**\n * State object\n * @type {Object}\n * @private\n */\n this.state = {};\n\n /**\n * Prefix for column ID\n * @type {String}\n * @private\n */\n this.prfxCol = 'col_';\n\n /**\n * Prefix for page number ID\n * @type {String}\n * @private\n */\n this.pageNbKey = 'page';\n\n /**\n * Prefix for page length ID\n * @type {String}\n * @private\n */\n this.pageLengthKey = 'page_length';\n\n /**\n * Prefix for filters visibility ID\n * @type {String}\n * @private\n */\n this.filtersVisKey = 'filters_visibility';\n }\n\n /**\n * Initializes State instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n this.emitter.on(['after-filtering'], () => this.update());\n this.emitter.on(['after-page-change', 'after-clearing-filters'],\n (tf, pageNb) => this.updatePage(pageNb));\n this.emitter.on(['after-page-length-change'],\n (tf, pageLength) => this.updatePageLength(pageLength));\n this.emitter.on(['column-sorted'],\n (tf, index, descending) => this.updateSort(index, descending));\n this.emitter.on(['sort-initialized'], () => this._syncSort());\n this.emitter.on(['columns-visibility-initialized'],\n () => this._syncColsVisibility());\n this.emitter.on(['column-shown', 'column-hidden'], (tf, feature,\n colIndex, hiddenCols) => this.updateColsVisibility(hiddenCols));\n this.emitter.on(['filters-visibility-initialized'],\n () => this._syncFiltersVisibility());\n this.emitter.on(['filters-toggled'],\n (tf, extension, visible) => this.updateFiltersVisibility(visible));\n\n if (this.enableHash) {\n this.hash = new Hash(this);\n this.hash.init();\n }\n if (this.enableStorage) {\n this.storage = new Storage(this);\n this.storage.init();\n }\n\n /** @inherited */\n this.initialized = true;\n }\n\n\n /**\n * Update state object based on current features state\n */\n update() {\n if (!this.isEnabled()) {\n return;\n }\n let state = this.state;\n let tf = this.tf;\n\n if (this.persistFilters) {\n let filterValues = tf.getFiltersValue();\n\n filterValues.forEach((val, idx) => {\n let key = `${this.prfxCol}${idx}`;\n\n if (isString(val) && isEmpty(val)) {\n if (state.hasOwnProperty(key)) {\n state[key].flt = undefined;\n }\n } else {\n state[key] = state[key] || {};\n state[key].flt = val;\n }\n });\n }\n\n if (this.persistPageNumber) {\n if (isNull(this.pageNb)) {\n state[this.pageNbKey] = undefined;\n } else {\n state[this.pageNbKey] = this.pageNb;\n }\n }\n\n if (this.persistPageLength) {\n if (isNull(this.pageLength)) {\n state[this.pageLengthKey] = undefined;\n } else {\n state[this.pageLengthKey] = this.pageLength;\n }\n }\n\n if (this.persistSort) {\n if (!isNull(this.sort)) {\n // Remove previuosly sorted column\n Object.keys(state).forEach((key) => {\n if (key.indexOf(this.prfxCol) !== -1 && state[key]) {\n state[key].sort = undefined;\n }\n });\n\n let key = `${this.prfxCol}${this.sort.column}`;\n state[key] = state[key] || {};\n state[key].sort = { descending: this.sort.descending };\n }\n }\n\n if (this.persistColsVisibility) {\n if (!isNull(this.hiddenCols)) {\n // Clear previuosly hidden columns\n Object.keys(state).forEach((key) => {\n if (key.indexOf(this.prfxCol) !== -1 && state[key]) {\n state[key].hidden = undefined;\n }\n });\n\n this.hiddenCols.forEach((colIdx) => {\n let key = `${this.prfxCol}${colIdx}`;\n state[key] = state[key] || {};\n state[key].hidden = true;\n });\n }\n }\n\n if (this.persistFiltersVisibility) {\n if (isNull(this.filtersVisibility)) {\n state[this.filtersVisKey] = undefined;\n } else {\n state[this.filtersVisKey] = this.filtersVisibility;\n }\n }\n\n this.emitter.emit('state-changed', tf, state);\n }\n\n /**\n * Refresh page number field on page number changes\n *\n * @param {Number} pageNb Current page number\n */\n updatePage(pageNb) {\n this.pageNb = pageNb;\n this.update();\n }\n\n /**\n * Refresh page length field on page length changes\n *\n * @param {Number} pageLength Current page length value\n */\n updatePageLength(pageLength) {\n this.pageLength = pageLength;\n this.update();\n }\n\n /**\n * Refresh column sorting information on sort changes\n *\n * @param index {Number} Column index\n * @param {Boolean} descending Descending manner\n */\n updateSort(index, descending) {\n this.sort = {\n column: index,\n descending: descending\n };\n this.update();\n }\n\n /**\n * Refresh hidden columns information on columns visibility changes\n *\n * @param {Array} hiddenCols Columns indexes\n */\n updateColsVisibility(hiddenCols) {\n this.hiddenCols = hiddenCols;\n this.update();\n }\n\n /**\n * Refresh filters visibility on filters visibility change\n *\n * @param {Boolean} visible Visibility flad\n */\n updateFiltersVisibility(visible) {\n this.filtersVisibility = visible;\n this.update();\n }\n\n /**\n * Override state field\n *\n * @param state State object\n */\n override(state) {\n this.state = state;\n this.emitter.emit('state-changed', this.tf, state);\n }\n\n /**\n * Sync stored features state\n */\n sync() {\n let state = this.state;\n let tf = this.tf;\n\n this._syncFilters();\n\n if (this.persistPageNumber) {\n let pageNumber = state[this.pageNbKey];\n this.emitter.emit('change-page', tf, pageNumber);\n }\n\n if (this.persistPageLength) {\n let pageLength = state[this.pageLengthKey];\n this.emitter.emit('change-page-results', tf, pageLength);\n }\n\n this._syncSort();\n this._syncColsVisibility();\n this._syncFiltersVisibility();\n }\n\n /**\n * Override current state with passed one and sync features\n *\n * @param {Object} state State object\n */\n overrideAndSync(state) {\n // To prevent state to react to features changes, state is temporarily\n // disabled\n this.disable();\n // State is overriden with passed state object\n this.override(state);\n // New hash state is applied to features\n this.sync();\n // State is re-enabled\n this.enable();\n }\n\n /**\n * Sync filters with stored values and filter table\n *\n * @private\n */\n _syncFilters() {\n if (!this.persistFilters) {\n return;\n }\n let state = this.state;\n let tf = this.tf;\n\n // clear all filters\n // TODO: use tf.clearFilters() once it allows to not filter the table\n tf.eachCol((colIdx) => tf.setFilterValue(colIdx, ''));\n\n Object.keys(state).forEach((key) => {\n if (key.indexOf(this.prfxCol) !== -1) {\n let colIdx = parseInt(key.replace(this.prfxCol, ''), 10);\n let val = state[key].flt;\n tf.setFilterValue(colIdx, val);\n }\n });\n\n tf.filter();\n }\n\n /**\n * Sync sorted column with stored sorting information and sort table\n *\n * @private\n */\n _syncSort() {\n if (!this.persistSort) {\n return;\n }\n let state = this.state;\n let tf = this.tf;\n\n Object.keys(state).forEach((key) => {\n if (key.indexOf(this.prfxCol) !== -1) {\n let colIdx = parseInt(key.replace(this.prfxCol, ''), 10);\n if (!isUndef(state[key].sort)) {\n let sort = state[key].sort;\n this.emitter.emit('sort', tf, colIdx, sort.descending);\n }\n }\n });\n }\n\n /**\n * Sync hidden columns with stored information\n *\n * @private\n */\n _syncColsVisibility() {\n if (!this.persistColsVisibility) {\n return;\n }\n let state = this.state;\n let tf = this.tf;\n let hiddenCols = [];\n\n Object.keys(state).forEach((key) => {\n if (key.indexOf(this.prfxCol) !== -1) {\n let colIdx = parseInt(key.replace(this.prfxCol, ''), 10);\n if (!isUndef(state[key].hidden)) {\n hiddenCols.push(colIdx);\n }\n }\n });\n\n hiddenCols.forEach((colIdx) => {\n this.emitter.emit('hide-column', tf, colIdx);\n });\n }\n\n /**\n * Sync filters visibility with stored information\n *\n * @private\n */\n _syncFiltersVisibility() {\n if (!this.persistFiltersVisibility) {\n return;\n }\n let state = this.state;\n let tf = this.tf;\n let filtersVisibility = state[this.filtersVisKey];\n\n this.filtersVisibility = filtersVisibility;\n this.emitter.emit('show-filters', tf, filtersVisibility);\n }\n\n /**\n * Destroy State instance\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n this.state = {};\n\n this.emitter.off(['after-filtering'], () => this.update());\n this.emitter.off(['after-page-change', 'after-clearing-filters'],\n (tf, pageNb) => this.updatePage(pageNb));\n this.emitter.off(['after-page-length-change'],\n (tf, index) => this.updatePageLength(index));\n this.emitter.off(['column-sorted'],\n (tf, index, descending) => this.updateSort(index, descending));\n this.emitter.off(['sort-initialized'], () => this._syncSort());\n this.emitter.off(['columns-visibility-initialized'],\n () => this._syncColsVisibility());\n this.emitter.off(['column-shown', 'column-hidden'], (tf, feature,\n colIndex, hiddenCols) => this.updateColsVisibility(hiddenCols));\n this.emitter.off(['filters-visibility-initialized'],\n () => this._syncFiltersVisibility());\n this.emitter.off(['filters-toggled'],\n (tf, extension, visible) => this.updateFiltersVisibility(visible));\n\n if (this.enableHash) {\n this.hash.destroy();\n this.hash = null;\n }\n\n if (this.enableStorage) {\n this.storage.destroy();\n this.storage = null;\n }\n\n this.initialized = false;\n }\n}\n",
@@ -13743,7 +13884,7 @@
"lineNumber": 1
},
{
- "__docId__": 769,
+ "__docId__": 770,
"kind": "class",
"name": "State",
"memberof": "src/modules/state.js",
@@ -13767,7 +13908,7 @@
]
},
{
- "__docId__": 770,
+ "__docId__": 771,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/state.js~State",
@@ -13792,7 +13933,7 @@
]
},
{
- "__docId__": 771,
+ "__docId__": 772,
"kind": "member",
"name": "enableHash",
"memberof": "src/modules/state.js~State",
@@ -13811,7 +13952,7 @@
}
},
{
- "__docId__": 772,
+ "__docId__": 773,
"kind": "member",
"name": "enableLocalStorage",
"memberof": "src/modules/state.js~State",
@@ -13830,7 +13971,7 @@
}
},
{
- "__docId__": 773,
+ "__docId__": 774,
"kind": "member",
"name": "enableCookie",
"memberof": "src/modules/state.js~State",
@@ -13849,7 +13990,7 @@
}
},
{
- "__docId__": 774,
+ "__docId__": 775,
"kind": "member",
"name": "persistFilters",
"memberof": "src/modules/state.js~State",
@@ -13868,7 +14009,7 @@
}
},
{
- "__docId__": 775,
+ "__docId__": 776,
"kind": "member",
"name": "persistPageNumber",
"memberof": "src/modules/state.js~State",
@@ -13887,7 +14028,7 @@
}
},
{
- "__docId__": 776,
+ "__docId__": 777,
"kind": "member",
"name": "persistPageLength",
"memberof": "src/modules/state.js~State",
@@ -13906,7 +14047,7 @@
}
},
{
- "__docId__": 777,
+ "__docId__": 778,
"kind": "member",
"name": "persistSort",
"memberof": "src/modules/state.js~State",
@@ -13925,7 +14066,7 @@
}
},
{
- "__docId__": 778,
+ "__docId__": 779,
"kind": "member",
"name": "persistColsVisibility",
"memberof": "src/modules/state.js~State",
@@ -13944,7 +14085,7 @@
}
},
{
- "__docId__": 779,
+ "__docId__": 780,
"kind": "member",
"name": "persistFiltersVisibility",
"memberof": "src/modules/state.js~State",
@@ -13963,7 +14104,7 @@
}
},
{
- "__docId__": 780,
+ "__docId__": 781,
"kind": "member",
"name": "cookieDuration",
"memberof": "src/modules/state.js~State",
@@ -13982,7 +14123,7 @@
}
},
{
- "__docId__": 781,
+ "__docId__": 782,
"kind": "member",
"name": "enableStorage",
"memberof": "src/modules/state.js~State",
@@ -13998,10 +14139,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 782,
+ "__docId__": 783,
"kind": "member",
"name": "storage",
"memberof": "src/modules/state.js~State",
@@ -14017,10 +14159,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 783,
+ "__docId__": 784,
"kind": "member",
"name": "hash",
"memberof": "src/modules/state.js~State",
@@ -14036,10 +14179,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 784,
+ "__docId__": 785,
"kind": "member",
"name": "pageNb",
"memberof": "src/modules/state.js~State",
@@ -14055,10 +14199,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 785,
+ "__docId__": 786,
"kind": "member",
"name": "pageLength",
"memberof": "src/modules/state.js~State",
@@ -14074,10 +14219,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 786,
+ "__docId__": 787,
"kind": "member",
"name": "sort",
"memberof": "src/modules/state.js~State",
@@ -14093,10 +14239,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 787,
+ "__docId__": 788,
"kind": "member",
"name": "hiddenCols",
"memberof": "src/modules/state.js~State",
@@ -14112,10 +14259,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 788,
+ "__docId__": 789,
"kind": "member",
"name": "filtersVisibility",
"memberof": "src/modules/state.js~State",
@@ -14131,10 +14279,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 789,
+ "__docId__": 790,
"kind": "member",
"name": "state",
"memberof": "src/modules/state.js~State",
@@ -14150,10 +14299,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 790,
+ "__docId__": 791,
"kind": "member",
"name": "prfxCol",
"memberof": "src/modules/state.js~State",
@@ -14169,10 +14319,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 791,
+ "__docId__": 792,
"kind": "member",
"name": "pageNbKey",
"memberof": "src/modules/state.js~State",
@@ -14188,10 +14339,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 792,
+ "__docId__": 793,
"kind": "member",
"name": "pageLengthKey",
"memberof": "src/modules/state.js~State",
@@ -14207,10 +14359,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 793,
+ "__docId__": 794,
"kind": "member",
"name": "filtersVisKey",
"memberof": "src/modules/state.js~State",
@@ -14226,10 +14379,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 794,
+ "__docId__": 795,
"kind": "method",
"name": "init",
"memberof": "src/modules/state.js~State",
@@ -14244,7 +14398,7 @@
"return": null
},
{
- "__docId__": 797,
+ "__docId__": 798,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/state.js~State",
@@ -14266,7 +14420,7 @@
}
},
{
- "__docId__": 798,
+ "__docId__": 799,
"kind": "method",
"name": "update",
"memberof": "src/modules/state.js~State",
@@ -14281,7 +14435,7 @@
"return": null
},
{
- "__docId__": 799,
+ "__docId__": 800,
"kind": "method",
"name": "updatePage",
"memberof": "src/modules/state.js~State",
@@ -14307,7 +14461,7 @@
"return": null
},
{
- "__docId__": 801,
+ "__docId__": 802,
"kind": "method",
"name": "updatePageLength",
"memberof": "src/modules/state.js~State",
@@ -14333,7 +14487,7 @@
"return": null
},
{
- "__docId__": 803,
+ "__docId__": 804,
"kind": "method",
"name": "updateSort",
"memberof": "src/modules/state.js~State",
@@ -14369,7 +14523,7 @@
"return": null
},
{
- "__docId__": 805,
+ "__docId__": 806,
"kind": "method",
"name": "updateColsVisibility",
"memberof": "src/modules/state.js~State",
@@ -14395,7 +14549,7 @@
"return": null
},
{
- "__docId__": 807,
+ "__docId__": 808,
"kind": "method",
"name": "updateFiltersVisibility",
"memberof": "src/modules/state.js~State",
@@ -14421,7 +14575,7 @@
"return": null
},
{
- "__docId__": 809,
+ "__docId__": 810,
"kind": "method",
"name": "override",
"memberof": "src/modules/state.js~State",
@@ -14447,7 +14601,7 @@
"return": null
},
{
- "__docId__": 811,
+ "__docId__": 812,
"kind": "method",
"name": "sync",
"memberof": "src/modules/state.js~State",
@@ -14462,7 +14616,7 @@
"return": null
},
{
- "__docId__": 812,
+ "__docId__": 813,
"kind": "method",
"name": "overrideAndSync",
"memberof": "src/modules/state.js~State",
@@ -14488,7 +14642,7 @@
"return": null
},
{
- "__docId__": 813,
+ "__docId__": 814,
"kind": "method",
"name": "_syncFilters",
"memberof": "src/modules/state.js~State",
@@ -14499,11 +14653,12 @@
"access": "private",
"description": "Sync filters with stored values and filter table",
"lineNumber": 417,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 814,
+ "__docId__": 815,
"kind": "method",
"name": "_syncSort",
"memberof": "src/modules/state.js~State",
@@ -14514,11 +14669,12 @@
"access": "private",
"description": "Sync sorted column with stored sorting information and sort table",
"lineNumber": 444,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 815,
+ "__docId__": 816,
"kind": "method",
"name": "_syncColsVisibility",
"memberof": "src/modules/state.js~State",
@@ -14529,11 +14685,12 @@
"access": "private",
"description": "Sync hidden columns with stored information",
"lineNumber": 467,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 816,
+ "__docId__": 817,
"kind": "method",
"name": "_syncFiltersVisibility",
"memberof": "src/modules/state.js~State",
@@ -14544,11 +14701,12 @@
"access": "private",
"description": "Sync filters visibility with stored information",
"lineNumber": 494,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 818,
+ "__docId__": 819,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/state.js~State",
@@ -14563,7 +14721,7 @@
"return": null
},
{
- "__docId__": 823,
+ "__docId__": 824,
"kind": "file",
"name": "src/modules/statusBar.js",
"content": "import {Feature} from '../feature';\nimport {root} from '../root';\nimport {createElm, createText, elm, removeElm} from '../dom';\nimport {EMPTY_FN, isNull} from '../types';\nimport {defaultsStr, defaultsFn} from '../settings';\nimport {LEFT} from './toolbar';\n\nconst EVENTS = [\n 'after-filtering',\n 'after-populating-filter',\n 'after-page-change',\n 'after-clearing-filters',\n 'after-page-length-change',\n 'after-reset-page',\n 'after-reset-page-length',\n 'after-loading-extensions',\n 'after-loading-themes'\n];\n\n/**\n * Status bar UI component\n * @export\n * @class StatusBar\n * @extends {Feature}\n */\nexport class StatusBar extends Feature {\n\n /**\n * Creates an instance of StatusBar\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'statusBar');\n\n // Configuration object\n let f = this.config.status_bar || {};\n\n /**\n * ID of custom container element\n * @type {String}\n */\n this.targetId = defaultsStr(f.target_id, null);\n\n /**\n * Container DOM element\n * @type {DOMElement}\n * @private\n */\n this.container = null;\n\n /**\n * Message container DOM element\n * @type {DOMElement}\n * @private\n */\n this.msgContainer = null;\n\n /**\n * Label container DOM element\n * @type {DOMElement}\n * @private\n */\n this.labelContainer = null;\n\n /**\n * Text preceding status message\n * @type {String}\n */\n this.text = defaultsStr(f.text, '');\n\n /**\n * Css class for container element\n * @type {String}\n */\n this.cssClass = defaultsStr(f.css_class, 'status');\n\n /**\n * Message visibility duration in milliseconds\n * @type {Number}\n * @private\n */\n this.delay = 250;\n\n /**\n * Callback fired before the message is displayed\n * @type {Function}\n */\n this.onBeforeShowMsg = defaultsFn(f.on_before_show_msg, EMPTY_FN);\n\n /**\n * Callback fired after the message is displayed\n * @type {Function}\n */\n this.onAfterShowMsg = defaultsFn(f.on_after_show_msg, EMPTY_FN);\n\n /**\n * Message appearing upon filtering\n * @type {String}\n */\n this.msgFilter = defaultsStr(f.msg_filter, 'Filtering data...');\n\n /**\n * Message appearing when a drop-down filter is populated\n * @type {String}\n */\n this.msgPopulate = defaultsStr(f.msg_populate, 'Populating filter...');\n\n /**\n * Message appearing when a checklist filter is populated\n * @type {String}\n */\n this.msgPopulateCheckList = defaultsStr(f.msg_populate_checklist,\n 'Populating list...');\n\n /**\n * Message appearing when a pagination page is changed\n * @type {String}\n */\n this.msgChangePage = defaultsStr(f.msg_change_page,\n 'Collecting paging data...');\n\n /**\n * Message appearing when filters are cleared\n * @type {String}\n */\n this.msgClear = defaultsStr(f.msg_clear, 'Clearing filters...');\n\n /**\n * Message appearing when the page length is changed\n * @type {String}\n */\n this.msgChangeResults = defaultsStr(f.msg_change_results,\n 'Changing results per page...');\n\n /**\n * Message appearing when the page is re-set\n * @type {String}\n */\n this.msgResetPage = defaultsStr(f.msg_reset_page, 'Re-setting page...');\n\n /**\n * Message appearing when the page length is re-set\n * @type {String}\n */\n this.msgResetPageLength = defaultsStr(f.msg_reset_page_length,\n 'Re-setting page length...');\n\n /**\n * Message appearing upon column sorting\n * @type {String}\n */\n this.msgSort = defaultsStr(f.msg_sort, 'Sorting data...');\n\n /**\n * Message appearing when extensions are loading\n * @type {String}\n */\n this.msgLoadExtensions = defaultsStr(f.msg_load_extensions,\n 'Loading extensions...');\n\n /**\n * Message appearing when themes are loading\n * @type {String}\n */\n this.msgLoadThemes = defaultsStr(f.msg_load_themes,\n 'Loading theme(s)...');\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, LEFT);\n }\n\n /**\n * Initializes StatusBar instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n let tf = this.tf;\n let emitter = this.emitter;\n\n emitter.emit('initializing-feature', this, !isNull(this.targetId));\n\n // status bar container\n let statusDiv = createElm('div');\n statusDiv.className = this.cssClass;\n\n // status bar label\n let statusSpan = createElm('span');\n // preceding text\n let statusSpanText = createElm('span');\n statusSpanText.appendChild(createText(this.text));\n\n // target element container\n let targetEl = (!this.targetId) ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.targetId);\n\n // default container\n if (!this.targetId) {\n statusDiv.appendChild(statusSpanText);\n statusDiv.appendChild(statusSpan);\n targetEl.appendChild(statusDiv);\n } else {\n // custom container, no need to append statusDiv\n targetEl.appendChild(statusSpanText);\n targetEl.appendChild(statusSpan);\n }\n\n this.container = statusDiv;\n this.msgContainer = statusSpan;\n this.labelContainer = statusSpanText;\n\n // subscribe to events\n emitter.on(['before-filtering'], () => this.message(this.msgFilter));\n emitter.on(['before-populating-filter'],\n () => this.message(this.msgPopulate));\n emitter.on(['before-page-change'],\n () => this.message(this.msgChangePage));\n emitter.on(['before-clearing-filters'], () =>\n this.message(this.msgClear));\n emitter.on(['before-page-length-change'],\n () => this.message(this.msgChangeResults));\n emitter.on(['before-reset-page'],\n () => this.message(this.msgResetPage));\n emitter.on(['before-reset-page-length'],\n () => this.message(this.msgResetPageLength));\n emitter.on(['before-loading-extensions'],\n () => this.message(this.msgLoadExtensions));\n emitter.on(['before-loading-themes'],\n () => this.message(this.msgLoadThemes));\n\n emitter.on(EVENTS, () => this.message(''));\n\n /** @inherited */\n this.initialized = true;\n\n emitter.emit('feature-initialized', this);\n }\n\n /**\n * Display status message\n * @param {String} [t=''] Message to be displayed\n */\n message(t = '') {\n if (!this.isEnabled()) {\n return;\n }\n\n this.onBeforeShowMsg(this.tf, t);\n\n let d = t === '' ? this.delay : 1;\n root.setTimeout(() => {\n if (!this.initialized) {\n return;\n }\n this.msgContainer.innerHTML = t;\n\n this.onAfterShowMsg(this.tf, t);\n }, d);\n }\n\n /**\n * Destroy StatusBar instance\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n let emitter = this.emitter;\n\n this.container.innerHTML = '';\n if (!this.targetId) {\n removeElm(this.container);\n }\n this.labelContainer = null;\n this.msgContainer = null;\n this.container = null;\n\n // Unsubscribe to events\n emitter.off(['before-filtering'], () => this.message(this.msgFilter));\n emitter.off(['before-populating-filter'],\n () => this.message(this.msgPopulate));\n emitter.off(['before-page-change'],\n () => this.message(this.msgChangePage));\n emitter.off(['before-clearing-filters'],\n () => this.message(this.msgClear));\n emitter.off(['before-page-length-change'],\n () => this.message(this.msgChangeResults));\n emitter.off(['before-reset-page'], () =>\n this.message(this.msgResetPage));\n emitter.off(['before-reset-page-length'],\n () => this.message(this.msgResetPageLength));\n emitter.off(['before-loading-extensions'],\n () => this.message(this.msgLoadExtensions));\n emitter.off(['before-loading-themes'],\n () => this.message(this.msgLoadThemes));\n\n emitter.off(EVENTS, () => this.message(''));\n\n this.initialized = false;\n }\n}\n",
@@ -14574,7 +14732,7 @@
"lineNumber": 1
},
{
- "__docId__": 824,
+ "__docId__": 825,
"kind": "variable",
"name": "EVENTS",
"memberof": "src/modules/statusBar.js",
@@ -14595,7 +14753,7 @@
"ignore": true
},
{
- "__docId__": 825,
+ "__docId__": 826,
"kind": "class",
"name": "StatusBar",
"memberof": "src/modules/statusBar.js",
@@ -14619,7 +14777,7 @@
]
},
{
- "__docId__": 826,
+ "__docId__": 827,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14644,7 +14802,7 @@
]
},
{
- "__docId__": 827,
+ "__docId__": 828,
"kind": "member",
"name": "targetId",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14663,7 +14821,7 @@
}
},
{
- "__docId__": 828,
+ "__docId__": 829,
"kind": "member",
"name": "container",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14679,10 +14837,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 829,
+ "__docId__": 830,
"kind": "member",
"name": "msgContainer",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14698,10 +14857,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 830,
+ "__docId__": 831,
"kind": "member",
"name": "labelContainer",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14717,10 +14877,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 831,
+ "__docId__": 832,
"kind": "member",
"name": "text",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14739,7 +14900,7 @@
}
},
{
- "__docId__": 832,
+ "__docId__": 833,
"kind": "member",
"name": "cssClass",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14758,7 +14919,7 @@
}
},
{
- "__docId__": 833,
+ "__docId__": 834,
"kind": "member",
"name": "delay",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14774,10 +14935,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 834,
+ "__docId__": 835,
"kind": "member",
"name": "onBeforeShowMsg",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14796,7 +14958,7 @@
}
},
{
- "__docId__": 835,
+ "__docId__": 836,
"kind": "member",
"name": "onAfterShowMsg",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14815,7 +14977,7 @@
}
},
{
- "__docId__": 836,
+ "__docId__": 837,
"kind": "member",
"name": "msgFilter",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14834,7 +14996,7 @@
}
},
{
- "__docId__": 837,
+ "__docId__": 838,
"kind": "member",
"name": "msgPopulate",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14853,7 +15015,7 @@
}
},
{
- "__docId__": 838,
+ "__docId__": 839,
"kind": "member",
"name": "msgPopulateCheckList",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14872,7 +15034,7 @@
}
},
{
- "__docId__": 839,
+ "__docId__": 840,
"kind": "member",
"name": "msgChangePage",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14891,7 +15053,7 @@
}
},
{
- "__docId__": 840,
+ "__docId__": 841,
"kind": "member",
"name": "msgClear",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14910,7 +15072,7 @@
}
},
{
- "__docId__": 841,
+ "__docId__": 842,
"kind": "member",
"name": "msgChangeResults",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14929,7 +15091,7 @@
}
},
{
- "__docId__": 842,
+ "__docId__": 843,
"kind": "member",
"name": "msgResetPage",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14948,7 +15110,7 @@
}
},
{
- "__docId__": 843,
+ "__docId__": 844,
"kind": "member",
"name": "msgResetPageLength",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14967,7 +15129,7 @@
}
},
{
- "__docId__": 844,
+ "__docId__": 845,
"kind": "member",
"name": "msgSort",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -14986,7 +15148,7 @@
}
},
{
- "__docId__": 845,
+ "__docId__": 846,
"kind": "member",
"name": "msgLoadExtensions",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -15005,7 +15167,7 @@
}
},
{
- "__docId__": 846,
+ "__docId__": 847,
"kind": "member",
"name": "msgLoadThemes",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -15024,7 +15186,7 @@
}
},
{
- "__docId__": 847,
+ "__docId__": 848,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -15043,7 +15205,7 @@
}
},
{
- "__docId__": 848,
+ "__docId__": 849,
"kind": "method",
"name": "init",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -15058,7 +15220,7 @@
"return": null
},
{
- "__docId__": 852,
+ "__docId__": 853,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -15080,7 +15242,7 @@
}
},
{
- "__docId__": 853,
+ "__docId__": 854,
"kind": "method",
"name": "message",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -15108,7 +15270,7 @@
"return": null
},
{
- "__docId__": 854,
+ "__docId__": 855,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/statusBar.js~StatusBar",
@@ -15123,7 +15285,7 @@
"return": null
},
{
- "__docId__": 859,
+ "__docId__": 860,
"kind": "file",
"name": "src/modules/storage.js",
"content": "import Cookie from '../cookie';\nimport {root} from '../root';\n\nconst JSON = root.JSON;\nconst localStorage = root.localStorage;\nconst location = root.location;\n\n/**\n * Checks if browser has Storage feature\n */\nexport const hasStorage = () => {\n return 'Storage' in root;\n};\n\n/**\n * Stores the features state in browser's local storage or cookie\n *\n * @export\n * @class Storage\n */\nexport class Storage {\n\n /**\n * Creates an instance of Storage\n *\n * @param {State} state Instance of State\n */\n constructor(state) {\n\n /**\n * State object\n * @type {State}\n * @private\n */\n this.state = state;\n\n /**\n * TableFilter object\n * @type {TableFilter}\n * @private\n */\n this.tf = state.tf;\n\n /**\n * Persist with local storage\n * @type {Boolean}\n * @private\n */\n this.enableLocalStorage = state.enableLocalStorage && hasStorage();\n\n /**\n * Persist with cookie\n * @type {Boolean}\n * @private\n */\n this.enableCookie = state.enableCookie && !this.enableLocalStorage;\n\n /**\n * Emitter object\n * @type {Emitter}\n * @private\n */\n this.emitter = state.emitter;\n\n /**\n * Cookie duration in hours from state object\n * @type {Number}\n * @private\n */\n this.duration = state.cookieDuration;\n }\n\n\n /**\n * Initializes the Storage object\n */\n init() {\n this.emitter.on(['state-changed'], (tf, state) => this.save(state));\n this.emitter.on(['initialized'], () => this.sync());\n }\n\n /**\n * Persists the features state on state changes\n *\n * @param {State} state Instance of State\n */\n save(state) {\n if (this.enableLocalStorage) {\n localStorage[this.getKey()] = JSON.stringify(state);\n } else {\n Cookie.write(this.getKey(), JSON.stringify(state), this.duration);\n }\n }\n\n /**\n * Turns stored string into a State JSON object\n *\n * @returns {Object} JSON object\n */\n retrieve() {\n let state = null;\n if (this.enableLocalStorage) {\n state = localStorage[this.getKey()];\n } else {\n state = Cookie.read(this.getKey());\n }\n\n if (!state) {\n return null;\n }\n return JSON.parse(state);\n }\n\n /**\n * Removes persisted state from storage\n */\n remove() {\n if (this.enableLocalStorage) {\n localStorage.removeItem(this.getKey());\n } else {\n Cookie.remove(this.getKey());\n }\n }\n\n /**\n * Applies persisted state to features\n */\n sync() {\n let state = this.retrieve();\n if (!state) {\n return;\n }\n // override current state with persisted one and sync features\n this.state.overrideAndSync(state);\n }\n\n /**\n * Returns the storage key\n *\n * @returns {String} Key\n */\n getKey() {\n return JSON.stringify({\n key: `${this.tf.prfxTf}_${this.tf.id}`,\n path: location.pathname\n });\n }\n\n /**\n * Release Storage event subscriptions and clear fields\n */\n destroy() {\n this.emitter.off(['state-changed'], (tf, state) => this.save(state));\n this.emitter.off(['initialized'], () => this.sync());\n\n this.remove();\n\n this.state = null;\n this.emitter = null;\n }\n}\n",
@@ -15134,7 +15296,7 @@
"lineNumber": 1
},
{
- "__docId__": 860,
+ "__docId__": 861,
"kind": "variable",
"name": "JSON",
"memberof": "src/modules/storage.js",
@@ -15155,7 +15317,7 @@
"ignore": true
},
{
- "__docId__": 861,
+ "__docId__": 862,
"kind": "variable",
"name": "localStorage",
"memberof": "src/modules/storage.js",
@@ -15176,7 +15338,7 @@
"ignore": true
},
{
- "__docId__": 862,
+ "__docId__": 863,
"kind": "variable",
"name": "location",
"memberof": "src/modules/storage.js",
@@ -15197,7 +15359,7 @@
"ignore": true
},
{
- "__docId__": 863,
+ "__docId__": 864,
"kind": "function",
"name": "hasStorage",
"memberof": "src/modules/storage.js",
@@ -15219,7 +15381,7 @@
}
},
{
- "__docId__": 864,
+ "__docId__": 865,
"kind": "class",
"name": "Storage",
"memberof": "src/modules/storage.js",
@@ -15240,7 +15402,7 @@
"interface": false
},
{
- "__docId__": 865,
+ "__docId__": 866,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/storage.js~Storage",
@@ -15265,7 +15427,7 @@
]
},
{
- "__docId__": 866,
+ "__docId__": 867,
"kind": "member",
"name": "state",
"memberof": "src/modules/storage.js~Storage",
@@ -15281,10 +15443,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 867,
+ "__docId__": 868,
"kind": "member",
"name": "tf",
"memberof": "src/modules/storage.js~Storage",
@@ -15300,10 +15463,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 868,
+ "__docId__": 869,
"kind": "member",
"name": "enableLocalStorage",
"memberof": "src/modules/storage.js~Storage",
@@ -15319,10 +15483,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 869,
+ "__docId__": 870,
"kind": "member",
"name": "enableCookie",
"memberof": "src/modules/storage.js~Storage",
@@ -15338,10 +15503,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 870,
+ "__docId__": 871,
"kind": "member",
"name": "emitter",
"memberof": "src/modules/storage.js~Storage",
@@ -15357,10 +15523,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 871,
+ "__docId__": 872,
"kind": "member",
"name": "duration",
"memberof": "src/modules/storage.js~Storage",
@@ -15376,10 +15543,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 872,
+ "__docId__": 873,
"kind": "method",
"name": "init",
"memberof": "src/modules/storage.js~Storage",
@@ -15394,7 +15562,7 @@
"return": null
},
{
- "__docId__": 873,
+ "__docId__": 874,
"kind": "method",
"name": "save",
"memberof": "src/modules/storage.js~Storage",
@@ -15420,7 +15588,7 @@
"return": null
},
{
- "__docId__": 874,
+ "__docId__": 875,
"kind": "method",
"name": "retrieve",
"memberof": "src/modules/storage.js~Storage",
@@ -15448,7 +15616,7 @@
"params": []
},
{
- "__docId__": 875,
+ "__docId__": 876,
"kind": "method",
"name": "remove",
"memberof": "src/modules/storage.js~Storage",
@@ -15463,7 +15631,7 @@
"return": null
},
{
- "__docId__": 876,
+ "__docId__": 877,
"kind": "method",
"name": "sync",
"memberof": "src/modules/storage.js~Storage",
@@ -15478,7 +15646,7 @@
"return": null
},
{
- "__docId__": 877,
+ "__docId__": 878,
"kind": "method",
"name": "getKey",
"memberof": "src/modules/storage.js~Storage",
@@ -15506,7 +15674,7 @@
"params": []
},
{
- "__docId__": 878,
+ "__docId__": 879,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/storage.js~Storage",
@@ -15521,7 +15689,7 @@
"return": null
},
{
- "__docId__": 881,
+ "__docId__": 882,
"kind": "file",
"name": "src/modules/toolbar.js",
"content": "import {Feature} from '../feature';\nimport {createElm, removeElm, elm, tag} from '../dom';\nimport {defaultsStr} from '../settings';\nimport {isUndef} from '../types';\n\nconst EVENTS = [\n 'initializing-feature',\n 'initializing-extension'\n];\n\n/** Left position in toolbar */\nexport const LEFT = 'left';\n/** Right position in toolbar */\nexport const RIGHT = 'right';\n/** Center position in toolbar */\nexport const CENTER = 'center';\n\n/**\n * Toolbar UI component\n * @export\n * @class Toolbar\n * @extends {Feature}\n */\nexport class Toolbar extends Feature {\n\n /**\n * Create an instance of Toolbar\n * @param {TableFilter} tf TableFilter instance\n * @memberof Toolbar\n */\n constructor(tf) {\n super(tf, 'toolbar');\n\n // Configuration object\n let f = this.config.toolbar || {};\n\n /**\n * Css class for toolbar's container DOM element\n * @type {String}\n */\n this.contCssClass = defaultsStr(f.container_css_class, 'inf');\n\n /**\n * Css class for left-side inner container DOM element\n * @type {String}\n */\n this.lContCssClass = defaultsStr(f.left_cont_css_class, 'ldiv');\n\n /**\n * Css class for right-side inner container DOM element\n * @type {String}\n */\n this.rContCssClass = defaultsStr(f.right_cont_css_class, 'rdiv');\n\n /**\n * Css class for middle inner container DOM element\n * @type {String}\n */\n this.cContCssClass = defaultsStr(f.center_cont_css_class, 'mdiv');\n\n /**\n * Toolbar's custom container ID\n * @type {String}\n */\n this.tgtId = defaultsStr(f.target_id, null);\n\n /**\n * Toolbar's container DOM element\n * @type {DOMElement}\n * @private\n */\n this.cont = null;\n\n /**\n * Left-side inner container DOM element (rows counter in toolbar)\n * @type {DOMElement}\n * @private\n */\n this.lCont = null;\n\n /**\n * Right-side inner container DOM element (reset button,\n * page length selector in toolbar)\n * @type {DOMElement}\n * @private\n */\n this.rCont = null;\n\n /**\n * Middle inner container DOM element (paging elements in toolbar)\n * @type {DOMElement}\n * @private\n */\n this.cCont = null;\n\n /**\n * Container elements inside toolbar\n * @private\n */\n this.innerCont = {\n left: null,\n center: null,\n right: null\n };\n\n this.emitter.on(EVENTS,\n (feature, isExternal) => this.init(isExternal));\n\n /** @inherited */\n this.enabled = true;\n }\n\n /**\n * Initialize toolbar components\n * @param {Boolean} isExternal initialize only if component belongs\n * to toolbar\n */\n init(isExternal) {\n if (this.initialized || isExternal) {\n return;\n }\n\n let tf = this.tf;\n\n // default container\n let container = createElm('div');\n container.className = this.contCssClass;\n\n // custom container\n if (this.tgtId) {\n elm(this.tgtId).appendChild(container);\n }\n // grid-layout\n else if (tf.gridLayout) {\n let gridLayout = tf.Mod.gridLayout;\n gridLayout.tblMainCont.appendChild(container);\n container.className = gridLayout.infDivCssClass;\n }\n // default location: just above the table\n else {\n let cont = createElm('caption');\n cont.appendChild(container);\n tf.dom().insertBefore(cont, tf.dom().firstChild);\n }\n this.cont = container;\n\n // left container\n this.lCont = this.createContainer(container, this.lContCssClass);\n\n // right container\n this.rCont = this.createContainer(container, this.rContCssClass);\n\n // middle container\n this.cCont = this.createContainer(container, this.cContCssClass);\n\n this.innerCont = {\n left: this.lCont,\n center: this.cCont,\n right: this.rCont\n };\n\n /** @inherited */\n this.initialized = true;\n\n // emit help initialisation only if undefined\n if (isUndef(tf.help)) {\n // explicitily enable help to initialise feature by\n // default, only if setting is undefined\n tf.Mod.help.enable();\n this.emitter.emit('init-help', tf);\n }\n }\n\n /**\n * Return the container based on requested position inside the toolbar\n * @param {String} [position=RIGHT] 3 possible positions: 'left', 'center',\n * 'right'\n * @param {DOMElement} el optional DOM element to be inserter in container\n * @returns {DOMElement}\n */\n container(position = RIGHT, el) {\n let cont = this.innerCont[position];\n if (el) {\n cont.appendChild(el);\n }\n return cont;\n }\n\n /**\n * Create DOM element inside passed container\n * @param {DOMElement} container\n * @param {String} css\n * @private\n */\n createContainer(container, css) {\n let div = createElm('div', ['class', css]);\n container.appendChild(div);\n return div;\n }\n\n /**\n * Destroy Toolbar instance\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n let tf = this.tf;\n\n removeElm(this.cont);\n this.cont = null;\n\n let tbl = tf.dom();\n let captions = tag(tbl, 'caption');\n [].forEach.call(captions, (el) => removeElm(el));\n\n /** @inherited */\n this.initialized = false;\n }\n}\n",
@@ -15532,7 +15700,7 @@
"lineNumber": 1
},
{
- "__docId__": 882,
+ "__docId__": 883,
"kind": "variable",
"name": "EVENTS",
"memberof": "src/modules/toolbar.js",
@@ -15553,7 +15721,7 @@
"ignore": true
},
{
- "__docId__": 883,
+ "__docId__": 884,
"kind": "variable",
"name": "LEFT",
"memberof": "src/modules/toolbar.js",
@@ -15572,7 +15740,7 @@
}
},
{
- "__docId__": 884,
+ "__docId__": 885,
"kind": "variable",
"name": "RIGHT",
"memberof": "src/modules/toolbar.js",
@@ -15591,7 +15759,7 @@
}
},
{
- "__docId__": 885,
+ "__docId__": 886,
"kind": "variable",
"name": "CENTER",
"memberof": "src/modules/toolbar.js",
@@ -15610,7 +15778,7 @@
}
},
{
- "__docId__": 886,
+ "__docId__": 887,
"kind": "class",
"name": "Toolbar",
"memberof": "src/modules/toolbar.js",
@@ -15634,7 +15802,7 @@
]
},
{
- "__docId__": 887,
+ "__docId__": 888,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15659,7 +15827,7 @@
]
},
{
- "__docId__": 888,
+ "__docId__": 889,
"kind": "member",
"name": "contCssClass",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15678,7 +15846,7 @@
}
},
{
- "__docId__": 889,
+ "__docId__": 890,
"kind": "member",
"name": "lContCssClass",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15697,7 +15865,7 @@
}
},
{
- "__docId__": 890,
+ "__docId__": 891,
"kind": "member",
"name": "rContCssClass",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15716,7 +15884,7 @@
}
},
{
- "__docId__": 891,
+ "__docId__": 892,
"kind": "member",
"name": "cContCssClass",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15735,7 +15903,7 @@
}
},
{
- "__docId__": 892,
+ "__docId__": 893,
"kind": "member",
"name": "tgtId",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15754,7 +15922,7 @@
}
},
{
- "__docId__": 893,
+ "__docId__": 894,
"kind": "member",
"name": "cont",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15770,10 +15938,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 894,
+ "__docId__": 895,
"kind": "member",
"name": "lCont",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15789,10 +15958,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 895,
+ "__docId__": 896,
"kind": "member",
"name": "rCont",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15808,10 +15978,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 896,
+ "__docId__": 897,
"kind": "member",
"name": "cCont",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15827,10 +15998,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 897,
+ "__docId__": 898,
"kind": "member",
"name": "innerCont",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15839,6 +16011,7 @@
"access": "private",
"description": "Container elements inside toolbar",
"lineNumber": 100,
+ "ignore": true,
"type": {
"types": [
"{\"left\": *, \"center\": *, \"right\": *}"
@@ -15846,7 +16019,7 @@
}
},
{
- "__docId__": 898,
+ "__docId__": 899,
"kind": "member",
"name": "enabled",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15868,7 +16041,7 @@
}
},
{
- "__docId__": 899,
+ "__docId__": 900,
"kind": "method",
"name": "init",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15894,7 +16067,7 @@
"return": null
},
{
- "__docId__": 905,
+ "__docId__": 906,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15916,7 +16089,7 @@
}
},
{
- "__docId__": 906,
+ "__docId__": 907,
"kind": "method",
"name": "container",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -15967,7 +16140,7 @@
}
},
{
- "__docId__": 907,
+ "__docId__": 908,
"kind": "method",
"name": "createContainer",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -16000,6 +16173,7 @@
"description": ""
}
],
+ "ignore": true,
"return": {
"types": [
"*"
@@ -16007,7 +16181,7 @@
}
},
{
- "__docId__": 908,
+ "__docId__": 909,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/toolbar.js~Toolbar",
@@ -16022,7 +16196,7 @@
"return": null
},
{
- "__docId__": 911,
+ "__docId__": 912,
"kind": "file",
"name": "src/number.js",
"content": "import {isNumber} from './types';\n\n/**\n * Takes a string, removes all formatting/cruft and returns the raw float value\n * @param {String} Formatted number\n * @param {String} Decimal type '.' or ','\n * @return {Number} Unformatted number\n *\n * https://github.com/openexchangerates/accounting.js/blob/master/accounting.js\n */\nexport const parse = (value, decimal = '.') => {\n // Return the value as-is if it's already a number\n if (isNumber(value)) {\n return value;\n }\n\n // Build regex to strip out everything except digits, decimal point and\n // minus sign\n let regex = new RegExp('[^0-9-' + decimal + ']', ['g']);\n let unformatted = parseFloat(\n ('' + value)\n // replace bracketed values with negatives\n .replace(/\\((.*)\\)/, '-$1')\n // strip out any cruft\n .replace(regex, '')\n // make sure decimal point is standard\n .replace(decimal, '.')\n );\n\n // This will fail silently\n return !isNaN(unformatted) ? unformatted : 0;\n};\n",
@@ -16033,7 +16207,7 @@
"lineNumber": 1
},
{
- "__docId__": 912,
+ "__docId__": 913,
"kind": "function",
"name": "parse",
"memberof": "src/number.js",
@@ -16079,7 +16253,7 @@
}
},
{
- "__docId__": 913,
+ "__docId__": 914,
"kind": "file",
"name": "src/root.js",
"content": "/**\n * Export window or global object depending on the environment\n */\nexport const root = (typeof self === 'object' && self.self === self && self) ||\n (typeof global === 'object' && global.global === global && global) ||\n this;\n",
@@ -16090,7 +16264,7 @@
"lineNumber": 1
},
{
- "__docId__": 914,
+ "__docId__": 915,
"kind": "variable",
"name": "root",
"memberof": "src/root.js",
@@ -16109,7 +16283,7 @@
}
},
{
- "__docId__": 915,
+ "__docId__": 916,
"kind": "file",
"name": "src/settings.js",
"content": "import {isBoolean, isString, isFn, isArray} from './types';\n\n/** Configuration settings helpers */\n\n/**\n * If passed value is not of boolean type return the default value\n * otherwise return the value itself\n * @param {Boolean|Any} value\n * @param {Boolean} default value\n * @return {Boolean|Any}\n */\nexport const defaultsBool =\n (val, defaultVal) => isBoolean(val) ? val : defaultVal;\n\n/**\n * If passed value is not of string type return the default value\n * otherwise return the value itself\n * @param {String|Any} value\n * @param {String} default value\n * @return {String|Any}\n */\nexport const defaultsStr =\n (val, defaultVal) => isString(val) ? val : defaultVal;\n\n/**\n * If passed value is not of number type return the default value\n * otherwise return the value itself\n * @param {Number|Any} value\n * @param {Number} default value\n * @return {Number|Any}\n */\nexport const defaultsNb =\n (val, defaultVal) => isNaN(val) ? defaultVal : val;\n\n/**\n * If passed value is not of array type return the default value\n * otherwise return the value itself\n * @param {Array|Any} value\n * @param {Array} default value\n * @return {Array|Any}\n */\nexport const defaultsArr =\n (val, defaultVal) => isArray(val) ? val : defaultVal;\n\n/**\n * If passed value is not of function type return the default value\n * otherwise return the value itself\n * @param {Function|Any} value\n * @param {Function} default value\n * @return {Function|Any}\n */\nexport const defaultsFn =\n (val, defaultVal) => isFn(val) ? val : defaultVal;\n",
@@ -16120,7 +16294,7 @@
"lineNumber": 1
},
{
- "__docId__": 916,
+ "__docId__": 917,
"kind": "function",
"name": "defaultsBool",
"memberof": "src/settings.js",
@@ -16168,7 +16342,7 @@
}
},
{
- "__docId__": 917,
+ "__docId__": 918,
"kind": "function",
"name": "defaultsStr",
"memberof": "src/settings.js",
@@ -16216,7 +16390,7 @@
}
},
{
- "__docId__": 918,
+ "__docId__": 919,
"kind": "function",
"name": "defaultsNb",
"memberof": "src/settings.js",
@@ -16264,7 +16438,7 @@
}
},
{
- "__docId__": 919,
+ "__docId__": 920,
"kind": "function",
"name": "defaultsArr",
"memberof": "src/settings.js",
@@ -16312,7 +16486,7 @@
}
},
{
- "__docId__": 920,
+ "__docId__": 921,
"kind": "function",
"name": "defaultsFn",
"memberof": "src/settings.js",
@@ -16360,7 +16534,7 @@
}
},
{
- "__docId__": 921,
+ "__docId__": 922,
"kind": "file",
"name": "src/sort.js",
"content": "import {parse as parseNb} from './number';\nimport {Date as SugarDate} from 'sugar-date';\n\n/** Sorting utilities */\n\n/**\n * Case insensitive compare function for passed strings\n * @param {String} First string\n * @param {String} Second string\n * @return {Number} -1 if first string lower than second one\n * 0 if first string same order as second one\n * 1 if first string greater than second one\n */\nexport const ignoreCase = (a, b) => {\n let x = a.toLowerCase();\n let y = b.toLowerCase();\n return x < y ? -1 : (x > y ? 1 : 0);\n};\n\n/**\n * Compare function for sorting passed numbers in ascending manner\n * @param {Number} First number\n * @param {Number} Second number\n * @return {Number} Negative, zero or positive number\n */\nexport const numSortAsc = (a, b) => (a - b);\n\n/**\n * Compare function for sorting passed numbers in descending manner\n * @param {Number} First number\n * @param {Number} Second number\n * @return {Number} Negative, zero or positive number\n */\nexport const numSortDesc = (a, b) => (b - a);\n\n/**\n * Compare function for sorting passed dates in ascending manner according to\n * the corresponding UTC numeric value (returned by getTime)\n * @param {Date} First date object\n * @param {Date} Second date object\n * @return {Number} Negative, zero or positive number\n */\nexport const dateSortAsc = (date1, date2) => date1.getTime() - date2.getTime();\n\n/**\n * Compare function for sorting passed dates in descending manner according to\n * the corresponding UTC numeric value (returned by getTime)\n * @param {Date} First date object\n * @param {Date} Second date object\n * @return {Number} Negative, zero or positive number\n */\nexport const dateSortDesc = (date1, date2) => date2.getTime() - date1.getTime();\n\n/**\n * Curried compare function for sorting passed formatted numbers in desired\n * fashion according to supplied compare function and decimal separator\n * @param {Function} Compare function\n * @param {String} [decimal=','] Decimal separator\n * @return {Function} Compare function receiving parsed numeric arguments\n */\nexport const sortNumberStr = (compareFn, decimal = ',') => {\n return (numStr1, numStr2) => {\n let num1 = parseNb(numStr1, decimal);\n let num2 = parseNb(numStr2, decimal);\n return compareFn(num1, num2);\n };\n};\n\n/**\n * Curried compare function for sorting passed formatted dates in desired\n * fashion according to supplied compare function and locale\n * @param {Function} Compare function\n * @param {String} [locale='en-us'] Locale code\n * @return {Function} Compare function receiving parsed date arguments\n */\nexport const sortDateStr = (compareFn, locale = 'en-us') => {\n return (dateStr1, dateStr2) => {\n let date1 = SugarDate.create(dateStr1, locale);\n let date2 = SugarDate.create(dateStr2, locale);\n return compareFn(date1, date2);\n };\n};\n",
@@ -16371,7 +16545,7 @@
"lineNumber": 1
},
{
- "__docId__": 922,
+ "__docId__": 923,
"kind": "function",
"name": "ignoreCase",
"memberof": "src/sort.js",
@@ -16417,7 +16591,7 @@
}
},
{
- "__docId__": 923,
+ "__docId__": 924,
"kind": "function",
"name": "numSortAsc",
"memberof": "src/sort.js",
@@ -16463,7 +16637,7 @@
}
},
{
- "__docId__": 924,
+ "__docId__": 925,
"kind": "function",
"name": "numSortDesc",
"memberof": "src/sort.js",
@@ -16509,7 +16683,7 @@
}
},
{
- "__docId__": 925,
+ "__docId__": 926,
"kind": "function",
"name": "dateSortAsc",
"memberof": "src/sort.js",
@@ -16555,7 +16729,7 @@
}
},
{
- "__docId__": 926,
+ "__docId__": 927,
"kind": "function",
"name": "dateSortDesc",
"memberof": "src/sort.js",
@@ -16601,7 +16775,7 @@
}
},
{
- "__docId__": 927,
+ "__docId__": 928,
"kind": "function",
"name": "sortNumberStr",
"memberof": "src/sort.js",
@@ -16649,7 +16823,7 @@
}
},
{
- "__docId__": 928,
+ "__docId__": 929,
"kind": "function",
"name": "sortDateStr",
"memberof": "src/sort.js",
@@ -16697,7 +16871,7 @@
}
},
{
- "__docId__": 929,
+ "__docId__": 930,
"kind": "file",
"name": "src/string.js",
"content": "import {remove as removeDiacritics} from 'diacritics';\n\n/**\n * String utilities\n */\n\n/**\n * Removes whitespace from both sides of passed string\n * @param {String} text\n * @return {String}\n */\nexport const trim = (text) => {\n if (text.trim) {\n return text.trim();\n }\n return text.replace(/^\\s*|\\s*$/g, '');\n};\n\n/**\n * Checks if passed string is empty\n * @param {String} text\n * @return {Boolean}\n */\nexport const isEmpty = (text) => trim(text) === '';\n\n/**\n * Makes regex safe string by escaping special characters from passed string\n * @param {String} text\n * @return {String} escaped string\n */\nexport const rgxEsc = (text) => {\n let chars = /[-\\/\\\\^$*+?.()|[\\]{}]/g;\n let escMatch = '\\\\$&';\n return String(text).replace(chars, escMatch);\n};\n\n/**\n * Returns passed string as lowercase if caseSensitive flag set false. By\n * default it returns the string with no casing changes.\n * @param {String} text\n * @return {String} string\n */\nexport const matchCase = (text, caseSensitive = false) => {\n if (!caseSensitive) {\n return text.toLowerCase();\n }\n return text;\n};\n\n/**\n * Checks if passed data contains the searched term\n * @param {String} term Searched term\n * @param {String} data Data string\n * @param {Boolean} exactMatch Exact match\n * @param {Boolean} caseSensitive Case sensitive\n * @param {Boolean} ignoreDiacritics Ignore diacritics\n * @return {Boolean}\n */\nexport const contains = (term, data, exactMatch = false, caseSensitive = false,\n ignoreDiacritics = false) => {\n // Improved by Cedric Wartel (cwl) automatic exact match for selects and\n // special characters are now filtered\n let regexp;\n let modifier = caseSensitive ? 'g' : 'gi';\n if (ignoreDiacritics) {\n term = removeDiacritics(term);\n data = removeDiacritics(data);\n }\n if (exactMatch) {\n regexp = new RegExp('(^\\\\s*)' + rgxEsc(term) + '(\\\\s*$)',\n modifier);\n } else {\n regexp = new RegExp(rgxEsc(term), modifier);\n }\n return regexp.test(data);\n};\n",
@@ -16708,7 +16882,7 @@
"lineNumber": 1
},
{
- "__docId__": 930,
+ "__docId__": 931,
"kind": "function",
"name": "trim",
"memberof": "src/string.js",
@@ -16744,7 +16918,7 @@
}
},
{
- "__docId__": 931,
+ "__docId__": 932,
"kind": "function",
"name": "isEmpty",
"memberof": "src/string.js",
@@ -16780,7 +16954,7 @@
}
},
{
- "__docId__": 932,
+ "__docId__": 933,
"kind": "function",
"name": "rgxEsc",
"memberof": "src/string.js",
@@ -16816,7 +16990,7 @@
}
},
{
- "__docId__": 933,
+ "__docId__": 934,
"kind": "function",
"name": "matchCase",
"memberof": "src/string.js",
@@ -16852,7 +17026,7 @@
}
},
{
- "__docId__": 934,
+ "__docId__": 935,
"kind": "function",
"name": "contains",
"memberof": "src/string.js",
@@ -16928,10 +17102,10 @@
}
},
{
- "__docId__": 935,
+ "__docId__": 936,
"kind": "file",
"name": "src/tablefilter.js",
- "content": "import {addEvt, cancelEvt, stopEvt, targetEvt, keyCode} from './event';\nimport {\n addClass, createElm, createOpt, elm, getText, getFirstTextNode,\n removeClass, tag\n} from './dom';\nimport {contains, matchCase, rgxEsc, trim} from './string';\nimport {isEmpty as isEmptyString} from './string';\nimport {\n isArray, isEmpty, isFn, isNumber, isObj, isString, isUndef, EMPTY_FN,\n isBoolean\n} from './types';\nimport {parse as parseNb} from './number';\nimport {\n defaultsBool, defaultsStr, defaultsFn,\n defaultsNb, defaultsArr\n} from './settings';\n\nimport {root} from './root';\nimport {Emitter} from './emitter';\nimport {Dropdown} from './modules/dropdown';\nimport {CheckList} from './modules/checkList';\n\nimport {\n INPUT, SELECT, MULTIPLE, CHECKLIST, NONE,\n ENTER_KEY, TAB_KEY, ESC_KEY, UP_ARROW_KEY, DOWN_ARROW_KEY,\n CELL_TAG, AUTO_FILTER_DELAY, NUMBER, DATE, FORMATTED_NUMBER,\n FEATURES\n} from './const';\n\nlet doc = root.document;\n\n/**\n * Makes HTML tables filterable and a bit more :)\n *\n * @export\n * @class TableFilter\n */\nexport class TableFilter {\n\n /**\n * Creates an instance of TableFilter\n * requires `table` or `id` arguments, `row` and `configuration` optional\n * @param {HTMLTableElement} table Table DOM element\n * @param {String} id Table id\n * @param {Number} row index indicating the 1st row\n * @param {Object} configuration object\n */\n constructor(...args) {\n /**\n * ID of current instance\n * @type {String}\n * @private\n */\n this.id = null;\n\n /**\n * Current version\n * @type {String}\n */\n this.version = '{VERSION}';\n\n /**\n * Current year\n * @type {Number}\n * @private\n */\n this.year = new Date().getFullYear();\n\n /**\n * HTML Table DOM element\n * @type {DOMElement}\n * @private\n */\n this.tbl = null;\n\n /**\n * Calculated row's index from which starts filtering once filters\n * are generated\n * @type {Number}\n */\n this.refRow = null;\n\n /**\n * Index of the headers row\n * @type {Number}\n * @private\n */\n this.headersRow = null;\n\n /**\n * Configuration object\n * @type {Object}\n * @private\n */\n this.cfg = {};\n\n /**\n * Number of rows that can be filtered\n * @type {Number}\n * @private\n */\n this.nbFilterableRows = 0;\n\n /**\n * Number of cells in the reference row\n * @type {Number}\n * @private\n */\n this.nbCells = null;\n\n /**\n * Has a configuration object\n * @type {Object}\n * @private\n */\n this.hasConfig = false;\n\n /** @private */\n this.initialized = false;\n\n let startRow;\n\n // TODO: use for-of\n args.forEach((arg) => {\n if (typeof arg === 'object' && arg.nodeName === 'TABLE') {\n this.tbl = arg;\n this.id = arg.id || `tf_${new Date().getTime()}_`;\n this.tbl.id = this.id;\n } else if (isString(arg)) {\n this.id = arg;\n this.tbl = elm(arg);\n } else if (isNumber(arg)) {\n startRow = arg;\n } else if (isObj(arg)) {\n this.cfg = arg;\n this.hasConfig = true;\n }\n });\n\n if (!this.tbl || this.tbl.nodeName !== 'TABLE') {\n throw new Error(`Could not instantiate TableFilter: HTML table\n DOM element not found.`);\n }\n\n if (this.getRowsNb() === 0) {\n throw new Error(`Could not instantiate TableFilter: HTML table\n requires at least 1 row.`);\n }\n\n // configuration object\n let f = this.cfg;\n\n /**\n * Event emitter instance\n * @type {Emitter}\n */\n this.emitter = new Emitter();\n\n // start row\n this.refRow = isUndef(startRow) ? 2 : (startRow + 1);\n\n /**\n * Collection of filter type by column\n * @type {Array}\n * @private\n */\n this.filterTypes = [].map.call(\n (this.dom().rows[this.refRow] || this.dom().rows[0]).cells,\n (cell, idx) => {\n let colType = this.cfg[`col_${idx}`];\n return !colType ? INPUT : colType.toLowerCase();\n });\n\n /**\n * Base path for static assets\n * @type {String}\n */\n this.basePath = defaultsStr(f.base_path, 'tablefilter/');\n\n /*** filters' grid properties ***/\n\n /**\n * Enable/disable filters\n * @type {Boolean}\n */\n this.fltGrid = defaultsBool(f.grid, true);\n\n /**\n * Enable/disable grid layout (fixed headers)\n * @type {Object|Boolean}\n */\n this.gridLayout = isObj(f.grid_layout) || Boolean(f.grid_layout);\n\n /**\n * Filters row index\n * @type {Number}\n */\n this.filtersRowIndex = defaultsNb(f.filters_row_index, 0);\n\n /**\n * Headers row index\n * @type {Number}\n */\n this.headersRow = defaultsNb(f.headers_row_index,\n (this.filtersRowIndex === 0 ? 1 : 0));\n\n /**\n * Define the type of cell containing a filter (td/th)\n * @type {String}\n */\n this.fltCellTag = defaultsStr(f.filters_cell_tag, CELL_TAG);\n\n /**\n * List of filters IDs\n * @type {Array}\n * @private\n */\n this.fltIds = [];\n\n /**\n * List of valid rows indexes (rows visible upon filtering)\n * @type {Array}\n * @private\n */\n this.validRowsIndex = [];\n\n /*** filters' grid appearance ***/\n /**\n * Path for stylesheets\n * @type {String}\n */\n this.stylePath = this.getStylePath();\n\n /**\n * Main stylesheet path\n * @type {String}\n */\n this.stylesheet = this.getStylesheetPath();\n\n /**\n * Main stylesheet ID\n * @type {String}\n * @private\n */\n this.stylesheetId = this.id + '_style';\n\n /**\n * Css class for the filters row\n * @type {String}\n */\n this.fltsRowCssClass = defaultsStr(f.flts_row_css_class, 'fltrow');\n\n /**\n * Enable/disable icons (paging, reset button)\n * @type {Boolean}\n */\n this.enableIcons = defaultsBool(f.enable_icons, true);\n\n /**\n * Enable/disable alternating rows\n * @type {Boolean}\n */\n this.alternateRows = Boolean(f.alternate_rows);\n\n /**\n * Columns widths array\n * @type {Array}\n */\n this.colWidths = defaultsArr(f.col_widths, []);\n\n /**\n * Css class for a filter element\n * @type {String}\n */\n this.fltCssClass = defaultsStr(f.flt_css_class, 'flt');\n\n /**\n * Css class for multiple select filters\n * @type {String}\n */\n this.fltMultiCssClass = defaultsStr(f.flt_multi_css_class, 'flt_multi');\n\n /**\n * Css class for small filter (when submit button is active)\n * @type {String}\n */\n this.fltSmallCssClass = defaultsStr(f.flt_small_css_class, 'flt_s');\n\n /**\n * Css class for single filter type\n * @type {String}\n */\n this.singleFltCssClass = defaultsStr((f.single_filter || {}).css_class,\n 'single_flt');\n\n /*** filters' grid behaviours ***/\n\n /**\n * Enable/disable enter key for input type filters\n * @type {Boolean}\n */\n this.enterKey = defaultsBool(f.enter_key, true);\n\n /**\n * Callback fired before filtering process starts\n * @type {Function}\n */\n this.onBeforeFilter = defaultsFn(f.on_before_filter, EMPTY_FN);\n\n /**\n * Callback fired after filtering process is completed\n * @type {Function}\n */\n this.onAfterFilter = defaultsFn(f.on_after_filter, EMPTY_FN);\n\n /**\n * Enable/disable case sensitivity filtering\n * @type {Boolean}\n */\n this.caseSensitive = Boolean(f.case_sensitive);\n\n /**\n * Indicate whether exact match filtering is enabled on a per column\n * basis\n * @type {Boolean}\n * @private\n */\n this.hasExactMatchByCol = isArray(f.columns_exact_match);\n\n /**\n * Exact match filtering per column array\n * @type {Array}\n */\n this.exactMatchByCol = this.hasExactMatchByCol ?\n f.columns_exact_match : [];\n\n /**\n * Globally enable/disable exact match filtering\n * @type {Boolean}\n */\n this.exactMatch = Boolean(f.exact_match);\n\n /**\n * Ignore diacritics globally or on a column basis\n * @type {Boolean|Array}\n */\n this.ignoreDiacritics = f.ignore_diacritics;\n\n /**\n * Enable/disable linked filters filtering mode\n * @type {Boolean}\n */\n this.linkedFilters = Boolean(f.linked_filters);\n\n /**\n * Enable/disable readonly state for excluded options when\n * linked filters filtering mode is on\n * @type {Boolean}\n */\n this.disableExcludedOptions = Boolean(f.disable_excluded_options);\n\n /**\n * Active filter ID\n * @type {String}\n * @private\n */\n this.activeFilterId = null;\n\n /**\n * Determine if there are excluded rows from filtering\n * @type {Boolean}\n * @private\n */\n this.hasExcludedRows = Boolean(isArray(f.exclude_rows) &&\n f.exclude_rows.length > 0);\n\n /**\n * List of row indexes to be excluded from filtering\n * @type {Array}\n */\n this.excludeRows = defaultsArr(f.exclude_rows, []);\n\n /**\n * List of containers IDs where external filters will be generated\n * @type {Array}\n */\n this.externalFltIds = defaultsArr(f.external_flt_ids, []);\n\n /**\n * Callback fired after filters are generated\n * @type {Function}\n */\n this.onFiltersLoaded = defaultsFn(f.on_filters_loaded, EMPTY_FN);\n\n /**\n * Enable/disable single filter mode\n * @type {Boolean|Object}\n */\n this.singleFlt = isObj(f.single_filter) ||\n Boolean(f.single_filter);\n\n /**\n * Specify columns to be excluded from single filter search, by default\n * searching in all columns:\n * single_filter: {\n * exclude_cols: [2, 7]\n * }\n */\n this.singleFltExcludeCols = isObj(f.single_filter) &&\n isArray(f.single_filter.exclude_cols) ?\n f.single_filter.exclude_cols : [];\n\n /**\n * Callback fired after a row is validated during filtering\n * @type {Function}\n */\n this.onRowValidated = defaultsFn(f.on_row_validated, EMPTY_FN);\n\n /**\n * Specify which column implements a custom cell parser to retrieve the\n * cell value:\n * cell_parser: {\n * cols: [0, 2],\n * parse: function(tf, cell, colIndex) {\n * // custom cell parser logic here\n * return cellValue;\n * }\n * }\n * @type {Object}\n */\n this.cellParser = isObj(f.cell_parser) && isFn(f.cell_parser.parse) &&\n isArray(f.cell_parser.cols) ?\n f.cell_parser : { cols: [], parse: EMPTY_FN };\n\n /**\n * Global watermark text for input filter type or watermark for each\n * filter if an array is supplied\n * @type {String|Array}\n */\n this.watermark = f.watermark || '';\n\n /**\n * Indicate whether watermark is on a per column basis\n * @type {Boolean}\n * @private\n */\n this.isWatermarkArray = isArray(this.watermark);\n\n /**\n * Indicate whether help UI component is disabled\n * @type {Boolean}\n */\n this.help = isUndef(f.help_instructions) ? undefined :\n (isObj(f.help_instructions) || Boolean(f.help_instructions));\n\n /**\n * Indicate whether pop-up filters UI is enabled\n * @type {Boolean|Object}\n */\n this.popupFilters = isObj(f.popup_filters) || Boolean(f.popup_filters);\n\n /**\n * Indicate whether filtered (active) columns indicator is enabled\n * @type {Boolean}\n */\n this.markActiveColumns = isObj(f.mark_active_columns) ||\n Boolean(f.mark_active_columns);\n\n /*** select filter's customisation and behaviours ***/\n /**\n * Text for clear option in drop-down filter types (1st option)\n * @type {String|Array}\n */\n this.clearFilterText = defaultsStr(f.clear_filter_text, 'Clear');\n\n /**\n * Indicate whether empty option is enabled in drop-down filter types\n * @type {Boolean}\n */\n this.enableEmptyOption = Boolean(f.enable_empty_option);\n\n /**\n * Text for empty option in drop-down filter types\n * @type {String}\n */\n this.emptyText = defaultsStr(f.empty_text, '(Empty)');\n\n /**\n * Indicate whether non-empty option is enabled in drop-down filter\n * types\n * @type {Boolean}\n */\n this.enableNonEmptyOption = Boolean(f.enable_non_empty_option);\n\n /**\n * Text for non-empty option in drop-down filter types\n * @type {String}\n */\n this.nonEmptyText = defaultsStr(f.non_empty_text, '(Non empty)');\n\n /**\n * Indicate whether drop-down filter types filter the table by default\n * on change event\n * @type {Boolean}\n */\n this.onSlcChange = defaultsBool(f.on_change, true);\n\n /**\n * Make drop-down filter types options sorted in alpha-numeric manner\n * by default globally or on a column basis\n * @type {Boolean|Array}\n */\n this.sortSlc = isUndef(f.sort_select) ? true :\n isArray(f.sort_select) ? f.sort_select : Boolean(f.sort_select);\n\n /**\n * Indicate whether options in drop-down filter types are sorted in a\n * ascending numeric manner\n * @type {Boolean}\n * @private\n */\n this.isSortNumAsc = Boolean(f.sort_num_asc);\n\n /**\n * List of columns implementing options sorting in a ascending numeric\n * manner\n * @type {Array}\n */\n this.sortNumAsc = this.isSortNumAsc ? f.sort_num_asc : [];\n\n /**\n * Indicate whether options in drop-down filter types are sorted in a\n * descending numeric manner\n * @type {Boolean}\n * @private\n */\n this.isSortNumDesc = Boolean(f.sort_num_desc);\n\n /**\n * List of columns implementing options sorting in a descending numeric\n * manner\n * @type {Array}\n */\n this.sortNumDesc = this.isSortNumDesc ? f.sort_num_desc : [];\n\n /**\n * Indicate whether drop-down filter types are populated on demand at\n * first usage\n * @type {Boolean}\n */\n this.loadFltOnDemand = Boolean(f.load_filters_on_demand);\n\n /**\n * Indicate whether custom drop-down filter options are implemented\n * @type {Boolean}\n */\n this.hasCustomOptions = isObj(f.custom_options);\n\n /**\n * Custom options definition of a per column basis, ie:\n *\tcustom_options: {\n * cols:[0, 1],\n * texts: [\n * ['a0', 'b0', 'c0'],\n * ['a1', 'b1', 'c1']\n * ],\n * values: [\n * ['a0', 'b0', 'c0'],\n * ['a1', 'b1', 'c1']\n * ],\n * sorts: [false, true]\n * }\n *\n * @type {Object}\n */\n this.customOptions = f.custom_options;\n\n /*** Filter operators ***/\n /**\n * Regular expression operator for input filter. Defaults to 'rgx:'\n * @type {String}\n */\n this.rgxOperator = defaultsStr(f.regexp_operator, 'rgx:');\n\n /**\n * Empty cells operator for input filter. Defaults to '[empty]'\n * @type {String}\n */\n this.emOperator = defaultsStr(f.empty_operator, '[empty]');\n\n /**\n * Non-empty cells operator for input filter. Defaults to '[nonempty]'\n * @type {String}\n */\n this.nmOperator = defaultsStr(f.nonempty_operator, '[nonempty]');\n\n /**\n * Logical OR operator for input filter. Defaults to '||'\n * @type {String}\n */\n this.orOperator = defaultsStr(f.or_operator, '||');\n\n /**\n * Logical AND operator for input filter. Defaults to '&&'\n * @type {String}\n */\n this.anOperator = defaultsStr(f.and_operator, '&&');\n\n /**\n * Greater than operator for input filter. Defaults to '>'\n * @type {String}\n */\n this.grOperator = defaultsStr(f.greater_operator, '>');\n\n /**\n * Lower than operator for input filter. Defaults to '<'\n * @type {String}\n */\n this.lwOperator = defaultsStr(f.lower_operator, '<');\n\n /**\n * Lower than or equal operator for input filter. Defaults to '<='\n * @type {String}\n */\n this.leOperator = defaultsStr(f.lower_equal_operator, '<=');\n\n /**\n * Greater than or equal operator for input filter. Defaults to '>='\n * @type {String}\n */\n this.geOperator = defaultsStr(f.greater_equal_operator, '>=');\n\n /**\n * Inequality operator for input filter. Defaults to '!'\n * @type {String}\n */\n this.dfOperator = defaultsStr(f.different_operator, '!');\n\n /**\n * Like operator for input filter. Defaults to '*'\n * @type {String}\n */\n this.lkOperator = defaultsStr(f.like_operator, '*');\n\n /**\n * Strict equality operator for input filter. Defaults to '='\n * @type {String}\n */\n this.eqOperator = defaultsStr(f.equal_operator, '=');\n\n /**\n * Starts with operator for input filter. Defaults to '='\n * @type {String}\n */\n this.stOperator = defaultsStr(f.start_with_operator, '{');\n\n /**\n * Ends with operator for input filter. Defaults to '='\n * @type {String}\n */\n this.enOperator = defaultsStr(f.end_with_operator, '}');\n\n // this.curExp = f.cur_exp || '^[¥£€$]';\n\n /**\n * Stored values separator\n * @type {String}\n */\n this.separator = defaultsStr(f.separator, ',');\n\n /**\n * Enable rows counter UI component\n * @type {Boolean|Object}\n */\n this.rowsCounter = isObj(f.rows_counter) || Boolean(f.rows_counter);\n\n /**\n * Enable status bar UI component\n * @type {Boolean|Object}\n */\n this.statusBar = isObj(f.status_bar) || Boolean(f.status_bar);\n\n /**\n * Enable activity/spinner indicator UI component\n * @type {Boolean|Object}\n */\n this.loader = isObj(f.loader) || Boolean(f.loader);\n\n /*** validation - reset buttons/links ***/\n /**\n * Enable filters submission button\n * @type {Boolean}\n */\n this.displayBtn = Boolean(f.btn);\n\n /**\n * Define filters submission button text\n * @type {String}\n */\n this.btnText = defaultsStr(f.btn_text, (!this.enableIcons ? 'Go' : ''));\n\n /**\n * Css class for filters submission button\n * @type {String}\n */\n this.btnCssClass = defaultsStr(f.btn_css_class,\n (!this.enableIcons ? 'btnflt' : 'btnflt_icon'));\n\n /**\n * Enable clear button\n * @type {Object|Boolean}\n */\n this.btnReset = isObj(f.btn_reset) || Boolean(f.btn_reset);\n\n /**\n * Callback fired before filters are cleared\n * @type {Function}\n */\n this.onBeforeReset = defaultsFn(f.on_before_reset, EMPTY_FN);\n\n /**\n * Callback fired after filters are cleared\n * @type {Function}\n */\n this.onAfterReset = defaultsFn(f.on_after_reset, EMPTY_FN);\n\n /**\n * Enable paging component\n * @type {Object|Boolean}\n */\n this.paging = isObj(f.paging) || Boolean(f.paging);\n\n /**\n * Number of hidden rows\n * @type {Number}\n * @private\n */\n this.nbHiddenRows = 0;\n\n /**\n * Enable auto-filter behaviour, table is filtered when a user\n * stops typing\n * @type {Boolean}\n */\n this.autoFilter = Boolean(f.auto_filter);\n\n /**\n * Auto-filter delay in msecs\n * @type {Number}\n */\n this.autoFilterDelay =\n defaultsNb(f.auto_filter_delay, AUTO_FILTER_DELAY);\n\n /**\n * Indicate whether user is typing\n * @type {Boolean}\n * @private\n */\n this.isUserTyping = null;\n\n /**\n * Auto-filter interval ID\n * @type {String}\n * @private\n */\n this.autoFilterTimer = null;\n\n /**\n * Enable keyword highlighting behaviour\n * @type {Boolean}\n */\n this.highlightKeywords = Boolean(f.highlight_keywords);\n\n /**\n * Enable no results message UI component\n * @type {Object|Boolean}\n */\n this.noResults = isObj(f.no_results_message) ||\n Boolean(f.no_results_message);\n\n /**\n * Enable state persistence\n * @type {Object|Boolean}\n */\n this.state = isObj(f.state) || Boolean(f.state);\n\n /*** data types ***/\n\n /**\n * Enable date type module\n * @type {Boolean}\n * @private\n */\n this.dateType = true;\n\n /**\n * Define default locale, default to 'en' as per Sugar Date module:\n * https://sugarjs.com/docs/#/DateLocales\n * @type {String}\n */\n this.locale = defaultsStr(f.locale, 'en');\n\n /**\n * Define thousands separator ',' or '.', defaults to ','\n * @type {String}\n */\n this.thousandsSeparator = defaultsStr(f.thousands_separator, ',');\n\n /**\n * Define decimal separator ',' or '.', defaults to '.'\n * @type {String}\n */\n this.decimalSeparator = defaultsStr(f.decimal_separator, '.');\n\n /**\n * Define data types on a column basis, possible values 'string',\n * 'number', 'formatted-number', 'date', 'ipaddress' ie:\n * col_types : [\n * 'string', 'date', 'number',\n * { type: 'formatted-number', decimal: ',', thousands: '.' },\n * { type: 'date', locale: 'en-gb' },\n * { type: 'date', format: ['{dd}-{months}-{yyyy|yy}'] }\n * ]\n *\n * Refer to https://sugarjs.com/docs/#/DateParsing for exhaustive\n * information on date parsing formats supported by Sugar Date\n * @type {Array}\n */\n this.colTypes = isArray(f.col_types) ? f.col_types : [];\n\n /*** ids prefixes ***/\n /**\n * Main prefix\n * @private\n */\n this.prfxTf = 'TF';\n\n /**\n * Filter's ID prefix (inputs - selects)\n * @private\n */\n this.prfxFlt = 'flt';\n\n /**\n * Button's ID prefix\n * @private\n */\n this.prfxValButton = 'btn';\n\n /**\n * Responsive Css class\n * @private\n */\n this.prfxResponsive = 'resp';\n\n /*** extensions ***/\n /**\n * List of loaded extensions\n * @type {Array}\n */\n this.extensions = defaultsArr(f.extensions, []);\n\n /*** themes ***/\n /**\n * Enable default theme\n * @type {Boolean}\n */\n this.enableDefaultTheme = Boolean(f.enable_default_theme);\n\n /**\n * Determine whether themes are enables\n * @type {Boolean}\n * @private\n */\n this.hasThemes = (this.enableDefaultTheme || isArray(f.themes));\n\n /**\n * List of themes, ie:\n * themes: [{ name: 'skyblue' }]\n * @type {Array}\n */\n this.themes = defaultsArr(f.themes, []);\n\n /**\n * Define path to themes assets, defaults to\n * 'tablefilter/style/themes/'. Usage:\n * themes: [{ name: 'skyblue' }]\n * @type {Array}\n */\n this.themesPath = this.getThemesPath();\n\n /**\n * Enable responsive layout\n * @type {Boolean}\n */\n this.responsive = Boolean(f.responsive);\n\n /**\n * Enable toolbar component\n * @type {Object|Boolean}\n */\n this.toolbar = isObj(f.toolbar) || Boolean(f.toolbar);\n\n /**\n * Features registry\n * @private\n */\n this.Mod = {};\n\n /**\n * Extensions registry\n * @private\n */\n this.ExtRegistry = {};\n\n // conditionally instantiate required features\n this.instantiateFeatures(\n Object.keys(FEATURES).map((item) => FEATURES[item])\n );\n }\n\n /**\n * Initialise features and layout\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n // import main stylesheet\n this.import(this.stylesheetId, this.getStylesheetPath(), null, 'link');\n\n let Mod = this.Mod;\n let inpclass;\n\n //loads theme\n this.loadThemes();\n\n const { dateType, help, state, markActiveColumns, gridLayout, loader,\n highlightKeyword, popupFilter, rowsCounter, statusBar, clearButton,\n alternateRows, noResults, paging, toolbar } = FEATURES;\n\n //explicitly initialise features in given order\n this.initFeatures([\n dateType,\n help,\n state,\n markActiveColumns,\n gridLayout,\n loader,\n highlightKeyword,\n popupFilter\n ]);\n\n //filters grid is not generated\n if (!this.fltGrid) {\n this._initNoFilters();\n } else {\n let fltrow = this._insertFiltersRow();\n\n this.nbCells = this.getCellsNb(this.refRow);\n this.nbFilterableRows = this.getRowsNb();\n\n let n = this.singleFlt ? 1 : this.nbCells;\n\n //build filters\n for (let i = 0; i < n; i++) {\n this.emitter.emit('before-filter-init', this, i);\n\n let fltCell = createElm(this.fltCellTag),\n col = this.getFilterType(i);\n\n if (this.singleFlt) {\n fltCell.colSpan = this.nbCells;\n }\n if (!this.gridLayout) {\n fltrow.appendChild(fltCell);\n }\n inpclass = (i === n - 1 && this.displayBtn) ?\n this.fltSmallCssClass : this.fltCssClass;\n\n //only 1 input for single search\n if (this.singleFlt) {\n col = INPUT;\n inpclass = this.singleFltCssClass;\n }\n\n //drop-down filters\n if (col === SELECT || col === MULTIPLE) {\n Mod.dropdown = Mod.dropdown || new Dropdown(this);\n Mod.dropdown.init(i, this.isExternalFlt(), fltCell);\n }\n // checklist\n else if (col === CHECKLIST) {\n Mod.checkList = Mod.checkList || new CheckList(this);\n Mod.checkList.init(i, this.isExternalFlt(), fltCell);\n } else {\n this._buildInputFilter(i, inpclass, fltCell);\n }\n\n // this adds submit button\n if (i === n - 1 && this.displayBtn) {\n this._buildSubmitButton(\n this.isExternalFlt() ?\n elm(this.externalFltIds[i]) :\n fltCell\n );\n }\n\n this.emitter.emit('after-filter-init', this, i);\n }\n\n this.emitter.on(['filter-focus'],\n (tf, filter) => this.setActiveFilterId(filter.id));\n\n }//if this.fltGrid\n\n /* Features */\n if (this.hasExcludedRows) {\n this.emitter.on(['after-filtering'], () => this.setExcludeRows());\n this.setExcludeRows();\n }\n\n this.initFeatures([\n rowsCounter,\n statusBar,\n clearButton,\n alternateRows,\n noResults,\n paging,\n toolbar\n ]);\n\n this.setColWidths();\n\n //TF css class is added to table\n if (!this.gridLayout) {\n addClass(this.dom(), this.prfxTf);\n if (this.responsive) {\n addClass(this.dom(), this.prfxResponsive);\n }\n }\n\n /* Load extensions */\n this.initExtensions();\n\n // Subscribe to events\n if (this.linkedFilters) {\n this.emitter.on(['after-filtering'], () => this.linkFilters());\n }\n\n this.initialized = true;\n\n this.onFiltersLoaded(this);\n\n this.emitter.emit('initialized', this);\n }\n\n /**\n * Detect key\n * @param {Event} evt\n */\n detectKey(evt) {\n if (!this.enterKey) {\n return;\n }\n if (evt) {\n let key = keyCode(evt);\n if (key === ENTER_KEY) {\n this.filter();\n cancelEvt(evt);\n stopEvt(evt);\n } else {\n this.isUserTyping = true;\n root.clearInterval(this.autoFilterTimer);\n this.autoFilterTimer = null;\n }\n }\n }\n\n /**\n * Filter's keyup event: if auto-filter on, detect user is typing and filter\n * columns\n * @param {Event} evt\n */\n onKeyUp(evt) {\n if (!this.autoFilter) {\n return;\n }\n let key = keyCode(evt);\n this.isUserTyping = false;\n\n function filter() {\n root.clearInterval(this.autoFilterTimer);\n this.autoFilterTimer = null;\n if (!this.isUserTyping) {\n this.filter();\n this.isUserTyping = null;\n }\n }\n\n if (key !== ENTER_KEY && key !== TAB_KEY && key !== ESC_KEY &&\n key !== UP_ARROW_KEY && key !== DOWN_ARROW_KEY) {\n if (this.autoFilterTimer === null) {\n this.autoFilterTimer = root.setInterval(filter.bind(this),\n this.autoFilterDelay);\n }\n } else {\n root.clearInterval(this.autoFilterTimer);\n this.autoFilterTimer = null;\n }\n }\n\n /**\n * Filter's keydown event: if auto-filter on, detect user is typing\n */\n onKeyDown() {\n if (this.autoFilter) {\n this.isUserTyping = true;\n }\n }\n\n /**\n * Filter's focus event\n * @param {Event} evt\n */\n onInpFocus(evt) {\n let elm = targetEvt(evt);\n this.emitter.emit('filter-focus', this, elm);\n }\n\n /**\n * Filter's blur event: if auto-filter on, clear interval on filter blur\n */\n onInpBlur() {\n if (this.autoFilter) {\n this.isUserTyping = false;\n root.clearInterval(this.autoFilterTimer);\n }\n this.emitter.emit('filter-blur', this);\n }\n\n /**\n * Insert filters row at initialization\n */\n _insertFiltersRow() {\n // TODO: prevent filters row generation for popup filters too,\n // to reduce and simplify headers row index adjusting across lib modules\n // (GridLayout, PopupFilter etc)\n if (this.gridLayout) {\n return;\n }\n let fltrow;\n\n let thead = tag(this.dom(), 'thead');\n if (thead.length > 0) {\n fltrow = thead[0].insertRow(this.filtersRowIndex);\n } else {\n fltrow = this.dom().insertRow(this.filtersRowIndex);\n }\n\n fltrow.className = this.fltsRowCssClass;\n\n if (this.isExternalFlt()) {\n fltrow.style.display = NONE;\n }\n\n this.emitter.emit('filters-row-inserted', this, fltrow);\n return fltrow;\n }\n\n /**\n * Initialize filtersless table\n */\n _initNoFilters() {\n if (this.fltGrid) {\n return;\n }\n this.refRow = this.refRow > 0 ? this.refRow - 1 : 0;\n this.nbFilterableRows = this.getRowsNb();\n }\n\n /**\n * Build input filter type\n * @param {Number} colIndex Column index\n * @param {String} cssClass Css class applied to filter\n * @param {DOMElement} container Container DOM element\n */\n _buildInputFilter(colIndex, cssClass, container) {\n let col = this.getFilterType(colIndex);\n let externalFltTgtId = this.isExternalFlt() ?\n this.externalFltIds[colIndex] : null;\n let inpType = col === INPUT ? 'text' : 'hidden';\n let inp = createElm(INPUT,\n ['id', this.buildFilterId(colIndex)],\n ['type', inpType], ['ct', colIndex]);\n\n if (inpType !== 'hidden' && this.watermark) {\n inp.setAttribute('placeholder',\n this.isWatermarkArray ? (this.watermark[colIndex] || '') :\n this.watermark\n );\n }\n inp.className = cssClass || this.fltCssClass;\n addEvt(inp, 'focus', (evt) => this.onInpFocus(evt));\n\n //filter is appended in custom element\n if (externalFltTgtId) {\n elm(externalFltTgtId).appendChild(inp);\n } else {\n container.appendChild(inp);\n }\n\n this.fltIds.push(inp.id);\n\n addEvt(inp, 'keypress', (evt) => this.detectKey(evt));\n addEvt(inp, 'keydown', () => this.onKeyDown());\n addEvt(inp, 'keyup', (evt) => this.onKeyUp(evt));\n addEvt(inp, 'blur', () => this.onInpBlur());\n }\n\n /**\n * Build submit button\n * @param {DOMElement} container Container DOM element\n */\n _buildSubmitButton(container) {\n let btn = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnText]\n );\n btn.className = this.btnCssClass;\n\n //filter is appended in container element\n container.appendChild(btn);\n\n addEvt(btn, 'click', () => this.filter());\n }\n\n /**\n * Istantiate the collection of features required by the\n * configuration and add them to the features registry. A feature is\n * described by a `class` and `name` fields and and optional `property`\n * field:\n * {\n * class: AClass,\n * name: 'aClass'\n * }\n * @param {Array} [features=[]]\n * @private\n */\n instantiateFeatures(features = []) {\n features.forEach((feature) => {\n // TODO: remove the property field.\n // Due to naming convention inconsistencies, a `property`\n // field is added to allow a conditional instanciation based\n // on that property on TableFilter, if supplied.\n feature.property = feature.property || feature.name;\n if (!this.hasConfig || this[feature.property] === true ||\n feature.enforce === true) {\n let {class: Cls, name} = feature;\n\n this.Mod[name] = this.Mod[name] || new Cls(this);\n }\n });\n }\n\n /**\n * Initialise the passed features collection. A feature is described by a\n * `class` and `name` fields and and optional `property` field:\n * {\n * class: AClass,\n * name: 'aClass'\n * }\n * @param {Array} [features=[]]\n * @private\n */\n initFeatures(features = []) {\n features.forEach((feature) => {\n let {property, name} = feature;\n if (this[property] === true && this.Mod[name]) {\n this.Mod[name].init();\n }\n });\n }\n\n /**\n * Return a feature instance for a given name\n * @param {String} name Name of the feature\n * @return {Object}\n */\n feature(name) {\n return this.Mod[name];\n }\n\n /**\n * Initialise all the extensions defined in the configuration object\n */\n initExtensions() {\n let exts = this.extensions;\n if (exts.length === 0) {\n return;\n }\n\n // Set config's publicPath dynamically for Webpack...\n __webpack_public_path__ = this.basePath;\n\n this.emitter.emit('before-loading-extensions', this);\n\n exts.forEach((ext) => {\n this.loadExtension(ext);\n });\n this.emitter.emit('after-loading-extensions', this);\n }\n\n /**\n * Load an extension module\n * @param {Object} ext Extension config object\n */\n loadExtension(ext) {\n if (!ext || !ext.name || this.hasExtension(ext.name)) {\n return;\n }\n\n let {name, path} = ext;\n let modulePath;\n\n if (name && path) {\n modulePath = ext.path + name;\n } else {\n name = name.replace('.js', '');\n modulePath = 'extensions/{}/{}'.replace(/{}/g, name);\n }\n\n // Require pattern for Webpack\n require(['./' + modulePath], (mod) => {\n /* eslint-disable */\n let inst = new mod.default(this, ext);\n /* eslint-enable */\n inst.init();\n this.ExtRegistry[name] = inst;\n });\n }\n\n /**\n * Get an extension instance\n * @param {String} name Name of the extension\n * @return {Object} Extension instance\n */\n extension(name) {\n return this.ExtRegistry[name];\n }\n\n /**\n * Check passed extension name exists\n * @param {String} name Name of the extension\n * @return {Boolean}\n */\n hasExtension(name) {\n return !isEmpty(this.ExtRegistry[name]);\n }\n\n /**\n * Register the passed extension instance with associated name\n * @param {Object} inst Extension instance\n * @param {String} name Name of the extension\n */\n registerExtension(inst, name) {\n this.ExtRegistry[name] = inst;\n }\n\n /**\n * Destroy all the extensions store in extensions registry\n */\n destroyExtensions() {\n let reg = this.ExtRegistry;\n\n Object.keys(reg).forEach((key) => {\n reg[key].destroy();\n reg[key] = undefined;\n });\n }\n\n /**\n * Load themes defined in the configuration object\n */\n loadThemes() {\n if (!this.hasThemes) {\n return;\n }\n\n let themes = this.themes;\n this.emitter.emit('before-loading-themes', this);\n\n //Default theme config\n if (this.enableDefaultTheme) {\n let defaultTheme = { name: 'default' };\n this.themes.push(defaultTheme);\n }\n\n themes.forEach((theme, i) => {\n let {name, path} = theme;\n let styleId = this.prfxTf + name;\n if (name && !path) {\n path = this.themesPath + name + '/' + name + '.css';\n }\n else if (!name && theme.path) {\n name = 'theme{0}'.replace('{0}', i);\n }\n\n if (!this.isImported(path, 'link')) {\n this.import(styleId, path, null, 'link');\n }\n });\n\n // Enable loader indicator\n this.loader = true;\n\n this.emitter.emit('after-loading-themes', this);\n }\n\n /**\n * Return stylesheet DOM element for a given theme name\n * @return {DOMElement} stylesheet element\n */\n getStylesheet(name = 'default') {\n return elm(this.prfxTf + name);\n }\n\n /**\n * Destroy filter grid\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n let emitter = this.emitter;\n\n if (this.isExternalFlt() && !this.popupFilters) {\n this.removeExternalFlts();\n }\n\n this.destroyExtensions();\n\n this.validateAllRows();\n\n // broadcast destroy event modules and extensions are subscribed to\n emitter.emit('destroy', this);\n\n if (this.fltGrid && !this.gridLayout) {\n this.dom().deleteRow(this.filtersRowIndex);\n }\n\n // unsubscribe to events\n if (this.hasExcludedRows) {\n emitter.off(['after-filtering'], () => this.setExcludeRows());\n }\n if (this.linkedFilters) {\n emitter.off(['after-filtering'], () => this.linkFilters());\n }\n this.emitter.off(['filter-focus'],\n (tf, filter) => this.setActiveFilterId(filter.id));\n\n removeClass(this.dom(), this.prfxTf);\n removeClass(this.dom(), this.prfxResponsive);\n\n this.nbHiddenRows = 0;\n this.validRowsIndex = [];\n this.fltIds = [];\n this.initialized = false;\n }\n\n /**\n * Remove all the external column filters\n */\n removeExternalFlts() {\n if (!this.isExternalFlt()) {\n return;\n }\n let ids = this.externalFltIds;\n ids.forEach((id) => {\n let externalFlt = elm(id);\n if (externalFlt) {\n externalFlt.innerHTML = '';\n }\n });\n }\n\n /**\n * Check if given column implements a filter with custom options\n * @param {Number} colIndex Column's index\n * @return {Boolean}\n */\n isCustomOptions(colIndex) {\n return this.hasCustomOptions &&\n this.customOptions.cols.indexOf(colIndex) !== -1;\n }\n\n /**\n * Returns an array [[value0, value1 ...],[text0, text1 ...]] with the\n * custom options values and texts\n * @param {Number} colIndex Column's index\n * @return {Array}\n */\n getCustomOptions(colIndex) {\n if (isEmpty(colIndex) || !this.isCustomOptions(colIndex)) {\n return;\n }\n\n let customOptions = this.customOptions;\n let cols = customOptions.cols;\n let optTxt = [], optArray = [];\n let index = cols.indexOf(colIndex);\n let slcValues = customOptions.values[index];\n let slcTexts = customOptions.texts[index];\n let slcSort = customOptions.sorts[index];\n\n for (let r = 0, len = slcValues.length; r < len; r++) {\n optArray.push(slcValues[r]);\n if (slcTexts[r]) {\n optTxt.push(slcTexts[r]);\n } else {\n optTxt.push(slcValues[r]);\n }\n }\n if (slcSort) {\n optArray.sort();\n optTxt.sort();\n }\n return [optArray, optTxt];\n }\n\n /**\n * Filter the table by retrieving the data from each cell in every single\n * row and comparing it to the search term for current column. A row is\n * hidden when all the search terms are not found in inspected row.\n */\n filter() {\n if (!this.fltGrid || !this.initialized) {\n return;\n }\n\n let emitter = this.emitter;\n\n //fire onbefore callback\n this.onBeforeFilter(this);\n emitter.emit('before-filtering', this);\n\n let hiddenRows = 0;\n\n this.validRowsIndex = [];\n // search args\n let searchArgs = this.getFiltersValue();\n\n let eachRow = this.eachRow();\n eachRow(\n (row, k) => {\n // already filtered rows display re-init\n row.style.display = '';\n\n let cells = row.cells;\n let nbCells = cells.length;\n\n let occurence = [],\n isMatch = true,\n //only for single filter search\n isSingleFltMatch = false;\n\n // this loop retrieves cell data\n for (let j = 0; j < nbCells; j++) {\n //searched keyword\n let sA = searchArgs[this.singleFlt ? 0 : j];\n\n if (sA === '') {\n continue;\n }\n\n let cellValue = matchCase(this.getCellValue(cells[j]),\n this.caseSensitive);\n\n //multiple search parameter operator ||\n let sAOrSplit = sA.toString().split(this.orOperator),\n //multiple search || parameter boolean\n hasMultiOrSA = sAOrSplit.length > 1,\n //multiple search parameter operator &&\n sAAndSplit = sA.toString().split(this.anOperator),\n //multiple search && parameter boolean\n hasMultiAndSA = sAAndSplit.length > 1;\n\n //detect operators or array query\n if (isArray(sA) || hasMultiOrSA || hasMultiAndSA) {\n let cS, s;\n let found = false;\n\n if (isArray(sA)) {\n s = sA;\n } else {\n s = hasMultiOrSA ? sAOrSplit : sAAndSplit;\n }\n // isolate search term and check occurence in cell data\n for (let w = 0, len = s.length; w < len; w++) {\n cS = trim(s[w]);\n found = this._match(cS, cellValue, j);\n\n if (found) {\n emitter.emit('highlight-keyword', this,\n cells[j], cS);\n }\n if ((hasMultiOrSA && found) ||\n (hasMultiAndSA && !found)) {\n break;\n }\n if (isArray(sA) && found) {\n break;\n }\n }\n occurence[j] = found;\n\n }\n //single search parameter\n else {\n occurence[j] = this._match(trim(sA), cellValue, j);\n if (occurence[j]) {\n emitter.emit('highlight-keyword', this, cells[j],\n sA);\n }\n }\n\n if (!occurence[j]) {\n isMatch = false;\n }\n\n if (this.singleFlt &&\n this.singleFltExcludeCols.indexOf(j) === -1 &&\n occurence[j]) {\n isSingleFltMatch = true;\n }\n\n emitter.emit('cell-processed', this, j, cells[j]);\n }//for j\n\n if (isSingleFltMatch) {\n isMatch = true;\n }\n\n this.validateRow(k, isMatch);\n if (!isMatch) {\n hiddenRows++;\n }\n\n emitter.emit('row-processed', this, k,\n this.validRowsIndex.length, isMatch);\n },\n // continue condition\n (row) => row.cells.length !== this.nbCells\n );\n\n this.nbHiddenRows = hiddenRows;\n\n //fire onafterfilter callback\n this.onAfterFilter(this);\n\n emitter.emit('after-filtering', this, searchArgs);\n }\n\n /**\n * Match search term in cell data\n * @param {String} term Search term\n * @param {String} cellValue Cell data\n * @param {Number} colIdx Column index\n * @return {Boolean}\n * @private\n */\n _match(term, cellValue, colIdx) {\n let numData;\n let decimal = this.getDecimal(colIdx);\n let reLe = new RegExp(this.leOperator),\n reGe = new RegExp(this.geOperator),\n reL = new RegExp(this.lwOperator),\n reG = new RegExp(this.grOperator),\n reD = new RegExp(this.dfOperator),\n reLk = new RegExp(rgxEsc(this.lkOperator)),\n reEq = new RegExp(this.eqOperator),\n reSt = new RegExp(this.stOperator),\n reEn = new RegExp(this.enOperator),\n // re_an = new RegExp(this.anOperator),\n // re_cr = new RegExp(this.curExp),\n reEm = this.emOperator,\n reNm = this.nmOperator,\n reRe = new RegExp(rgxEsc(this.rgxOperator));\n\n term = matchCase(term, this.caseSensitive);\n\n let occurence = false;\n\n //Search arg operator tests\n let hasLO = reL.test(term),\n hasLE = reLe.test(term),\n hasGR = reG.test(term),\n hasGE = reGe.test(term),\n hasDF = reD.test(term),\n hasEQ = reEq.test(term),\n hasLK = reLk.test(term),\n // hatermN = re_an.test(term),\n hasST = reSt.test(term),\n hasEN = reEn.test(term),\n hasEM = (reEm === term),\n hasNM = (reNm === term),\n hasRE = reRe.test(term);\n\n // Check for dates or resolve date type\n if (this.hasType(colIdx, [DATE])) {\n let dte1, dte2;\n\n let dateType = this.Mod.dateType;\n let isValidDate = dateType.isValid.bind(dateType);\n let parseDate = dateType.parse.bind(dateType);\n let locale = dateType.getLocale(colIdx);\n\n // Search arg dates tests\n let isLDate = hasLO &&\n isValidDate(term.replace(reL, ''), locale);\n let isLEDate = hasLE &&\n isValidDate(term.replace(reLe, ''), locale);\n let isGDate = hasGR &&\n isValidDate(term.replace(reG, ''), locale);\n let isGEDate = hasGE &&\n isValidDate(term.replace(reGe, ''), locale);\n let isDFDate = hasDF &&\n isValidDate(term.replace(reD, ''), locale);\n let isEQDate = hasEQ &&\n isValidDate(term.replace(reEq, ''), locale);\n\n dte1 = parseDate(cellValue, locale);\n\n // lower equal date\n if (isLEDate) {\n dte2 = parseDate(term.replace(reLe, ''), locale);\n occurence = dte1 <= dte2;\n }\n // lower date\n else if (isLDate) {\n dte2 = parseDate(term.replace(reL, ''), locale);\n occurence = dte1 < dte2;\n }\n // greater equal date\n else if (isGEDate) {\n dte2 = parseDate(term.replace(reGe, ''), locale);\n occurence = dte1 >= dte2;\n }\n // greater date\n else if (isGDate) {\n dte2 = parseDate(term.replace(reG, ''), locale);\n occurence = dte1 > dte2;\n }\n // different date\n else if (isDFDate) {\n dte2 = parseDate(term.replace(reD, ''), locale);\n occurence = dte1.toString() !== dte2.toString();\n }\n // equal date\n else if (isEQDate) {\n dte2 = parseDate(term.replace(reEq, ''), locale);\n occurence = dte1.toString() === dte2.toString();\n }\n // searched keyword with * operator doesn't have to be a date\n else if (reLk.test(term)) {// like date\n occurence = contains(term.replace(reLk, ''), cellValue,\n false, this.caseSensitive);\n }\n else if (isValidDate(term)) {\n dte2 = parseDate(term, locale);\n occurence = dte1.toString() === dte2.toString();\n }\n //empty\n else if (hasEM) {\n occurence = isEmptyString(cellValue);\n }\n //non-empty\n else if (hasNM) {\n occurence = !isEmptyString(cellValue);\n } else {\n occurence = contains(term, cellValue,\n this.isExactMatch(colIdx), this.caseSensitive);\n }\n } else {\n // Convert to number anyways to auto-resolve type in case not\n // defined by configuration. Order is important first try to\n // parse formatted number then fallback to Number coercion\n // to avoid false positives with Number\n numData = parseNb(cellValue, decimal) || Number(cellValue);\n\n // first checks if there is any operator (<,>,<=,>=,!,*,=,{,},\n // rgx:)\n\n //regexp\n if (hasRE) {\n //in case regexp throws\n try {\n //operator is removed\n let srchArg = term.replace(reRe, '');\n let rgx = new RegExp(srchArg);\n occurence = rgx.test(cellValue);\n } catch (ex) {\n occurence = false;\n }\n }\n // lower equal\n else if (hasLE) {\n occurence = numData <= parseNb(\n term.replace(reLe, ''),\n decimal\n );\n }\n //greater equal\n else if (hasGE) {\n occurence = numData >= parseNb(\n term.replace(reGe, ''),\n decimal\n );\n }\n //lower\n else if (hasLO) {\n occurence = numData < parseNb(\n term.replace(reL, ''),\n decimal\n );\n }\n //greater\n else if (hasGR) {\n occurence = numData > parseNb(\n term.replace(reG, ''),\n decimal\n );\n }\n //different\n else if (hasDF) {\n occurence = contains(term.replace(reD, ''), cellValue,\n false, this.caseSensitive) ? false : true;\n }\n //like\n else if (hasLK) {\n occurence = contains(term.replace(reLk, ''), cellValue,\n false, this.caseSensitive);\n }\n //equal\n else if (hasEQ) {\n occurence = contains(term.replace(reEq, ''), cellValue,\n true, this.caseSensitive);\n }\n //starts with\n else if (hasST) {\n occurence = cellValue.indexOf(term.replace(reSt, '')) === 0 ?\n true : false;\n }\n //ends with\n else if (hasEN) {\n let searchArg = term.replace(reEn, '');\n occurence =\n cellValue.lastIndexOf(searchArg, cellValue.length - 1) ===\n (cellValue.length - 1) - (searchArg.length - 1) &&\n cellValue.lastIndexOf(searchArg, cellValue.length - 1)\n > -1 ? true : false;\n }\n //empty\n else if (hasEM) {\n occurence = isEmptyString(cellValue);\n }\n //non-empty\n else if (hasNM) {\n occurence = !isEmptyString(cellValue);\n } else {\n // If numeric type data, perform a strict equality test and\n // fallback to unformatted number string comparison\n if (numData &&\n this.hasType(colIdx, [NUMBER, FORMATTED_NUMBER]) &&\n !this.singleFlt) {\n // parseNb can return 0 for strings which are not\n // formatted numbers, in that case return the original\n // string. TODO: handle this in parseNb\n term = parseNb(term, decimal) || term;\n occurence = numData === term ||\n contains(term.toString(), numData.toString(),\n this.isExactMatch(colIdx), this.caseSensitive);\n } else {\n // Finally test search term is contained in cell data\n occurence = contains(\n term,\n cellValue,\n this.isExactMatch(colIdx),\n this.caseSensitive,\n this.ignoresDiacritics(colIdx)\n );\n }\n }\n\n }//else\n\n return occurence;\n }\n\n /**\n * Return the data of a specified column\n * @param {Number} colIndex Column index\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Array} [exclude=[]] List of row indexes to be excluded\n * @return Flat list of data for a column\n */\n getColumnData(colIndex, includeHeaders = false, exclude = []) {\n return this.getColValues(colIndex, includeHeaders, true, exclude);\n }\n\n /**\n * Return the values of a specified column\n * @param {Number} colIndex Column index\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Array} [exclude=[]] List of row indexes to be excluded\n * @return Flat list of values for a column\n */\n getColumnValues(colIndex, includeHeaders = false, exclude = []) {\n return this.getColValues(colIndex, includeHeaders, false, exclude);\n }\n\n /**\n * Return the data of a specified column\n * @param {Number} colIndex Column index\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [typed=false] Return a typed value\n * @param {Array} [exclude=[]] List of row indexes to be excluded\n * @return {Array} Flat list of data for a column\n * @private\n */\n getColValues(\n colIndex,\n includeHeaders = false,\n typed = false,\n exclude = []\n ) {\n let colValues = [];\n let getContent = typed ? this.getCellData.bind(this) :\n this.getCellValue.bind(this);\n\n if (includeHeaders) {\n colValues.push(this.getHeadersText()[colIndex]);\n }\n\n let eachRow = this.eachRow();\n eachRow((row, i) => {\n // checks if current row index appears in exclude array\n let isExludedRow = exclude.indexOf(i) !== -1;\n let cells = row.cells;\n\n // checks if row has exact cell # and is not excluded\n if (cells.length === this.nbCells && !isExludedRow) {\n let data = getContent(cells[colIndex]);\n colValues.push(data);\n }\n });\n return colValues;\n }\n\n /**\n * Return the filter's value of a specified column\n * @param {Number} index Column index\n * @return {String} Filter value\n */\n getFilterValue(index) {\n if (!this.fltGrid) {\n return;\n }\n let fltValue = '';\n let flt = this.getFilterElement(index);\n if (!flt) {\n return fltValue;\n }\n\n let fltColType = this.getFilterType(index);\n if (fltColType !== MULTIPLE && fltColType !== CHECKLIST) {\n fltValue = flt.value;\n }\n //mutiple select\n else if (fltColType === MULTIPLE) {\n fltValue = this.feature('dropdown').getValues(index);\n }\n //checklist\n else if (fltColType === CHECKLIST) {\n fltValue = this.feature('checkList').getValues(index);\n }\n //return an empty string if collection is empty or contains a single\n //empty string\n if (isArray(fltValue) && fltValue.length === 0 ||\n (fltValue.length === 1 && fltValue[0] === '')) {\n fltValue = '';\n }\n\n return fltValue;\n }\n\n /**\n * Return the filters' values\n * @return {Array} List of filters' values\n */\n getFiltersValue() {\n if (!this.fltGrid) {\n return;\n }\n let searchArgs = [];\n\n this.fltIds.forEach((id, i) => {\n let fltValue = this.getFilterValue(i);\n if (isArray(fltValue)) {\n searchArgs.push(fltValue);\n } else {\n searchArgs.push(trim(fltValue));\n }\n });\n return searchArgs;\n }\n\n /**\n * Return the ID of a specified column's filter\n * @param {Number} index Column's index\n * @return {String} ID of the filter element\n */\n getFilterId(index) {\n if (!this.fltGrid) {\n return;\n }\n return this.fltIds[index];\n }\n\n /**\n * Return the list of ids of filters matching a specified type.\n * Note: hidden filters are also returned\n *\n * @param {String} type Filter type string ('input', 'select', 'multiple',\n * 'checklist')\n * @param {Boolean} bool If true returns columns indexes instead of IDs\n * @return {[type]} List of element IDs or column indexes\n */\n getFiltersByType(type, bool) {\n if (!this.fltGrid) {\n return;\n }\n let arr = [];\n for (let i = 0, len = this.fltIds.length; i < len; i++) {\n let fltType = this.getFilterType(i);\n if (fltType === type.toLowerCase()) {\n let a = bool ? i : this.fltIds[i];\n arr.push(a);\n }\n }\n return arr;\n }\n\n /**\n * Return the filter's DOM element for a given column\n * @param {Number} index Column's index\n * @return {DOMElement}\n */\n getFilterElement(index) {\n return elm(this.fltIds[index]);\n }\n\n /**\n * Return the number of cells for a given row index\n * @param {Number} rowIndex Index of the row\n * @return {Number} Number of cells\n */\n getCellsNb(rowIndex = 0) {\n let tr = this.dom().rows[rowIndex >= 0 ? rowIndex : 0];\n return tr ? tr.cells.length : 0;\n }\n\n /**\n * Return the number of working rows starting from reference row if\n * defined\n * @param {Boolean} includeHeaders Include the headers row(s)\n * @return {Number} Number of working rows\n */\n getRowsNb(includeHeaders) {\n let nbRows = this.getWorkingRows().length;\n if (this.dom().tHead) {\n return includeHeaders ?\n nbRows + this.dom().querySelectorAll('thead > tr').length :\n nbRows;\n }\n return includeHeaders ? nbRows : nbRows - this.refRow;\n }\n\n /**\n * Return the collection of the working rows, that is, the rows belonging\n * to the tbody section(s)\n * @returns {Array}\n */\n getWorkingRows() {\n return doc.querySelectorAll(`table#${this.id} > tbody > tr`);\n }\n\n /**\n * Return the text content of a given cell\n * @param {DOMElement} Cell's DOM element\n * @return {String}\n */\n getCellValue(cell) {\n let idx = cell.cellIndex;\n let cellParser = this.cellParser;\n // Invoke cellParser for this column if any\n if (cellParser.cols.indexOf(idx) !== -1) {\n return cellParser.parse(this, cell, idx);\n } else {\n return getText(cell);\n }\n }\n\n /**\n * Return the typed data of a given cell based on the column type definition\n * @param {DOMElement} cell Cell's DOM element\n * @return {String|Number|Date}\n */\n getCellData(cell) {\n let colIndex = cell.cellIndex;\n let value = this.getCellValue(cell);\n\n if (this.hasType(colIndex, [FORMATTED_NUMBER])) {\n return parseNb(value, this.getDecimal(colIndex));\n }\n else if (this.hasType(colIndex, [NUMBER])) {\n return Number(value);\n }\n else if (this.hasType(colIndex, [DATE])){\n let dateType = this.Mod.dateType;\n return dateType.parse(value, dateType.getLocale(colIndex));\n }\n\n return value;\n }\n\n /**\n * Return the table data based on its columns data type definitions\n * with following structure:\n * [\n * [rowIndex, [data0, data1...]],\n * [rowIndex, [data0, data1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @return {Array}\n */\n getData(includeHeaders = false, excludeHiddenCols = false) {\n return this.getTableData(includeHeaders, excludeHiddenCols, true);\n }\n\n /**\n * Return the table values with following structure:\n * [\n * [rowIndex, [value0, value1...]],\n * [rowIndex, [value0, value1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @return {Array}\n */\n getValues(includeHeaders = false, excludeHiddenCols = false) {\n return this.getTableData(includeHeaders, excludeHiddenCols, false);\n }\n\n /**\n * Return the table data with following structure:\n * [\n * [rowIndex, [value0, value1...]],\n * [rowIndex, [value0, value1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @param {Boolean} [typed=false] Return typed value\n * @return {Array}\n * @private\n *\n * TODO: provide an API returning data in JSON format\n */\n getTableData(\n includeHeaders = false,\n excludeHiddenCols = false,\n typed = false\n ) {\n let tblData = [];\n let getContent = typed ? this.getCellData.bind(this) :\n this.getCellValue.bind(this);\n\n if (includeHeaders) {\n let headers = this.getHeadersText(excludeHiddenCols);\n tblData.push([this.getHeadersRowIndex(), headers]);\n }\n\n let eachRow = this.eachRow();\n eachRow((row, k) => {\n let rowData = [k, []];\n let cells = row.cells;\n for (let j = 0, len = cells.length; j < len; j++) {\n if (excludeHiddenCols && this.hasExtension('colsVisibility')) {\n if (this.extension('colsVisibility').isColHidden(j)) {\n continue;\n }\n }\n let cellContent = getContent(cells[j]);\n rowData[1].push(cellContent);\n }\n tblData.push(rowData);\n });\n return tblData;\n }\n\n /**\n * Return the filtered table data based on its columns data type definitions\n * with following structure:\n * [\n * [rowIndex, [data0, data1...]],\n * [rowIndex, [data0, data1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @return {Array}\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredData(includeHeaders = false, excludeHiddenCols = false) {\n return this.filteredData(includeHeaders, excludeHiddenCols, true);\n }\n\n /**\n * Return the filtered table values with following structure:\n * [\n * [rowIndex, [value0, value1...]],\n * [rowIndex, [value0, value1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @return {Array}\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredValues(includeHeaders = false, excludeHiddenCols = false) {\n return this.filteredData(includeHeaders, excludeHiddenCols, false);\n }\n\n /**\n * Return the filtered data with following structure:\n * [\n * [rowIndex, [value0, value1...]],\n * [rowIndex, [value0, value1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @param {Boolean} [typed=false] Return typed value\n * @return {Array}\n * @private\n *\n * TODO: provide an API returning data in JSON format\n */\n filteredData(\n includeHeaders = false,\n excludeHiddenCols = false,\n typed = false\n ) {\n if (this.validRowsIndex.length === 0) {\n return [];\n }\n let rows = this.dom().rows,\n filteredData = [];\n let getContent = typed ? this.getCellData.bind(this) :\n this.getCellValue.bind(this);\n\n if (includeHeaders) {\n let headers = this.getHeadersText(excludeHiddenCols);\n filteredData.push([this.getHeadersRowIndex(), headers]);\n }\n\n let validRows = this.getValidRows(true);\n for (let i = 0; i < validRows.length; i++) {\n let rData = [this.validRowsIndex[i], []],\n cells = rows[this.validRowsIndex[i]].cells;\n for (let k = 0; k < cells.length; k++) {\n if (excludeHiddenCols && this.hasExtension('colsVisibility')) {\n if (this.extension('colsVisibility').isColHidden(k)) {\n continue;\n }\n }\n let cellValue = getContent(cells[k]);\n rData[1].push(cellValue);\n }\n filteredData.push(rData);\n }\n return filteredData;\n }\n\n /**\n * Return the filtered data for a given column index\n * @param {any} colIndex Colmun's index\n * @param {boolean} [includeHeaders=false] Optional Include headers row\n * @param {any} [exclude=[]] Optional List of row indexes to be excluded\n * @return {Array} Flat list of typed values [data0, data1, data2...]\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredColumnData(colIndex, includeHeaders = false, exclude = []) {\n return this.getFilteredDataCol(\n colIndex, includeHeaders, true, exclude, false);\n }\n\n /**\n * Return the filtered and visible data for a given column index\n * @param {any} colIndex Colmun's index\n * @param {boolean} [includeHeaders=false] Optional Include headers row\n * @param {any} [exclude=[]] Optional List of row indexes to be excluded\n * @return {Array} Flat list of typed values [data0, data1, data2...]\n *\n * TODO: provide an API returning data in JSON format\n */\n getVisibleColumnData(colIndex, includeHeaders = false, exclude = []) {\n return this.getFilteredDataCol(\n colIndex, includeHeaders, true, exclude, true);\n }\n\n /**\n * Return the filtered values for a given column index\n * @param {any} colIndex Colmun's index\n * @param {boolean} [includeHeaders=false] Optional Include headers row\n * @param {any} [exclude=[]] Optional List of row indexes to be excluded\n * @return {Array} Flat list of values ['value0', 'value1', 'value2'...]\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredColumnValues(colIndex, includeHeaders = false, exclude = []) {\n return this.getFilteredDataCol(\n colIndex, includeHeaders, false, exclude, false);\n }\n\n /**\n * Return the filtered and visible values for a given column index\n * @param {any} colIndex Colmun's index\n * @param {boolean} [includeHeaders=false] Optional Include headers row\n * @param {any} [exclude=[]] Optional List of row indexes to be excluded\n * @return {Array} Flat list of values ['value0', 'value1', 'value2'...]\n *\n * TODO: provide an API returning data in JSON format\n */\n getVisibleColumnValues(colIndex, includeHeaders = false, exclude = []) {\n return this.getFilteredDataCol(\n colIndex, includeHeaders, false, exclude, true);\n }\n\n /**\n * Return the filtered data for a given column index\n * @param {Number} colIndex Colmun's index\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [typed=false] Return typed value\n * @param {Array} [exclude=[]] List of row indexes to be excluded\n * @param {Boolean} [visible=true] Return only filtered and visible data\n * (relevant for paging)\n * @return {Array} Flat list of values ['val0','val1','val2'...]\n * @private\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredDataCol(\n colIndex,\n includeHeaders = false,\n typed = false,\n exclude = [],\n visible = true\n ) {\n if (isUndef(colIndex)) {\n return [];\n }\n\n let rows = this.dom().rows;\n let getContent = typed ? this.getCellData.bind(this) :\n this.getCellValue.bind(this);\n\n // ensure valid rows index do not contain excluded rows and row is\n // displayed\n let validRows = this.getValidRows(true).filter((rowIdx) => {\n return exclude.indexOf(rowIdx) === -1 &&\n (visible ?\n this.getRowDisplay(rows[rowIdx]) !== 'none' :\n true);\n });\n\n // convert column value to expected type if necessary\n let validColValues = validRows.map((rowIdx) => {\n return getContent(rows[rowIdx].cells[colIndex]);\n });\n\n if (includeHeaders) {\n validColValues.unshift(this.getHeadersText()[colIndex]);\n }\n\n return validColValues;\n }\n\n /**\n * Get the display value of a row\n * @param {HTMLTableRowElement} row DOM element of the row\n * @return {String} Usually 'none' or ''\n */\n getRowDisplay(row) {\n return row.style.display;\n }\n\n /**\n * Validate/invalidate row by setting the 'validRow' attribute on the row\n * @param {Number} rowIndex Index of the row\n * @param {Boolean} isValid\n */\n validateRow(rowIndex, isValid) {\n let row = this.dom().rows[rowIndex];\n if (!row || !isBoolean(isValid)) {\n return;\n }\n\n // always visible rows are valid\n if (this.excludeRows.indexOf(rowIndex) !== -1) {\n isValid = true;\n }\n\n let displayFlag = isValid ? '' : NONE,\n validFlag = isValid ? 'true' : 'false';\n row.style.display = displayFlag;\n\n if (this.paging) {\n row.setAttribute('validRow', validFlag);\n }\n\n if (isValid) {\n if (this.validRowsIndex.indexOf(rowIndex) === -1) {\n this.validRowsIndex.push(rowIndex);\n }\n\n this.onRowValidated(this, rowIndex);\n this.emitter.emit('row-validated', this, rowIndex);\n }\n }\n\n /**\n * Validate all filterable rows\n */\n validateAllRows() {\n if (!this.initialized) {\n return;\n }\n this.validRowsIndex = [];\n for (let k = this.refRow; k < this.nbFilterableRows; k++) {\n this.validateRow(k, true);\n }\n }\n\n /**\n * Set search value to a given filter\n * @param {Number} index Column's index\n * @param {String or Array} query searcharg Search term\n */\n setFilterValue(index, query = '') {\n if (!this.fltGrid) {\n return;\n }\n let slc = this.getFilterElement(index),\n fltColType = this.getFilterType(index);\n\n if (!slc) {\n return;\n }\n\n if (fltColType !== MULTIPLE && fltColType !== CHECKLIST) {\n if (this.loadFltOnDemand && !this.initialized) {\n this.emitter.emit('build-select-filter', this, index,\n this.linkedFilters, this.isExternalFlt());\n }\n slc.value = query;\n }\n //multiple selects\n else if (fltColType === MULTIPLE) {\n let values = isArray(query) ? query :\n query.split(' ' + this.orOperator + ' ');\n\n if (this.loadFltOnDemand && !this.initialized) {\n this.emitter.emit('build-select-filter', this, index,\n this.linkedFilters, this.isExternalFlt());\n }\n\n this.emitter.emit('select-options', this, index, values);\n }\n //checklist\n else if (fltColType === CHECKLIST) {\n let values = [];\n if (this.loadFltOnDemand && !this.initialized) {\n this.emitter.emit('build-checklist-filter', this, index,\n this.linkedFilters);\n }\n if (isArray(query)) {\n values = query;\n } else {\n query = matchCase(query, this.caseSensitive);\n values = query.split(' ' + this.orOperator + ' ');\n }\n\n this.emitter.emit('select-checklist-options', this, index, values);\n }\n }\n\n /**\n * Set them columns' widths as per configuration\n * @param {Element} tbl DOM element\n */\n setColWidths(tbl) {\n let colWidths = this.colWidths;\n if (colWidths.length === 0) {\n return;\n }\n\n tbl = tbl || this.dom();\n\n let colTags = tag(tbl, 'col');\n let tblHasColTag = colTags.length > 0;\n let frag = !tblHasColTag ? doc.createDocumentFragment() : null;\n\n this.eachCol((k) => {\n let col;\n if (tblHasColTag) {\n col = colTags[k];\n } else {\n col = createElm('col');\n frag.appendChild(col);\n }\n col.style.width = colWidths[k];\n });\n\n if (!tblHasColTag) {\n tbl.insertBefore(frag, tbl.firstChild);\n }\n }\n\n /**\n * Exclude rows from actions\n */\n setExcludeRows() {\n if (!this.hasExcludedRows) {\n return;\n }\n this.excludeRows.forEach((rowIdx) => this.validateRow(rowIdx, true));\n }\n\n /**\n * Clear all the filters' values\n */\n clearFilters() {\n if (!this.fltGrid) {\n return;\n }\n\n this.emitter.emit('before-clearing-filters', this);\n this.onBeforeReset(this, this.getFiltersValue());\n\n for (let i = 0, len = this.fltIds.length; i < len; i++) {\n this.setFilterValue(i, '');\n }\n\n this.filter();\n\n this.onAfterReset(this);\n this.emitter.emit('after-clearing-filters', this);\n }\n\n /**\n * Return the ID of the current active filter\n * @return {String}\n */\n getActiveFilterId() {\n return this.activeFilterId;\n }\n\n /**\n * Set the ID of the current active filter\n * @param {String} filterId Element ID\n */\n setActiveFilterId(filterId) {\n this.activeFilterId = filterId;\n }\n\n /**\n * Return the column index for a given filter ID\n * @param {string} [filterId=''] Filter ID\n * @return {Number} Column index\n */\n getColumnIndexFromFilterId(filterId = '') {\n let idx = filterId.split('_')[0];\n idx = idx.split(this.prfxFlt)[1];\n return parseInt(idx, 10);\n }\n\n /**\n * Build filter element ID for a given column index\n * @param {any} colIndex\n * @return {String} Filter element ID string\n * @private\n */\n buildFilterId(colIndex) {\n return `${this.prfxFlt}${colIndex}_${this.id}`;\n }\n\n /**\n * Check if has external filters\n * @returns {Boolean}\n * @private\n */\n isExternalFlt() {\n return this.externalFltIds.length > 0;\n }\n\n /**\n * Returns styles path\n * @returns {String}\n * @private\n */\n getStylePath() {\n return defaultsStr(this.config.style_path, this.basePath + 'style/');\n }\n\n /**\n * Returns main stylesheet path\n * @returns {String}\n * @private\n */\n getStylesheetPath() {\n return defaultsStr(this.config.stylesheet,\n this.getStylePath() + 'tablefilter.css');\n }\n\n /**\n * Returns themes path\n * @returns {String}\n * @private\n */\n getThemesPath() {\n return defaultsStr(this.config.themes_path,\n this.getStylePath() + 'themes/');\n }\n\n /**\n * Make specified column's filter active\n * @param colIndex Index of a column\n */\n activateFilter(colIndex) {\n if (isUndef(colIndex)) {\n return;\n }\n this.setActiveFilterId(this.getFilterId(colIndex));\n }\n\n /**\n * Refresh the filters subject to linking ('select', 'multiple',\n * 'checklist' type)\n */\n linkFilters() {\n if (!this.linkedFilters || !this.activeFilterId) {\n return;\n }\n let slcA1 = this.getFiltersByType(SELECT, true),\n slcA2 = this.getFiltersByType(MULTIPLE, true),\n slcA3 = this.getFiltersByType(CHECKLIST, true),\n slcIndex = slcA1.concat(slcA2);\n slcIndex = slcIndex.concat(slcA3);\n\n slcIndex.forEach((colIdx) => {\n let curSlc = this.getFilterElement(colIdx);\n let slcSelectedValue = this.getFilterValue(colIdx);\n\n //1st option needs to be inserted\n if (this.loadFltOnDemand) {\n let opt0 = createOpt(this.getClearFilterText(colIdx), '');\n curSlc.innerHTML = '';\n curSlc.appendChild(opt0);\n }\n\n if (slcA3.indexOf(colIdx) !== -1) {\n this.emitter.emit('build-checklist-filter', this, colIdx,\n true);\n } else {\n this.emitter.emit('build-select-filter', this, colIdx,\n true);\n }\n\n this.setFilterValue(colIdx, slcSelectedValue);\n });\n }\n\n /**\n * Determine if passed filter column implements exact query match\n * @param {Number} colIndex Column index\n * @return {Boolean}\n */\n isExactMatch(colIndex) {\n let fltType = this.getFilterType(colIndex);\n return this.exactMatchByCol[colIndex] || this.exactMatch ||\n fltType !== INPUT;\n }\n\n /**\n * Check if passed row is valid\n * @param {Number} rowIndex Row index\n * @return {Boolean}\n */\n isRowValid(rowIndex) {\n return this.getValidRows().indexOf(rowIndex) !== -1;\n }\n\n /**\n * Check if passed row is visible\n * @param {Number} rowIndex Row index\n * @return {Boolean}\n */\n isRowDisplayed(rowIndex) {\n let row = this.dom().rows[rowIndex];\n return this.getRowDisplay(row) === '';\n }\n\n /**\n * Check if specified column filter ignores diacritics.\n * Note this is only applicable to input filter types.\n * @param {Number} colIndex Column index\n * @return {Boolean}\n */\n ignoresDiacritics(colIndex) {\n let ignoreDiac = this.ignoreDiacritics;\n if (isArray(ignoreDiac)) {\n return ignoreDiac[colIndex];\n }\n return Boolean(ignoreDiac);\n }\n\n /**\n * Return clear all text for specified filter column\n * @param {Number} colIndex Column index\n * @return {String}\n */\n getClearFilterText(colIndex) {\n let clearText = this.clearFilterText;\n if (isArray(clearText)) {\n return clearText[colIndex];\n }\n return clearText;\n }\n\n /**\n * Column iterator invoking continue and break condition callbacks if any\n * then calling supplied callback for each item\n * @param {Function} [fn=EMPTY_FN] callback\n * @param {Function} [continueFn=EMPTY_FN] continue condition callback\n * @param {Function} [breakFn=EMPTY_FN] break condition callback\n */\n eachCol(fn = EMPTY_FN, continueFn = EMPTY_FN, breakFn = EMPTY_FN) {\n let len = this.getCellsNb(this.refRow);\n for (let i = 0; i < len; i++) {\n if (continueFn(i) === true) {\n continue;\n }\n if (breakFn(i) === true) {\n break;\n }\n fn(i);\n }\n }\n\n /**\n * Rows iterator starting from supplied row index or defaulting to reference\n * row index. Closure function accepts a callback function and optional\n * continue and break callbacks.\n * @param {Number} startIdx Row index from which filtering starts\n */\n eachRow(startIdx = this.refRow) {\n return (fn = EMPTY_FN, continueFn = EMPTY_FN, breakFn = EMPTY_FN) => {\n let rows = this.dom().rows;\n let len = this.getRowsNb(true);\n for (let i = startIdx; i < len; i++) {\n if (continueFn(rows[i], i) === true) {\n continue;\n }\n if (breakFn(rows[i], i) === true) {\n break;\n }\n fn(rows[i], i);\n }\n };\n }\n\n /**\n * Check if passed script or stylesheet is already imported\n * @param {String} filePath Ressource path\n * @param {String} type Possible values: 'script' or 'link'\n * @return {Boolean}\n */\n isImported(filePath, type = 'script') {\n let imported = false,\n attr = type === 'script' ? 'src' : 'href',\n files = tag(doc, type);\n for (let i = 0, len = files.length; i < len; i++) {\n if (isUndef(files[i][attr])) {\n continue;\n }\n if (files[i][attr].match(filePath)) {\n imported = true;\n break;\n }\n }\n return imported;\n }\n\n /**\n * Import script or stylesheet\n * @param {String} fileId Ressource ID\n * @param {String} filePath Ressource path\n * @param {Function} callback Callback\n * @param {String} type Possible values: 'script' or 'link'\n */\n import(fileId, filePath, callback, type = 'script') {\n if (this.isImported(filePath, type)) {\n return;\n }\n let o = this,\n isLoaded = false,\n file,\n head = tag(doc, 'head')[0];\n\n if (type.toLowerCase() === 'link') {\n file = createElm('link',\n ['id', fileId], ['type', 'text/css'],\n ['rel', 'stylesheet'], ['href', filePath]\n );\n } else {\n file = createElm('script',\n ['id', fileId],\n ['type', 'text/javascript'], ['src', filePath]\n );\n }\n\n //Browser <> IE onload event works only for scripts, not for stylesheets\n file.onload = file.onreadystatechange = () => {\n if (!isLoaded &&\n (!this.readyState || this.readyState === 'loaded' ||\n this.readyState === 'complete')) {\n isLoaded = true;\n if (typeof callback === 'function') {\n callback.call(null, o);\n }\n }\n };\n file.onerror = () => {\n throw new Error(`TableFilter could not load: ${filePath}`);\n };\n head.appendChild(file);\n }\n\n /**\n * Check if table has filters grid\n * @return {Boolean}\n */\n isInitialized() {\n return this.initialized;\n }\n\n /**\n * Get list of filter IDs\n * @return {Array} List of filters ids\n */\n getFiltersId() {\n return this.fltIds || [];\n }\n\n /**\n * Get filtered (valid) rows indexes\n * @param {Boolean} reCalc Force calculation of filtered rows list\n * @return {Array} List of row indexes\n */\n getValidRows(reCalc) {\n if (!reCalc) {\n return this.validRowsIndex;\n }\n\n this.validRowsIndex = [];\n\n let eachRow = this.eachRow();\n eachRow((row) => {\n if (!this.paging) {\n if (this.getRowDisplay(row) !== NONE) {\n this.validRowsIndex.push(row.rowIndex);\n }\n } else {\n if (row.getAttribute('validRow') === 'true' ||\n row.getAttribute('validRow') === null) {\n this.validRowsIndex.push(row.rowIndex);\n }\n }\n });\n return this.validRowsIndex;\n }\n\n /**\n * Get the index of the row containing the filters\n * @return {Number}\n */\n getFiltersRowIndex() {\n return this.filtersRowIndex;\n }\n\n /**\n * Get the index of the headers row\n * @return {Number}\n */\n getHeadersRowIndex() {\n return this.headersRow;\n }\n\n /**\n * Get the row index from where the filtering process start (1st filterable\n * row)\n * @return {Number}\n */\n getStartRowIndex() {\n return this.refRow;\n }\n\n /**\n * Get the index of the last row\n * @return {Number}\n */\n getLastRowIndex() {\n let nbRows = this.getRowsNb(true);\n return (nbRows - 1);\n }\n\n /**\n * Determine whether the specified column has one of the passed types\n * @param {Number} colIndex Column index\n * @param {Array} [types=[]] List of column types\n * @return {Boolean}\n */\n hasType(colIndex, types = []) {\n if (this.colTypes.length === 0) {\n return false;\n }\n let colType = this.colTypes[colIndex];\n if (isObj(colType)) {\n colType = colType.type;\n }\n return types.indexOf(colType) !== -1;\n }\n\n /**\n * Get the header DOM element for a given column index\n * @param {Number} colIndex Column index\n * @return {Element}\n */\n getHeaderElement(colIndex) {\n let table = this.gridLayout ? this.Mod.gridLayout.headTbl : this.dom();\n let tHead = tag(table, 'thead');\n let rowIdx = this.getHeadersRowIndex();\n let header;\n if (tHead.length === 0) {\n header = table.rows[rowIdx].cells[colIndex];\n }\n if (tHead.length === 1) {\n header = tHead[0].rows[rowIdx].cells[colIndex];\n }\n return header;\n }\n\n /**\n * Return the list of headers' text\n * @param {Boolean} excludeHiddenCols Optional: exclude hidden columns\n * @return {Array} list of headers' text\n */\n getHeadersText(excludeHiddenCols = false) {\n let headers = [];\n this.eachCol(\n (j) => {\n let header = this.getHeaderElement(j);\n let headerText = getFirstTextNode(header);\n headers.push(headerText);\n },\n // continue condition function\n (j) => {\n if (excludeHiddenCols && this.hasExtension('colsVisibility')) {\n return this.extension('colsVisibility').isColHidden(j);\n }\n return false;\n }\n );\n return headers;\n }\n\n /**\n * Return the filter type for a specified column\n * @param {Number} colIndex Column's index\n * @return {String}\n */\n getFilterType(colIndex) {\n return this.filterTypes[colIndex];\n }\n\n /**\n * Get the total number of filterable rows\n * @return {Number}\n */\n getFilterableRowsNb() {\n return this.getRowsNb(false);\n }\n\n /**\n * Return the total number of valid rows\n * @param {Boolean} [reCalc=false] Forces calculation of filtered rows\n * @return {Number}\n */\n getValidRowsNb(reCalc = false) {\n return this.getValidRows(reCalc).length;\n }\n\n /**\n * Return the working DOM element\n * @return {HTMLTableElement}\n */\n dom() {\n return this.tbl;\n }\n\n /**\n * Return the decimal separator for supplied column as per column type\n * configuration or global setting\n * @param {Number} colIndex Column index\n * @returns {String} '.' or ','\n */\n getDecimal(colIndex) {\n let decimal = this.decimalSeparator;\n if (this.hasType(colIndex, [FORMATTED_NUMBER])) {\n let colType = this.colTypes[colIndex];\n if (colType.hasOwnProperty('decimal')) {\n decimal = colType.decimal;\n }\n }\n return decimal;\n }\n\n /**\n * Get the configuration object (literal object)\n * @return {Object}\n */\n config() {\n return this.cfg;\n }\n}\n",
+ "content": "import {addEvt, cancelEvt, stopEvt, targetEvt, isKeyPressed} from './event';\nimport {\n addClass, createElm, createOpt, elm, getText, getFirstTextNode,\n removeClass, tag\n} from './dom';\nimport {contains, matchCase, rgxEsc, trim} from './string';\nimport {isEmpty as isEmptyString} from './string';\nimport {\n isArray, isEmpty, isFn, isNumber, isObj, isString, isUndef, EMPTY_FN,\n isBoolean\n} from './types';\nimport {parse as parseNb} from './number';\nimport {\n defaultsBool, defaultsStr, defaultsFn,\n defaultsNb, defaultsArr\n} from './settings';\n\nimport {root} from './root';\nimport {Emitter} from './emitter';\nimport {Dropdown} from './modules/dropdown';\nimport {CheckList} from './modules/checkList';\n\nimport {\n INPUT, SELECT, MULTIPLE, CHECKLIST, NONE,\n ENTER_KEY, TAB_KEY, ESC_KEY, UP_ARROW_KEY, DOWN_ARROW_KEY,\n CELL_TAG, AUTO_FILTER_DELAY, NUMBER, DATE, FORMATTED_NUMBER,\n FEATURES\n} from './const';\n\nlet doc = root.document;\n\n/**\n * Makes HTML tables filterable and a bit more :)\n *\n * @export\n * @class TableFilter\n */\nexport class TableFilter {\n\n /**\n * Creates an instance of TableFilter\n * requires `table` or `id` arguments, `row` and `configuration` optional\n * @param {HTMLTableElement} table Table DOM element\n * @param {String} id Table id\n * @param {Number} row index indicating the 1st row\n * @param {Object} configuration object\n */\n constructor(...args) {\n /**\n * ID of current instance\n * @type {String}\n * @private\n */\n this.id = null;\n\n /**\n * Current version\n * @type {String}\n */\n this.version = '{VERSION}';\n\n /**\n * Current year\n * @type {Number}\n * @private\n */\n this.year = new Date().getFullYear();\n\n /**\n * HTML Table DOM element\n * @type {DOMElement}\n * @private\n */\n this.tbl = null;\n\n /**\n * Calculated row's index from which starts filtering once filters\n * are generated\n * @type {Number}\n */\n this.refRow = null;\n\n /**\n * Index of the headers row\n * @type {Number}\n * @private\n */\n this.headersRow = null;\n\n /**\n * Configuration object\n * @type {Object}\n * @private\n */\n this.cfg = {};\n\n /**\n * Number of rows that can be filtered\n * @type {Number}\n * @private\n */\n this.nbFilterableRows = 0;\n\n /**\n * Number of cells in the reference row\n * @type {Number}\n * @private\n */\n this.nbCells = null;\n\n /**\n * Has a configuration object\n * @type {Object}\n * @private\n */\n this.hasConfig = false;\n\n /** @private */\n this.initialized = false;\n\n let startRow;\n\n // TODO: use for-of\n args.forEach((arg) => {\n if (typeof arg === 'object' && arg.nodeName === 'TABLE') {\n this.tbl = arg;\n this.id = arg.id || `tf_${new Date().getTime()}_`;\n this.tbl.id = this.id;\n } else if (isString(arg)) {\n this.id = arg;\n this.tbl = elm(arg);\n } else if (isNumber(arg)) {\n startRow = arg;\n } else if (isObj(arg)) {\n this.cfg = arg;\n this.hasConfig = true;\n }\n });\n\n if (!this.tbl || this.tbl.nodeName !== 'TABLE') {\n throw new Error(`Could not instantiate TableFilter: HTML table\n DOM element not found.`);\n }\n\n if (this.getRowsNb() === 0) {\n throw new Error(`Could not instantiate TableFilter: HTML table\n requires at least 1 row.`);\n }\n\n // configuration object\n let f = this.cfg;\n\n /**\n * Event emitter instance\n * @type {Emitter}\n */\n this.emitter = new Emitter();\n\n // start row\n this.refRow = isUndef(startRow) ? 2 : (startRow + 1);\n\n /**\n * Collection of filter type by column\n * @type {Array}\n * @private\n */\n this.filterTypes = [].map.call(\n (this.dom().rows[this.refRow] || this.dom().rows[0]).cells,\n (cell, idx) => {\n let colType = this.cfg[`col_${idx}`];\n return !colType ? INPUT : colType.toLowerCase();\n });\n\n /**\n * Base path for static assets\n * @type {String}\n */\n this.basePath = defaultsStr(f.base_path, 'tablefilter/');\n\n /*** filters' grid properties ***/\n\n /**\n * Enable/disable filters\n * @type {Boolean}\n */\n this.fltGrid = defaultsBool(f.grid, true);\n\n /**\n * Enable/disable grid layout (fixed headers)\n * @type {Object|Boolean}\n */\n this.gridLayout = isObj(f.grid_layout) || Boolean(f.grid_layout);\n\n /**\n * Filters row index\n * @type {Number}\n */\n this.filtersRowIndex = defaultsNb(f.filters_row_index, 0);\n\n /**\n * Headers row index\n * @type {Number}\n */\n this.headersRow = defaultsNb(f.headers_row_index,\n (this.filtersRowIndex === 0 ? 1 : 0));\n\n /**\n * Define the type of cell containing a filter (td/th)\n * @type {String}\n */\n this.fltCellTag = defaultsStr(f.filters_cell_tag, CELL_TAG);\n\n /**\n * List of filters IDs\n * @type {Array}\n * @private\n */\n this.fltIds = [];\n\n /**\n * List of valid rows indexes (rows visible upon filtering)\n * @type {Array}\n * @private\n */\n this.validRowsIndex = [];\n\n /*** filters' grid appearance ***/\n /**\n * Path for stylesheets\n * @type {String}\n */\n this.stylePath = this.getStylePath();\n\n /**\n * Main stylesheet path\n * @type {String}\n */\n this.stylesheet = this.getStylesheetPath();\n\n /**\n * Main stylesheet ID\n * @type {String}\n * @private\n */\n this.stylesheetId = this.id + '_style';\n\n /**\n * Css class for the filters row\n * @type {String}\n */\n this.fltsRowCssClass = defaultsStr(f.flts_row_css_class, 'fltrow');\n\n /**\n * Enable/disable icons (paging, reset button)\n * @type {Boolean}\n */\n this.enableIcons = defaultsBool(f.enable_icons, true);\n\n /**\n * Enable/disable alternating rows\n * @type {Boolean}\n */\n this.alternateRows = Boolean(f.alternate_rows);\n\n /**\n * Columns widths array\n * @type {Array}\n */\n this.colWidths = defaultsArr(f.col_widths, []);\n\n /**\n * Css class for a filter element\n * @type {String}\n */\n this.fltCssClass = defaultsStr(f.flt_css_class, 'flt');\n\n /**\n * Css class for multiple select filters\n * @type {String}\n */\n this.fltMultiCssClass = defaultsStr(f.flt_multi_css_class, 'flt_multi');\n\n /**\n * Css class for small filter (when submit button is active)\n * @type {String}\n */\n this.fltSmallCssClass = defaultsStr(f.flt_small_css_class, 'flt_s');\n\n /**\n * Css class for single filter type\n * @type {String}\n */\n this.singleFltCssClass = defaultsStr((f.single_filter || {}).css_class,\n 'single_flt');\n\n /*** filters' grid behaviours ***/\n\n /**\n * Enable/disable enter key for input type filters\n * @type {Boolean}\n */\n this.enterKey = defaultsBool(f.enter_key, true);\n\n /**\n * Callback fired before filtering process starts\n * @type {Function}\n */\n this.onBeforeFilter = defaultsFn(f.on_before_filter, EMPTY_FN);\n\n /**\n * Callback fired after filtering process is completed\n * @type {Function}\n */\n this.onAfterFilter = defaultsFn(f.on_after_filter, EMPTY_FN);\n\n /**\n * Enable/disable case sensitivity filtering\n * @type {Boolean}\n */\n this.caseSensitive = Boolean(f.case_sensitive);\n\n /**\n * Indicate whether exact match filtering is enabled on a per column\n * basis\n * @type {Boolean}\n * @private\n */\n this.hasExactMatchByCol = isArray(f.columns_exact_match);\n\n /**\n * Exact match filtering per column array\n * @type {Array}\n */\n this.exactMatchByCol = this.hasExactMatchByCol ?\n f.columns_exact_match : [];\n\n /**\n * Globally enable/disable exact match filtering\n * @type {Boolean}\n */\n this.exactMatch = Boolean(f.exact_match);\n\n /**\n * Ignore diacritics globally or on a column basis\n * @type {Boolean|Array}\n */\n this.ignoreDiacritics = f.ignore_diacritics;\n\n /**\n * Enable/disable linked filters filtering mode\n * @type {Boolean}\n */\n this.linkedFilters = Boolean(f.linked_filters);\n\n /**\n * Enable/disable readonly state for excluded options when\n * linked filters filtering mode is on\n * @type {Boolean}\n */\n this.disableExcludedOptions = Boolean(f.disable_excluded_options);\n\n /**\n * Active filter ID\n * @type {String}\n * @private\n */\n this.activeFilterId = null;\n\n /**\n * Determine if there are excluded rows from filtering\n * @type {Boolean}\n * @private\n */\n this.hasExcludedRows = Boolean(isArray(f.exclude_rows) &&\n f.exclude_rows.length > 0);\n\n /**\n * List of row indexes to be excluded from filtering\n * @type {Array}\n */\n this.excludeRows = defaultsArr(f.exclude_rows, []);\n\n /**\n * List of containers IDs where external filters will be generated\n * @type {Array}\n */\n this.externalFltIds = defaultsArr(f.external_flt_ids, []);\n\n /**\n * Callback fired after filters are generated\n * @type {Function}\n */\n this.onFiltersLoaded = defaultsFn(f.on_filters_loaded, EMPTY_FN);\n\n /**\n * Enable/disable single filter mode\n * @type {Boolean|Object}\n */\n this.singleFlt = isObj(f.single_filter) ||\n Boolean(f.single_filter);\n\n /**\n * Specify columns to be excluded from single filter search, by default\n * searching in all columns:\n * single_filter: {\n * exclude_cols: [2, 7]\n * }\n */\n this.singleFltExcludeCols = isObj(f.single_filter) &&\n isArray(f.single_filter.exclude_cols) ?\n f.single_filter.exclude_cols : [];\n\n /**\n * Callback fired after a row is validated during filtering\n * @type {Function}\n */\n this.onRowValidated = defaultsFn(f.on_row_validated, EMPTY_FN);\n\n /**\n * Specify which column implements a custom cell parser to retrieve the\n * cell value:\n * cell_parser: {\n * cols: [0, 2],\n * parse: function(tf, cell, colIndex) {\n * // custom cell parser logic here\n * return cellValue;\n * }\n * }\n * @type {Object}\n */\n this.cellParser = isObj(f.cell_parser) && isFn(f.cell_parser.parse) &&\n isArray(f.cell_parser.cols) ?\n f.cell_parser : { cols: [], parse: EMPTY_FN };\n\n /**\n * Global watermark text for input filter type or watermark for each\n * filter if an array is supplied\n * @type {String|Array}\n */\n this.watermark = f.watermark || '';\n\n /**\n * Indicate whether watermark is on a per column basis\n * @type {Boolean}\n * @private\n */\n this.isWatermarkArray = isArray(this.watermark);\n\n /**\n * Indicate whether help UI component is disabled\n * @type {Boolean}\n */\n this.help = isUndef(f.help_instructions) ? undefined :\n (isObj(f.help_instructions) || Boolean(f.help_instructions));\n\n /**\n * Indicate whether pop-up filters UI is enabled\n * @type {Boolean|Object}\n */\n this.popupFilters = isObj(f.popup_filters) || Boolean(f.popup_filters);\n\n /**\n * Indicate whether filtered (active) columns indicator is enabled\n * @type {Boolean}\n */\n this.markActiveColumns = isObj(f.mark_active_columns) ||\n Boolean(f.mark_active_columns);\n\n /*** select filter's customisation and behaviours ***/\n /**\n * Text for clear option in drop-down filter types (1st option)\n * @type {String|Array}\n */\n this.clearFilterText = defaultsStr(f.clear_filter_text, 'Clear');\n\n /**\n * Indicate whether empty option is enabled in drop-down filter types\n * @type {Boolean}\n */\n this.enableEmptyOption = Boolean(f.enable_empty_option);\n\n /**\n * Text for empty option in drop-down filter types\n * @type {String}\n */\n this.emptyText = defaultsStr(f.empty_text, '(Empty)');\n\n /**\n * Indicate whether non-empty option is enabled in drop-down filter\n * types\n * @type {Boolean}\n */\n this.enableNonEmptyOption = Boolean(f.enable_non_empty_option);\n\n /**\n * Text for non-empty option in drop-down filter types\n * @type {String}\n */\n this.nonEmptyText = defaultsStr(f.non_empty_text, '(Non empty)');\n\n /**\n * Indicate whether drop-down filter types filter the table by default\n * on change event\n * @type {Boolean}\n */\n this.onSlcChange = defaultsBool(f.on_change, true);\n\n /**\n * Make drop-down filter types options sorted in alpha-numeric manner\n * by default globally or on a column basis\n * @type {Boolean|Array}\n */\n this.sortSlc = isUndef(f.sort_select) ? true :\n isArray(f.sort_select) ? f.sort_select : Boolean(f.sort_select);\n\n /**\n * Indicate whether options in drop-down filter types are sorted in a\n * ascending numeric manner\n * @type {Boolean}\n * @private\n */\n this.isSortNumAsc = Boolean(f.sort_num_asc);\n\n /**\n * List of columns implementing options sorting in a ascending numeric\n * manner\n * @type {Array}\n */\n this.sortNumAsc = this.isSortNumAsc ? f.sort_num_asc : [];\n\n /**\n * Indicate whether options in drop-down filter types are sorted in a\n * descending numeric manner\n * @type {Boolean}\n * @private\n */\n this.isSortNumDesc = Boolean(f.sort_num_desc);\n\n /**\n * List of columns implementing options sorting in a descending numeric\n * manner\n * @type {Array}\n */\n this.sortNumDesc = this.isSortNumDesc ? f.sort_num_desc : [];\n\n /**\n * Indicate whether drop-down filter types are populated on demand at\n * first usage\n * @type {Boolean}\n */\n this.loadFltOnDemand = Boolean(f.load_filters_on_demand);\n\n /**\n * Indicate whether custom drop-down filter options are implemented\n * @type {Boolean}\n */\n this.hasCustomOptions = isObj(f.custom_options);\n\n /**\n * Custom options definition of a per column basis, ie:\n *\tcustom_options: {\n * cols:[0, 1],\n * texts: [\n * ['a0', 'b0', 'c0'],\n * ['a1', 'b1', 'c1']\n * ],\n * values: [\n * ['a0', 'b0', 'c0'],\n * ['a1', 'b1', 'c1']\n * ],\n * sorts: [false, true]\n * }\n *\n * @type {Object}\n */\n this.customOptions = f.custom_options;\n\n /*** Filter operators ***/\n /**\n * Regular expression operator for input filter. Defaults to 'rgx:'\n * @type {String}\n */\n this.rgxOperator = defaultsStr(f.regexp_operator, 'rgx:');\n\n /**\n * Empty cells operator for input filter. Defaults to '[empty]'\n * @type {String}\n */\n this.emOperator = defaultsStr(f.empty_operator, '[empty]');\n\n /**\n * Non-empty cells operator for input filter. Defaults to '[nonempty]'\n * @type {String}\n */\n this.nmOperator = defaultsStr(f.nonempty_operator, '[nonempty]');\n\n /**\n * Logical OR operator for input filter. Defaults to '||'\n * @type {String}\n */\n this.orOperator = defaultsStr(f.or_operator, '||');\n\n /**\n * Logical AND operator for input filter. Defaults to '&&'\n * @type {String}\n */\n this.anOperator = defaultsStr(f.and_operator, '&&');\n\n /**\n * Greater than operator for input filter. Defaults to '>'\n * @type {String}\n */\n this.grOperator = defaultsStr(f.greater_operator, '>');\n\n /**\n * Lower than operator for input filter. Defaults to '<'\n * @type {String}\n */\n this.lwOperator = defaultsStr(f.lower_operator, '<');\n\n /**\n * Lower than or equal operator for input filter. Defaults to '<='\n * @type {String}\n */\n this.leOperator = defaultsStr(f.lower_equal_operator, '<=');\n\n /**\n * Greater than or equal operator for input filter. Defaults to '>='\n * @type {String}\n */\n this.geOperator = defaultsStr(f.greater_equal_operator, '>=');\n\n /**\n * Inequality operator for input filter. Defaults to '!'\n * @type {String}\n */\n this.dfOperator = defaultsStr(f.different_operator, '!');\n\n /**\n * Like operator for input filter. Defaults to '*'\n * @type {String}\n */\n this.lkOperator = defaultsStr(f.like_operator, '*');\n\n /**\n * Strict equality operator for input filter. Defaults to '='\n * @type {String}\n */\n this.eqOperator = defaultsStr(f.equal_operator, '=');\n\n /**\n * Starts with operator for input filter. Defaults to '='\n * @type {String}\n */\n this.stOperator = defaultsStr(f.start_with_operator, '{');\n\n /**\n * Ends with operator for input filter. Defaults to '='\n * @type {String}\n */\n this.enOperator = defaultsStr(f.end_with_operator, '}');\n\n // this.curExp = f.cur_exp || '^[¥£€$]';\n\n /**\n * Stored values separator\n * @type {String}\n */\n this.separator = defaultsStr(f.separator, ',');\n\n /**\n * Enable rows counter UI component\n * @type {Boolean|Object}\n */\n this.rowsCounter = isObj(f.rows_counter) || Boolean(f.rows_counter);\n\n /**\n * Enable status bar UI component\n * @type {Boolean|Object}\n */\n this.statusBar = isObj(f.status_bar) || Boolean(f.status_bar);\n\n /**\n * Enable activity/spinner indicator UI component\n * @type {Boolean|Object}\n */\n this.loader = isObj(f.loader) || Boolean(f.loader);\n\n /*** validation - reset buttons/links ***/\n /**\n * Enable filters submission button\n * @type {Boolean}\n */\n this.displayBtn = Boolean(f.btn);\n\n /**\n * Define filters submission button text\n * @type {String}\n */\n this.btnText = defaultsStr(f.btn_text, (!this.enableIcons ? 'Go' : ''));\n\n /**\n * Css class for filters submission button\n * @type {String}\n */\n this.btnCssClass = defaultsStr(f.btn_css_class,\n (!this.enableIcons ? 'btnflt' : 'btnflt_icon'));\n\n /**\n * Enable clear button\n * @type {Object|Boolean}\n */\n this.btnReset = isObj(f.btn_reset) || Boolean(f.btn_reset);\n\n /**\n * Callback fired before filters are cleared\n * @type {Function}\n */\n this.onBeforeReset = defaultsFn(f.on_before_reset, EMPTY_FN);\n\n /**\n * Callback fired after filters are cleared\n * @type {Function}\n */\n this.onAfterReset = defaultsFn(f.on_after_reset, EMPTY_FN);\n\n /**\n * Enable paging component\n * @type {Object|Boolean}\n */\n this.paging = isObj(f.paging) || Boolean(f.paging);\n\n /**\n * Number of hidden rows\n * @type {Number}\n * @private\n */\n this.nbHiddenRows = 0;\n\n /**\n * Enable auto-filter behaviour, table is filtered when a user\n * stops typing\n * @type {Object|Boolean}\n */\n this.autoFilter = isObj(f.auto_filter) || Boolean(f.auto_filter);\n\n /**\n * Auto-filter delay in milliseconds\n * @type {Number}\n */\n this.autoFilterDelay = isObj(f.auto_filter) &&\n isNumber(f.auto_filter.delay) ?\n f.auto_filter.delay : AUTO_FILTER_DELAY;\n\n /**\n * Indicate whether user is typing\n * @type {Boolean}\n * @private\n */\n this.isUserTyping = null;\n\n /**\n * Auto-filter interval ID\n * @type {String}\n * @private\n */\n this.autoFilterTimer = null;\n\n /**\n * Enable keyword highlighting behaviour\n * @type {Boolean}\n */\n this.highlightKeywords = Boolean(f.highlight_keywords);\n\n /**\n * Enable no results message UI component\n * @type {Object|Boolean}\n */\n this.noResults = isObj(f.no_results_message) ||\n Boolean(f.no_results_message);\n\n /**\n * Enable state persistence\n * @type {Object|Boolean}\n */\n this.state = isObj(f.state) || Boolean(f.state);\n\n /*** data types ***/\n\n /**\n * Enable date type module\n * @type {Boolean}\n * @private\n */\n this.dateType = true;\n\n /**\n * Define default locale, default to 'en' as per Sugar Date module:\n * https://sugarjs.com/docs/#/DateLocales\n * @type {String}\n */\n this.locale = defaultsStr(f.locale, 'en');\n\n /**\n * Define thousands separator ',' or '.', defaults to ','\n * @type {String}\n */\n this.thousandsSeparator = defaultsStr(f.thousands_separator, ',');\n\n /**\n * Define decimal separator ',' or '.', defaults to '.'\n * @type {String}\n */\n this.decimalSeparator = defaultsStr(f.decimal_separator, '.');\n\n /**\n * Define data types on a column basis, possible values 'string',\n * 'number', 'formatted-number', 'date', 'ipaddress' ie:\n * col_types : [\n * 'string', 'date', 'number',\n * { type: 'formatted-number', decimal: ',', thousands: '.' },\n * { type: 'date', locale: 'en-gb' },\n * { type: 'date', format: ['{dd}-{months}-{yyyy|yy}'] }\n * ]\n *\n * Refer to https://sugarjs.com/docs/#/DateParsing for exhaustive\n * information on date parsing formats supported by Sugar Date\n * @type {Array}\n */\n this.colTypes = isArray(f.col_types) ? f.col_types : [];\n\n /*** ids prefixes ***/\n /**\n * Main prefix\n * @private\n */\n this.prfxTf = 'TF';\n\n /**\n * Filter's ID prefix (inputs - selects)\n * @private\n */\n this.prfxFlt = 'flt';\n\n /**\n * Button's ID prefix\n * @private\n */\n this.prfxValButton = 'btn';\n\n /**\n * Responsive Css class\n * @private\n */\n this.prfxResponsive = 'resp';\n\n /*** extensions ***/\n /**\n * List of loaded extensions\n * @type {Array}\n */\n this.extensions = defaultsArr(f.extensions, []);\n\n /*** themes ***/\n /**\n * Enable default theme\n * @type {Boolean}\n */\n this.enableDefaultTheme = Boolean(f.enable_default_theme);\n\n /**\n * Determine whether themes are enables\n * @type {Boolean}\n * @private\n */\n this.hasThemes = (this.enableDefaultTheme || isArray(f.themes));\n\n /**\n * List of themes, ie:\n * themes: [{ name: 'skyblue' }]\n * @type {Array}\n */\n this.themes = defaultsArr(f.themes, []);\n\n /**\n * Define path to themes assets, defaults to\n * 'tablefilter/style/themes/'. Usage:\n * themes: [{ name: 'skyblue' }]\n * @type {Array}\n */\n this.themesPath = this.getThemesPath();\n\n /**\n * Enable responsive layout\n * @type {Boolean}\n */\n this.responsive = Boolean(f.responsive);\n\n /**\n * Enable toolbar component\n * @type {Object|Boolean}\n */\n this.toolbar = isObj(f.toolbar) || Boolean(f.toolbar);\n\n /**\n * Features registry\n * @private\n */\n this.Mod = {};\n\n /**\n * Extensions registry\n * @private\n */\n this.ExtRegistry = {};\n\n // conditionally instantiate required features\n this.instantiateFeatures(\n Object.keys(FEATURES).map((item) => FEATURES[item])\n );\n }\n\n /**\n * Initialise features and layout\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n // import main stylesheet\n this.import(this.stylesheetId, this.getStylesheetPath(), null, 'link');\n\n let Mod = this.Mod;\n let inpclass;\n\n //loads theme\n this.loadThemes();\n\n const { dateType, help, state, markActiveColumns, gridLayout, loader,\n highlightKeyword, popupFilter, rowsCounter, statusBar, clearButton,\n alternateRows, noResults, paging, toolbar } = FEATURES;\n\n //explicitly initialise features in given order\n this.initFeatures([\n dateType,\n help,\n state,\n markActiveColumns,\n gridLayout,\n loader,\n highlightKeyword,\n popupFilter\n ]);\n\n //filters grid is not generated\n if (!this.fltGrid) {\n this._initNoFilters();\n } else {\n let fltrow = this._insertFiltersRow();\n\n this.nbCells = this.getCellsNb(this.refRow);\n this.nbFilterableRows = this.getRowsNb();\n\n let n = this.singleFlt ? 1 : this.nbCells;\n\n //build filters\n for (let i = 0; i < n; i++) {\n this.emitter.emit('before-filter-init', this, i);\n\n let fltCell = createElm(this.fltCellTag),\n col = this.getFilterType(i);\n\n if (this.singleFlt) {\n fltCell.colSpan = this.nbCells;\n }\n if (!this.gridLayout) {\n fltrow.appendChild(fltCell);\n }\n inpclass = (i === n - 1 && this.displayBtn) ?\n this.fltSmallCssClass : this.fltCssClass;\n\n //only 1 input for single search\n if (this.singleFlt) {\n col = INPUT;\n inpclass = this.singleFltCssClass;\n }\n\n //drop-down filters\n if (col === SELECT || col === MULTIPLE) {\n Mod.dropdown = Mod.dropdown || new Dropdown(this);\n Mod.dropdown.init(i, this.isExternalFlt(), fltCell);\n }\n // checklist\n else if (col === CHECKLIST) {\n Mod.checkList = Mod.checkList || new CheckList(this);\n Mod.checkList.init(i, this.isExternalFlt(), fltCell);\n } else {\n this._buildInputFilter(i, inpclass, fltCell);\n }\n\n // this adds submit button\n if (i === n - 1 && this.displayBtn) {\n this._buildSubmitButton(\n this.isExternalFlt() ?\n elm(this.externalFltIds[i]) :\n fltCell\n );\n }\n\n this.emitter.emit('after-filter-init', this, i);\n }\n\n this.emitter.on(['filter-focus'],\n (tf, filter) => this.setActiveFilterId(filter.id));\n\n }//if this.fltGrid\n\n /* Features */\n if (this.hasExcludedRows) {\n this.emitter.on(['after-filtering'], () => this.setExcludeRows());\n this.setExcludeRows();\n }\n\n this.initFeatures([\n rowsCounter,\n statusBar,\n clearButton,\n alternateRows,\n noResults,\n paging,\n toolbar\n ]);\n\n this.setColWidths();\n\n //TF css class is added to table\n if (!this.gridLayout) {\n addClass(this.dom(), this.prfxTf);\n if (this.responsive) {\n addClass(this.dom(), this.prfxResponsive);\n }\n }\n\n /* Load extensions */\n this.initExtensions();\n\n // Subscribe to events\n if (this.linkedFilters) {\n this.emitter.on(['after-filtering'], () => this.linkFilters());\n }\n\n this.initialized = true;\n\n this.onFiltersLoaded(this);\n\n this.emitter.emit('initialized', this);\n }\n\n /**\n * Detect key\n * @param {Event} evt\n */\n detectKey(evt) {\n if (!this.enterKey) {\n return;\n }\n\n if (isKeyPressed(evt, [ENTER_KEY])) {\n this.filter();\n cancelEvt(evt);\n stopEvt(evt);\n } else {\n this.isUserTyping = true;\n root.clearInterval(this.autoFilterTimer);\n this.autoFilterTimer = null;\n }\n }\n\n /**\n * Filter's keyup event: if auto-filter on, detect user is typing and filter\n * columns\n * @param {Event} evt\n */\n onKeyUp(evt) {\n if (!this.autoFilter) {\n return;\n }\n this.isUserTyping = false;\n\n function filter() {\n root.clearInterval(this.autoFilterTimer);\n this.autoFilterTimer = null;\n if (!this.isUserTyping) {\n this.filter();\n this.isUserTyping = null;\n }\n }\n\n if (isKeyPressed(evt,\n [ENTER_KEY, TAB_KEY, ESC_KEY, UP_ARROW_KEY, DOWN_ARROW_KEY])) {\n root.clearInterval(this.autoFilterTimer);\n this.autoFilterTimer = null;\n } else {\n if (this.autoFilterTimer !== null) {\n return;\n }\n this.autoFilterTimer = root.setInterval(\n filter.bind(this),\n this.autoFilterDelay);\n }\n }\n\n /**\n * Filter's keydown event: if auto-filter on, detect user is typing\n */\n onKeyDown() {\n if (this.autoFilter) {\n this.isUserTyping = true;\n }\n }\n\n /**\n * Filter's focus event\n * @param {Event} evt\n */\n onInpFocus(evt) {\n let elm = targetEvt(evt);\n this.emitter.emit('filter-focus', this, elm);\n }\n\n /**\n * Filter's blur event: if auto-filter on, clear interval on filter blur\n */\n onInpBlur() {\n if (this.autoFilter) {\n this.isUserTyping = false;\n root.clearInterval(this.autoFilterTimer);\n }\n this.emitter.emit('filter-blur', this);\n }\n\n /**\n * Insert filters row at initialization\n */\n _insertFiltersRow() {\n // TODO: prevent filters row generation for popup filters too,\n // to reduce and simplify headers row index adjusting across lib modules\n // (GridLayout, PopupFilter etc)\n if (this.gridLayout) {\n return;\n }\n let fltrow;\n\n let thead = tag(this.dom(), 'thead');\n if (thead.length > 0) {\n fltrow = thead[0].insertRow(this.filtersRowIndex);\n } else {\n fltrow = this.dom().insertRow(this.filtersRowIndex);\n }\n\n fltrow.className = this.fltsRowCssClass;\n\n if (this.isExternalFlt()) {\n fltrow.style.display = NONE;\n }\n\n this.emitter.emit('filters-row-inserted', this, fltrow);\n return fltrow;\n }\n\n /**\n * Initialize filtersless table\n */\n _initNoFilters() {\n if (this.fltGrid) {\n return;\n }\n this.refRow = this.refRow > 0 ? this.refRow - 1 : 0;\n this.nbFilterableRows = this.getRowsNb();\n }\n\n /**\n * Build input filter type\n * @param {Number} colIndex Column index\n * @param {String} cssClass Css class applied to filter\n * @param {DOMElement} container Container DOM element\n */\n _buildInputFilter(colIndex, cssClass, container) {\n let col = this.getFilterType(colIndex);\n let externalFltTgtId = this.isExternalFlt() ?\n this.externalFltIds[colIndex] : null;\n let inpType = col === INPUT ? 'text' : 'hidden';\n let inp = createElm(INPUT,\n ['id', this.buildFilterId(colIndex)],\n ['type', inpType], ['ct', colIndex]);\n\n if (inpType !== 'hidden' && this.watermark) {\n inp.setAttribute('placeholder',\n this.isWatermarkArray ? (this.watermark[colIndex] || '') :\n this.watermark\n );\n }\n inp.className = cssClass || this.fltCssClass;\n addEvt(inp, 'focus', (evt) => this.onInpFocus(evt));\n\n //filter is appended in custom element\n if (externalFltTgtId) {\n elm(externalFltTgtId).appendChild(inp);\n } else {\n container.appendChild(inp);\n }\n\n this.fltIds.push(inp.id);\n\n addEvt(inp, 'keypress', (evt) => this.detectKey(evt));\n addEvt(inp, 'keydown', () => this.onKeyDown());\n addEvt(inp, 'keyup', (evt) => this.onKeyUp(evt));\n addEvt(inp, 'blur', () => this.onInpBlur());\n }\n\n /**\n * Build submit button\n * @param {DOMElement} container Container DOM element\n */\n _buildSubmitButton(container) {\n let btn = createElm(INPUT,\n ['type', 'button'],\n ['value', this.btnText]\n );\n btn.className = this.btnCssClass;\n\n //filter is appended in container element\n container.appendChild(btn);\n\n addEvt(btn, 'click', () => this.filter());\n }\n\n /**\n * Istantiate the collection of features required by the\n * configuration and add them to the features registry. A feature is\n * described by a `class` and `name` fields and and optional `property`\n * field:\n * {\n * class: AClass,\n * name: 'aClass'\n * }\n * @param {Array} [features=[]]\n * @private\n */\n instantiateFeatures(features = []) {\n features.forEach((feature) => {\n // TODO: remove the property field.\n // Due to naming convention inconsistencies, a `property`\n // field is added to allow a conditional instanciation based\n // on that property on TableFilter, if supplied.\n feature.property = feature.property || feature.name;\n if (!this.hasConfig || this[feature.property] === true ||\n feature.enforce === true) {\n let {class: Cls, name} = feature;\n\n this.Mod[name] = this.Mod[name] || new Cls(this);\n }\n });\n }\n\n /**\n * Initialise the passed features collection. A feature is described by a\n * `class` and `name` fields and and optional `property` field:\n * {\n * class: AClass,\n * name: 'aClass'\n * }\n * @param {Array} [features=[]]\n * @private\n */\n initFeatures(features = []) {\n features.forEach((feature) => {\n let {property, name} = feature;\n if (this[property] === true && this.Mod[name]) {\n this.Mod[name].init();\n }\n });\n }\n\n /**\n * Return a feature instance for a given name\n * @param {String} name Name of the feature\n * @return {Object}\n */\n feature(name) {\n return this.Mod[name];\n }\n\n /**\n * Initialise all the extensions defined in the configuration object\n */\n initExtensions() {\n let exts = this.extensions;\n if (exts.length === 0) {\n return;\n }\n\n // Set config's publicPath dynamically for Webpack...\n __webpack_public_path__ = this.basePath;\n\n this.emitter.emit('before-loading-extensions', this);\n\n exts.forEach((ext) => {\n this.loadExtension(ext);\n });\n this.emitter.emit('after-loading-extensions', this);\n }\n\n /**\n * Load an extension module\n * @param {Object} ext Extension config object\n */\n loadExtension(ext) {\n if (!ext || !ext.name || this.hasExtension(ext.name)) {\n return;\n }\n\n let {name, path} = ext;\n let modulePath;\n\n if (name && path) {\n modulePath = ext.path + name;\n } else {\n name = name.replace('.js', '');\n modulePath = 'extensions/{}/{}'.replace(/{}/g, name);\n }\n\n // Require pattern for Webpack\n require(['./' + modulePath], (mod) => {\n /* eslint-disable */\n let inst = new mod.default(this, ext);\n /* eslint-enable */\n inst.init();\n this.ExtRegistry[name] = inst;\n });\n }\n\n /**\n * Get an extension instance\n * @param {String} name Name of the extension\n * @return {Object} Extension instance\n */\n extension(name) {\n return this.ExtRegistry[name];\n }\n\n /**\n * Check passed extension name exists\n * @param {String} name Name of the extension\n * @return {Boolean}\n */\n hasExtension(name) {\n return !isEmpty(this.ExtRegistry[name]);\n }\n\n /**\n * Register the passed extension instance with associated name\n * @param {Object} inst Extension instance\n * @param {String} name Name of the extension\n */\n registerExtension(inst, name) {\n this.ExtRegistry[name] = inst;\n }\n\n /**\n * Destroy all the extensions store in extensions registry\n */\n destroyExtensions() {\n let reg = this.ExtRegistry;\n\n Object.keys(reg).forEach((key) => {\n reg[key].destroy();\n reg[key] = undefined;\n });\n }\n\n /**\n * Load themes defined in the configuration object\n */\n loadThemes() {\n if (!this.hasThemes) {\n return;\n }\n\n let themes = this.themes;\n this.emitter.emit('before-loading-themes', this);\n\n //Default theme config\n if (this.enableDefaultTheme) {\n let defaultTheme = { name: 'default' };\n this.themes.push(defaultTheme);\n }\n\n themes.forEach((theme, i) => {\n let {name, path} = theme;\n let styleId = this.prfxTf + name;\n if (name && !path) {\n path = this.themesPath + name + '/' + name + '.css';\n }\n else if (!name && theme.path) {\n name = 'theme{0}'.replace('{0}', i);\n }\n\n if (!this.isImported(path, 'link')) {\n this.import(styleId, path, null, 'link');\n }\n });\n\n // Enable loader indicator\n this.loader = true;\n\n this.emitter.emit('after-loading-themes', this);\n }\n\n /**\n * Return stylesheet DOM element for a given theme name\n * @return {DOMElement} stylesheet element\n */\n getStylesheet(name = 'default') {\n return elm(this.prfxTf + name);\n }\n\n /**\n * Destroy filter grid\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n let emitter = this.emitter;\n\n if (this.isExternalFlt() && !this.popupFilters) {\n this.removeExternalFlts();\n }\n\n this.destroyExtensions();\n\n this.validateAllRows();\n\n // broadcast destroy event modules and extensions are subscribed to\n emitter.emit('destroy', this);\n\n if (this.fltGrid && !this.gridLayout) {\n this.dom().deleteRow(this.filtersRowIndex);\n }\n\n // unsubscribe to events\n if (this.hasExcludedRows) {\n emitter.off(['after-filtering'], () => this.setExcludeRows());\n }\n if (this.linkedFilters) {\n emitter.off(['after-filtering'], () => this.linkFilters());\n }\n this.emitter.off(['filter-focus'],\n (tf, filter) => this.setActiveFilterId(filter.id));\n\n removeClass(this.dom(), this.prfxTf);\n removeClass(this.dom(), this.prfxResponsive);\n\n this.nbHiddenRows = 0;\n this.validRowsIndex = [];\n this.fltIds = [];\n this.initialized = false;\n }\n\n /**\n * Remove all the external column filters\n */\n removeExternalFlts() {\n if (!this.isExternalFlt()) {\n return;\n }\n let ids = this.externalFltIds;\n ids.forEach((id) => {\n let externalFlt = elm(id);\n if (externalFlt) {\n externalFlt.innerHTML = '';\n }\n });\n }\n\n /**\n * Check if given column implements a filter with custom options\n * @param {Number} colIndex Column's index\n * @return {Boolean}\n */\n isCustomOptions(colIndex) {\n return this.hasCustomOptions &&\n this.customOptions.cols.indexOf(colIndex) !== -1;\n }\n\n /**\n * Returns an array [[value0, value1 ...],[text0, text1 ...]] with the\n * custom options values and texts\n * @param {Number} colIndex Column's index\n * @return {Array}\n */\n getCustomOptions(colIndex) {\n if (isEmpty(colIndex) || !this.isCustomOptions(colIndex)) {\n return;\n }\n\n let customOptions = this.customOptions;\n let cols = customOptions.cols;\n let optTxt = [], optArray = [];\n let index = cols.indexOf(colIndex);\n let slcValues = customOptions.values[index];\n let slcTexts = customOptions.texts[index];\n let slcSort = customOptions.sorts[index];\n\n for (let r = 0, len = slcValues.length; r < len; r++) {\n optArray.push(slcValues[r]);\n if (slcTexts[r]) {\n optTxt.push(slcTexts[r]);\n } else {\n optTxt.push(slcValues[r]);\n }\n }\n if (slcSort) {\n optArray.sort();\n optTxt.sort();\n }\n return [optArray, optTxt];\n }\n\n /**\n * Filter the table by retrieving the data from each cell in every single\n * row and comparing it to the search term for current column. A row is\n * hidden when all the search terms are not found in inspected row.\n */\n filter() {\n if (!this.fltGrid || !this.initialized) {\n return;\n }\n\n let emitter = this.emitter;\n\n //fire onbefore callback\n this.onBeforeFilter(this);\n emitter.emit('before-filtering', this);\n\n let hiddenRows = 0;\n\n this.validRowsIndex = [];\n // search args\n let searchArgs = this.getFiltersValue();\n\n let eachRow = this.eachRow();\n eachRow(\n (row, k) => {\n // already filtered rows display re-init\n row.style.display = '';\n\n let cells = row.cells;\n let nbCells = cells.length;\n\n let occurence = [],\n isMatch = true,\n //only for single filter search\n isSingleFltMatch = false;\n\n // this loop retrieves cell data\n for (let j = 0; j < nbCells; j++) {\n //searched keyword\n let sA = searchArgs[this.singleFlt ? 0 : j];\n\n if (sA === '') {\n continue;\n }\n\n let cellValue = matchCase(this.getCellValue(cells[j]),\n this.caseSensitive);\n\n //multiple search parameter operator ||\n let sAOrSplit = sA.toString().split(this.orOperator),\n //multiple search || parameter boolean\n hasMultiOrSA = sAOrSplit.length > 1,\n //multiple search parameter operator &&\n sAAndSplit = sA.toString().split(this.anOperator),\n //multiple search && parameter boolean\n hasMultiAndSA = sAAndSplit.length > 1;\n\n //detect operators or array query\n if (isArray(sA) || hasMultiOrSA || hasMultiAndSA) {\n let cS, s;\n let found = false;\n\n if (isArray(sA)) {\n s = sA;\n } else {\n s = hasMultiOrSA ? sAOrSplit : sAAndSplit;\n }\n // isolate search term and check occurence in cell data\n for (let w = 0, len = s.length; w < len; w++) {\n cS = trim(s[w]);\n found = this._match(cS, cellValue, j);\n\n if (found) {\n emitter.emit('highlight-keyword', this,\n cells[j], cS);\n }\n if ((hasMultiOrSA && found) ||\n (hasMultiAndSA && !found)) {\n break;\n }\n if (isArray(sA) && found) {\n break;\n }\n }\n occurence[j] = found;\n\n }\n //single search parameter\n else {\n occurence[j] = this._match(trim(sA), cellValue, j);\n if (occurence[j]) {\n emitter.emit('highlight-keyword', this, cells[j],\n sA);\n }\n }\n\n if (!occurence[j]) {\n isMatch = false;\n }\n\n if (this.singleFlt &&\n this.singleFltExcludeCols.indexOf(j) === -1 &&\n occurence[j]) {\n isSingleFltMatch = true;\n }\n\n emitter.emit('cell-processed', this, j, cells[j]);\n }//for j\n\n if (isSingleFltMatch) {\n isMatch = true;\n }\n\n this.validateRow(k, isMatch);\n if (!isMatch) {\n hiddenRows++;\n }\n\n emitter.emit('row-processed', this, k,\n this.validRowsIndex.length, isMatch);\n },\n // continue condition\n (row) => row.cells.length !== this.nbCells\n );\n\n this.nbHiddenRows = hiddenRows;\n\n //fire onafterfilter callback\n this.onAfterFilter(this);\n\n emitter.emit('after-filtering', this, searchArgs);\n }\n\n /**\n * Match search term in cell data\n * @param {String} term Search term\n * @param {String} cellValue Cell data\n * @param {Number} colIdx Column index\n * @return {Boolean}\n * @private\n */\n _match(term, cellValue, colIdx) {\n let numData;\n let decimal = this.getDecimal(colIdx);\n let reLe = new RegExp(this.leOperator),\n reGe = new RegExp(this.geOperator),\n reL = new RegExp(this.lwOperator),\n reG = new RegExp(this.grOperator),\n reD = new RegExp(this.dfOperator),\n reLk = new RegExp(rgxEsc(this.lkOperator)),\n reEq = new RegExp(this.eqOperator),\n reSt = new RegExp(this.stOperator),\n reEn = new RegExp(this.enOperator),\n // re_an = new RegExp(this.anOperator),\n // re_cr = new RegExp(this.curExp),\n reEm = this.emOperator,\n reNm = this.nmOperator,\n reRe = new RegExp(rgxEsc(this.rgxOperator));\n\n term = matchCase(term, this.caseSensitive);\n\n let occurence = false;\n\n //Search arg operator tests\n let hasLO = reL.test(term),\n hasLE = reLe.test(term),\n hasGR = reG.test(term),\n hasGE = reGe.test(term),\n hasDF = reD.test(term),\n hasEQ = reEq.test(term),\n hasLK = reLk.test(term),\n // hatermN = re_an.test(term),\n hasST = reSt.test(term),\n hasEN = reEn.test(term),\n hasEM = (reEm === term),\n hasNM = (reNm === term),\n hasRE = reRe.test(term);\n\n // Check for dates or resolve date type\n if (this.hasType(colIdx, [DATE])) {\n let dte1, dte2;\n\n let dateType = this.Mod.dateType;\n let isValidDate = dateType.isValid.bind(dateType);\n let parseDate = dateType.parse.bind(dateType);\n let locale = dateType.getLocale(colIdx);\n\n // Search arg dates tests\n let isLDate = hasLO &&\n isValidDate(term.replace(reL, ''), locale);\n let isLEDate = hasLE &&\n isValidDate(term.replace(reLe, ''), locale);\n let isGDate = hasGR &&\n isValidDate(term.replace(reG, ''), locale);\n let isGEDate = hasGE &&\n isValidDate(term.replace(reGe, ''), locale);\n let isDFDate = hasDF &&\n isValidDate(term.replace(reD, ''), locale);\n let isEQDate = hasEQ &&\n isValidDate(term.replace(reEq, ''), locale);\n\n dte1 = parseDate(cellValue, locale);\n\n // lower equal date\n if (isLEDate) {\n dte2 = parseDate(term.replace(reLe, ''), locale);\n occurence = dte1 <= dte2;\n }\n // lower date\n else if (isLDate) {\n dte2 = parseDate(term.replace(reL, ''), locale);\n occurence = dte1 < dte2;\n }\n // greater equal date\n else if (isGEDate) {\n dte2 = parseDate(term.replace(reGe, ''), locale);\n occurence = dte1 >= dte2;\n }\n // greater date\n else if (isGDate) {\n dte2 = parseDate(term.replace(reG, ''), locale);\n occurence = dte1 > dte2;\n }\n // different date\n else if (isDFDate) {\n dte2 = parseDate(term.replace(reD, ''), locale);\n occurence = dte1.toString() !== dte2.toString();\n }\n // equal date\n else if (isEQDate) {\n dte2 = parseDate(term.replace(reEq, ''), locale);\n occurence = dte1.toString() === dte2.toString();\n }\n // searched keyword with * operator doesn't have to be a date\n else if (reLk.test(term)) {// like date\n occurence = contains(term.replace(reLk, ''), cellValue,\n false, this.caseSensitive);\n }\n else if (isValidDate(term)) {\n dte2 = parseDate(term, locale);\n occurence = dte1.toString() === dte2.toString();\n }\n //empty\n else if (hasEM) {\n occurence = isEmptyString(cellValue);\n }\n //non-empty\n else if (hasNM) {\n occurence = !isEmptyString(cellValue);\n } else {\n occurence = contains(term, cellValue,\n this.isExactMatch(colIdx), this.caseSensitive);\n }\n } else {\n // Convert to number anyways to auto-resolve type in case not\n // defined by configuration. Order is important first try to\n // parse formatted number then fallback to Number coercion\n // to avoid false positives with Number\n numData = parseNb(cellValue, decimal) || Number(cellValue);\n\n // first checks if there is any operator (<,>,<=,>=,!,*,=,{,},\n // rgx:)\n\n //regexp\n if (hasRE) {\n //in case regexp throws\n try {\n //operator is removed\n let srchArg = term.replace(reRe, '');\n let rgx = new RegExp(srchArg);\n occurence = rgx.test(cellValue);\n } catch (ex) {\n occurence = false;\n }\n }\n // lower equal\n else if (hasLE) {\n occurence = numData <= parseNb(\n term.replace(reLe, ''),\n decimal\n );\n }\n //greater equal\n else if (hasGE) {\n occurence = numData >= parseNb(\n term.replace(reGe, ''),\n decimal\n );\n }\n //lower\n else if (hasLO) {\n occurence = numData < parseNb(\n term.replace(reL, ''),\n decimal\n );\n }\n //greater\n else if (hasGR) {\n occurence = numData > parseNb(\n term.replace(reG, ''),\n decimal\n );\n }\n //different\n else if (hasDF) {\n occurence = contains(term.replace(reD, ''), cellValue,\n false, this.caseSensitive) ? false : true;\n }\n //like\n else if (hasLK) {\n occurence = contains(term.replace(reLk, ''), cellValue,\n false, this.caseSensitive);\n }\n //equal\n else if (hasEQ) {\n occurence = contains(term.replace(reEq, ''), cellValue,\n true, this.caseSensitive);\n }\n //starts with\n else if (hasST) {\n occurence = cellValue.indexOf(term.replace(reSt, '')) === 0 ?\n true : false;\n }\n //ends with\n else if (hasEN) {\n let searchArg = term.replace(reEn, '');\n occurence =\n cellValue.lastIndexOf(searchArg, cellValue.length - 1) ===\n (cellValue.length - 1) - (searchArg.length - 1) &&\n cellValue.lastIndexOf(searchArg, cellValue.length - 1)\n > -1 ? true : false;\n }\n //empty\n else if (hasEM) {\n occurence = isEmptyString(cellValue);\n }\n //non-empty\n else if (hasNM) {\n occurence = !isEmptyString(cellValue);\n } else {\n // If numeric type data, perform a strict equality test and\n // fallback to unformatted number string comparison\n if (numData &&\n this.hasType(colIdx, [NUMBER, FORMATTED_NUMBER]) &&\n !this.singleFlt) {\n // parseNb can return 0 for strings which are not\n // formatted numbers, in that case return the original\n // string. TODO: handle this in parseNb\n term = parseNb(term, decimal) || term;\n occurence = numData === term ||\n contains(term.toString(), numData.toString(),\n this.isExactMatch(colIdx), this.caseSensitive);\n } else {\n // Finally test search term is contained in cell data\n occurence = contains(\n term,\n cellValue,\n this.isExactMatch(colIdx),\n this.caseSensitive,\n this.ignoresDiacritics(colIdx)\n );\n }\n }\n\n }//else\n\n return occurence;\n }\n\n /**\n * Return the data of a specified column\n * @param {Number} colIndex Column index\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Array} [exclude=[]] List of row indexes to be excluded\n * @return Flat list of data for a column\n */\n getColumnData(colIndex, includeHeaders = false, exclude = []) {\n return this.getColValues(colIndex, includeHeaders, true, exclude);\n }\n\n /**\n * Return the values of a specified column\n * @param {Number} colIndex Column index\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Array} [exclude=[]] List of row indexes to be excluded\n * @return Flat list of values for a column\n */\n getColumnValues(colIndex, includeHeaders = false, exclude = []) {\n return this.getColValues(colIndex, includeHeaders, false, exclude);\n }\n\n /**\n * Return the data of a specified column\n * @param {Number} colIndex Column index\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [typed=false] Return a typed value\n * @param {Array} [exclude=[]] List of row indexes to be excluded\n * @return {Array} Flat list of data for a column\n * @private\n */\n getColValues(\n colIndex,\n includeHeaders = false,\n typed = false,\n exclude = []\n ) {\n let colValues = [];\n let getContent = typed ? this.getCellData.bind(this) :\n this.getCellValue.bind(this);\n\n if (includeHeaders) {\n colValues.push(this.getHeadersText()[colIndex]);\n }\n\n let eachRow = this.eachRow();\n eachRow((row, i) => {\n // checks if current row index appears in exclude array\n let isExludedRow = exclude.indexOf(i) !== -1;\n let cells = row.cells;\n\n // checks if row has exact cell # and is not excluded\n if (cells.length === this.nbCells && !isExludedRow) {\n let data = getContent(cells[colIndex]);\n colValues.push(data);\n }\n });\n return colValues;\n }\n\n /**\n * Return the filter's value of a specified column\n * @param {Number} index Column index\n * @return {String} Filter value\n */\n getFilterValue(index) {\n if (!this.fltGrid) {\n return;\n }\n let fltValue = '';\n let flt = this.getFilterElement(index);\n if (!flt) {\n return fltValue;\n }\n\n let fltColType = this.getFilterType(index);\n if (fltColType !== MULTIPLE && fltColType !== CHECKLIST) {\n fltValue = flt.value;\n }\n //mutiple select\n else if (fltColType === MULTIPLE) {\n fltValue = this.feature('dropdown').getValues(index);\n }\n //checklist\n else if (fltColType === CHECKLIST) {\n fltValue = this.feature('checkList').getValues(index);\n }\n //return an empty string if collection is empty or contains a single\n //empty string\n if (isArray(fltValue) && fltValue.length === 0 ||\n (fltValue.length === 1 && fltValue[0] === '')) {\n fltValue = '';\n }\n\n return fltValue;\n }\n\n /**\n * Return the filters' values\n * @return {Array} List of filters' values\n */\n getFiltersValue() {\n if (!this.fltGrid) {\n return;\n }\n let searchArgs = [];\n\n this.fltIds.forEach((id, i) => {\n let fltValue = this.getFilterValue(i);\n if (isArray(fltValue)) {\n searchArgs.push(fltValue);\n } else {\n searchArgs.push(trim(fltValue));\n }\n });\n return searchArgs;\n }\n\n /**\n * Return the ID of a specified column's filter\n * @param {Number} index Column's index\n * @return {String} ID of the filter element\n */\n getFilterId(index) {\n if (!this.fltGrid) {\n return;\n }\n return this.fltIds[index];\n }\n\n /**\n * Return the list of ids of filters matching a specified type.\n * Note: hidden filters are also returned\n *\n * @param {String} type Filter type string ('input', 'select', 'multiple',\n * 'checklist')\n * @param {Boolean} bool If true returns columns indexes instead of IDs\n * @return {[type]} List of element IDs or column indexes\n */\n getFiltersByType(type, bool) {\n if (!this.fltGrid) {\n return;\n }\n let arr = [];\n for (let i = 0, len = this.fltIds.length; i < len; i++) {\n let fltType = this.getFilterType(i);\n if (fltType === type.toLowerCase()) {\n let a = bool ? i : this.fltIds[i];\n arr.push(a);\n }\n }\n return arr;\n }\n\n /**\n * Return the filter's DOM element for a given column\n * @param {Number} index Column's index\n * @return {DOMElement}\n */\n getFilterElement(index) {\n return elm(this.fltIds[index]);\n }\n\n /**\n * Return the number of cells for a given row index\n * @param {Number} rowIndex Index of the row\n * @return {Number} Number of cells\n */\n getCellsNb(rowIndex = 0) {\n let tr = this.dom().rows[rowIndex >= 0 ? rowIndex : 0];\n return tr ? tr.cells.length : 0;\n }\n\n /**\n * Return the number of working rows starting from reference row if\n * defined\n * @param {Boolean} includeHeaders Include the headers row(s)\n * @return {Number} Number of working rows\n */\n getRowsNb(includeHeaders) {\n let nbRows = this.getWorkingRows().length;\n if (this.dom().tHead) {\n return includeHeaders ?\n nbRows + this.dom().querySelectorAll('thead > tr').length :\n nbRows;\n }\n return includeHeaders ? nbRows : nbRows - this.refRow;\n }\n\n /**\n * Return the collection of the working rows, that is, the rows belonging\n * to the tbody section(s)\n * @returns {Array}\n */\n getWorkingRows() {\n return doc.querySelectorAll(`table#${this.id} > tbody > tr`);\n }\n\n /**\n * Return the text content of a given cell\n * @param {DOMElement} Cell's DOM element\n * @return {String}\n */\n getCellValue(cell) {\n let idx = cell.cellIndex;\n let cellParser = this.cellParser;\n // Invoke cellParser for this column if any\n if (cellParser.cols.indexOf(idx) !== -1) {\n return cellParser.parse(this, cell, idx);\n } else {\n return getText(cell);\n }\n }\n\n /**\n * Return the typed data of a given cell based on the column type definition\n * @param {DOMElement} cell Cell's DOM element\n * @return {String|Number|Date}\n */\n getCellData(cell) {\n let colIndex = cell.cellIndex;\n let value = this.getCellValue(cell);\n\n if (this.hasType(colIndex, [FORMATTED_NUMBER])) {\n return parseNb(value, this.getDecimal(colIndex));\n }\n else if (this.hasType(colIndex, [NUMBER])) {\n return Number(value);\n }\n else if (this.hasType(colIndex, [DATE])){\n let dateType = this.Mod.dateType;\n return dateType.parse(value, dateType.getLocale(colIndex));\n }\n\n return value;\n }\n\n /**\n * Return the table data based on its columns data type definitions\n * with following structure:\n * [\n * [rowIndex, [data0, data1...]],\n * [rowIndex, [data0, data1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @return {Array}\n */\n getData(includeHeaders = false, excludeHiddenCols = false) {\n return this.getTableData(includeHeaders, excludeHiddenCols, true);\n }\n\n /**\n * Return the table values with following structure:\n * [\n * [rowIndex, [value0, value1...]],\n * [rowIndex, [value0, value1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @return {Array}\n */\n getValues(includeHeaders = false, excludeHiddenCols = false) {\n return this.getTableData(includeHeaders, excludeHiddenCols, false);\n }\n\n /**\n * Return the table data with following structure:\n * [\n * [rowIndex, [value0, value1...]],\n * [rowIndex, [value0, value1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @param {Boolean} [typed=false] Return typed value\n * @return {Array}\n * @private\n *\n * TODO: provide an API returning data in JSON format\n */\n getTableData(\n includeHeaders = false,\n excludeHiddenCols = false,\n typed = false\n ) {\n let tblData = [];\n let getContent = typed ? this.getCellData.bind(this) :\n this.getCellValue.bind(this);\n\n if (includeHeaders) {\n let headers = this.getHeadersText(excludeHiddenCols);\n tblData.push([this.getHeadersRowIndex(), headers]);\n }\n\n let eachRow = this.eachRow();\n eachRow((row, k) => {\n let rowData = [k, []];\n let cells = row.cells;\n for (let j = 0, len = cells.length; j < len; j++) {\n if (excludeHiddenCols && this.hasExtension('colsVisibility')) {\n if (this.extension('colsVisibility').isColHidden(j)) {\n continue;\n }\n }\n let cellContent = getContent(cells[j]);\n rowData[1].push(cellContent);\n }\n tblData.push(rowData);\n });\n return tblData;\n }\n\n /**\n * Return the filtered table data based on its columns data type definitions\n * with following structure:\n * [\n * [rowIndex, [data0, data1...]],\n * [rowIndex, [data0, data1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @return {Array}\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredData(includeHeaders = false, excludeHiddenCols = false) {\n return this.filteredData(includeHeaders, excludeHiddenCols, true);\n }\n\n /**\n * Return the filtered table values with following structure:\n * [\n * [rowIndex, [value0, value1...]],\n * [rowIndex, [value0, value1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @return {Array}\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredValues(includeHeaders = false, excludeHiddenCols = false) {\n return this.filteredData(includeHeaders, excludeHiddenCols, false);\n }\n\n /**\n * Return the filtered data with following structure:\n * [\n * [rowIndex, [value0, value1...]],\n * [rowIndex, [value0, value1...]]\n * ]\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [excludeHiddenCols=false] Exclude hidden columns\n * @param {Boolean} [typed=false] Return typed value\n * @return {Array}\n * @private\n *\n * TODO: provide an API returning data in JSON format\n */\n filteredData(\n includeHeaders = false,\n excludeHiddenCols = false,\n typed = false\n ) {\n if (this.validRowsIndex.length === 0) {\n return [];\n }\n let rows = this.dom().rows,\n filteredData = [];\n let getContent = typed ? this.getCellData.bind(this) :\n this.getCellValue.bind(this);\n\n if (includeHeaders) {\n let headers = this.getHeadersText(excludeHiddenCols);\n filteredData.push([this.getHeadersRowIndex(), headers]);\n }\n\n let validRows = this.getValidRows(true);\n for (let i = 0; i < validRows.length; i++) {\n let rData = [this.validRowsIndex[i], []],\n cells = rows[this.validRowsIndex[i]].cells;\n for (let k = 0; k < cells.length; k++) {\n if (excludeHiddenCols && this.hasExtension('colsVisibility')) {\n if (this.extension('colsVisibility').isColHidden(k)) {\n continue;\n }\n }\n let cellValue = getContent(cells[k]);\n rData[1].push(cellValue);\n }\n filteredData.push(rData);\n }\n return filteredData;\n }\n\n /**\n * Return the filtered data for a given column index\n * @param {any} colIndex Colmun's index\n * @param {boolean} [includeHeaders=false] Optional Include headers row\n * @param {any} [exclude=[]] Optional List of row indexes to be excluded\n * @return {Array} Flat list of typed values [data0, data1, data2...]\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredColumnData(colIndex, includeHeaders = false, exclude = []) {\n return this.getFilteredDataCol(\n colIndex, includeHeaders, true, exclude, false);\n }\n\n /**\n * Return the filtered and visible data for a given column index\n * @param {any} colIndex Colmun's index\n * @param {boolean} [includeHeaders=false] Optional Include headers row\n * @param {any} [exclude=[]] Optional List of row indexes to be excluded\n * @return {Array} Flat list of typed values [data0, data1, data2...]\n *\n * TODO: provide an API returning data in JSON format\n */\n getVisibleColumnData(colIndex, includeHeaders = false, exclude = []) {\n return this.getFilteredDataCol(\n colIndex, includeHeaders, true, exclude, true);\n }\n\n /**\n * Return the filtered values for a given column index\n * @param {any} colIndex Colmun's index\n * @param {boolean} [includeHeaders=false] Optional Include headers row\n * @param {any} [exclude=[]] Optional List of row indexes to be excluded\n * @return {Array} Flat list of values ['value0', 'value1', 'value2'...]\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredColumnValues(colIndex, includeHeaders = false, exclude = []) {\n return this.getFilteredDataCol(\n colIndex, includeHeaders, false, exclude, false);\n }\n\n /**\n * Return the filtered and visible values for a given column index\n * @param {any} colIndex Colmun's index\n * @param {boolean} [includeHeaders=false] Optional Include headers row\n * @param {any} [exclude=[]] Optional List of row indexes to be excluded\n * @return {Array} Flat list of values ['value0', 'value1', 'value2'...]\n *\n * TODO: provide an API returning data in JSON format\n */\n getVisibleColumnValues(colIndex, includeHeaders = false, exclude = []) {\n return this.getFilteredDataCol(\n colIndex, includeHeaders, false, exclude, true);\n }\n\n /**\n * Return the filtered data for a given column index\n * @param {Number} colIndex Colmun's index\n * @param {Boolean} [includeHeaders=false] Include headers row\n * @param {Boolean} [typed=false] Return typed value\n * @param {Array} [exclude=[]] List of row indexes to be excluded\n * @param {Boolean} [visible=true] Return only filtered and visible data\n * (relevant for paging)\n * @return {Array} Flat list of values ['val0','val1','val2'...]\n * @private\n *\n * TODO: provide an API returning data in JSON format\n */\n getFilteredDataCol(\n colIndex,\n includeHeaders = false,\n typed = false,\n exclude = [],\n visible = true\n ) {\n if (isUndef(colIndex)) {\n return [];\n }\n\n let rows = this.dom().rows;\n let getContent = typed ? this.getCellData.bind(this) :\n this.getCellValue.bind(this);\n\n // ensure valid rows index do not contain excluded rows and row is\n // displayed\n let validRows = this.getValidRows(true).filter((rowIdx) => {\n return exclude.indexOf(rowIdx) === -1 &&\n (visible ?\n this.getRowDisplay(rows[rowIdx]) !== 'none' :\n true);\n });\n\n // convert column value to expected type if necessary\n let validColValues = validRows.map((rowIdx) => {\n return getContent(rows[rowIdx].cells[colIndex]);\n });\n\n if (includeHeaders) {\n validColValues.unshift(this.getHeadersText()[colIndex]);\n }\n\n return validColValues;\n }\n\n /**\n * Get the display value of a row\n * @param {HTMLTableRowElement} row DOM element of the row\n * @return {String} Usually 'none' or ''\n */\n getRowDisplay(row) {\n return row.style.display;\n }\n\n /**\n * Validate/invalidate row by setting the 'validRow' attribute on the row\n * @param {Number} rowIndex Index of the row\n * @param {Boolean} isValid\n */\n validateRow(rowIndex, isValid) {\n let row = this.dom().rows[rowIndex];\n if (!row || !isBoolean(isValid)) {\n return;\n }\n\n // always visible rows are valid\n if (this.excludeRows.indexOf(rowIndex) !== -1) {\n isValid = true;\n }\n\n let displayFlag = isValid ? '' : NONE,\n validFlag = isValid ? 'true' : 'false';\n row.style.display = displayFlag;\n\n if (this.paging) {\n row.setAttribute('validRow', validFlag);\n }\n\n if (isValid) {\n if (this.validRowsIndex.indexOf(rowIndex) === -1) {\n this.validRowsIndex.push(rowIndex);\n }\n\n this.onRowValidated(this, rowIndex);\n this.emitter.emit('row-validated', this, rowIndex);\n }\n }\n\n /**\n * Validate all filterable rows\n */\n validateAllRows() {\n if (!this.initialized) {\n return;\n }\n this.validRowsIndex = [];\n for (let k = this.refRow; k < this.nbFilterableRows; k++) {\n this.validateRow(k, true);\n }\n }\n\n /**\n * Set search value to a given filter\n * @param {Number} index Column's index\n * @param {String or Array} query searcharg Search term\n */\n setFilterValue(index, query = '') {\n if (!this.fltGrid) {\n return;\n }\n let slc = this.getFilterElement(index),\n fltColType = this.getFilterType(index);\n\n if (!slc) {\n return;\n }\n\n if (fltColType !== MULTIPLE && fltColType !== CHECKLIST) {\n if (this.loadFltOnDemand && !this.initialized) {\n this.emitter.emit('build-select-filter', this, index,\n this.linkedFilters, this.isExternalFlt());\n }\n slc.value = query;\n }\n //multiple selects\n else if (fltColType === MULTIPLE) {\n let values = isArray(query) ? query :\n query.split(' ' + this.orOperator + ' ');\n\n if (this.loadFltOnDemand && !this.initialized) {\n this.emitter.emit('build-select-filter', this, index,\n this.linkedFilters, this.isExternalFlt());\n }\n\n this.emitter.emit('select-options', this, index, values);\n }\n //checklist\n else if (fltColType === CHECKLIST) {\n let values = [];\n if (this.loadFltOnDemand && !this.initialized) {\n this.emitter.emit('build-checklist-filter', this, index,\n this.linkedFilters);\n }\n if (isArray(query)) {\n values = query;\n } else {\n query = matchCase(query, this.caseSensitive);\n values = query.split(' ' + this.orOperator + ' ');\n }\n\n this.emitter.emit('select-checklist-options', this, index, values);\n }\n }\n\n /**\n * Set them columns' widths as per configuration\n * @param {Element} tbl DOM element\n */\n setColWidths(tbl) {\n let colWidths = this.colWidths;\n if (colWidths.length === 0) {\n return;\n }\n\n tbl = tbl || this.dom();\n\n let colTags = tag(tbl, 'col');\n let tblHasColTag = colTags.length > 0;\n let frag = !tblHasColTag ? doc.createDocumentFragment() : null;\n\n this.eachCol((k) => {\n let col;\n if (tblHasColTag) {\n col = colTags[k];\n } else {\n col = createElm('col');\n frag.appendChild(col);\n }\n col.style.width = colWidths[k];\n });\n\n if (!tblHasColTag) {\n tbl.insertBefore(frag, tbl.firstChild);\n }\n }\n\n /**\n * Exclude rows from actions\n */\n setExcludeRows() {\n if (!this.hasExcludedRows) {\n return;\n }\n this.excludeRows.forEach((rowIdx) => this.validateRow(rowIdx, true));\n }\n\n /**\n * Clear all the filters' values\n */\n clearFilters() {\n if (!this.fltGrid) {\n return;\n }\n\n this.emitter.emit('before-clearing-filters', this);\n this.onBeforeReset(this, this.getFiltersValue());\n\n for (let i = 0, len = this.fltIds.length; i < len; i++) {\n this.setFilterValue(i, '');\n }\n\n this.filter();\n\n this.onAfterReset(this);\n this.emitter.emit('after-clearing-filters', this);\n }\n\n /**\n * Return the ID of the current active filter\n * @return {String}\n */\n getActiveFilterId() {\n return this.activeFilterId;\n }\n\n /**\n * Set the ID of the current active filter\n * @param {String} filterId Element ID\n */\n setActiveFilterId(filterId) {\n this.activeFilterId = filterId;\n }\n\n /**\n * Return the column index for a given filter ID\n * @param {string} [filterId=''] Filter ID\n * @return {Number} Column index\n */\n getColumnIndexFromFilterId(filterId = '') {\n let idx = filterId.split('_')[0];\n idx = idx.split(this.prfxFlt)[1];\n return parseInt(idx, 10);\n }\n\n /**\n * Build filter element ID for a given column index\n * @param {any} colIndex\n * @return {String} Filter element ID string\n * @private\n */\n buildFilterId(colIndex) {\n return `${this.prfxFlt}${colIndex}_${this.id}`;\n }\n\n /**\n * Check if has external filters\n * @returns {Boolean}\n * @private\n */\n isExternalFlt() {\n return this.externalFltIds.length > 0;\n }\n\n /**\n * Returns styles path\n * @returns {String}\n * @private\n */\n getStylePath() {\n return defaultsStr(this.config.style_path, this.basePath + 'style/');\n }\n\n /**\n * Returns main stylesheet path\n * @returns {String}\n * @private\n */\n getStylesheetPath() {\n return defaultsStr(this.config.stylesheet,\n this.getStylePath() + 'tablefilter.css');\n }\n\n /**\n * Returns themes path\n * @returns {String}\n * @private\n */\n getThemesPath() {\n return defaultsStr(this.config.themes_path,\n this.getStylePath() + 'themes/');\n }\n\n /**\n * Make specified column's filter active\n * @param colIndex Index of a column\n */\n activateFilter(colIndex) {\n if (isUndef(colIndex)) {\n return;\n }\n this.setActiveFilterId(this.getFilterId(colIndex));\n }\n\n /**\n * Refresh the filters subject to linking ('select', 'multiple',\n * 'checklist' type)\n */\n linkFilters() {\n if (!this.linkedFilters || !this.activeFilterId) {\n return;\n }\n let slcA1 = this.getFiltersByType(SELECT, true),\n slcA2 = this.getFiltersByType(MULTIPLE, true),\n slcA3 = this.getFiltersByType(CHECKLIST, true),\n slcIndex = slcA1.concat(slcA2);\n slcIndex = slcIndex.concat(slcA3);\n\n slcIndex.forEach((colIdx) => {\n let curSlc = this.getFilterElement(colIdx);\n let slcSelectedValue = this.getFilterValue(colIdx);\n\n //1st option needs to be inserted\n if (this.loadFltOnDemand) {\n let opt0 = createOpt(this.getClearFilterText(colIdx), '');\n curSlc.innerHTML = '';\n curSlc.appendChild(opt0);\n }\n\n if (slcA3.indexOf(colIdx) !== -1) {\n this.emitter.emit('build-checklist-filter', this, colIdx,\n true);\n } else {\n this.emitter.emit('build-select-filter', this, colIdx,\n true);\n }\n\n this.setFilterValue(colIdx, slcSelectedValue);\n });\n }\n\n /**\n * Determine if passed filter column implements exact query match\n * @param {Number} colIndex Column index\n * @return {Boolean}\n */\n isExactMatch(colIndex) {\n let fltType = this.getFilterType(colIndex);\n return this.exactMatchByCol[colIndex] || this.exactMatch ||\n fltType !== INPUT;\n }\n\n /**\n * Check if passed row is valid\n * @param {Number} rowIndex Row index\n * @return {Boolean}\n */\n isRowValid(rowIndex) {\n return this.getValidRows().indexOf(rowIndex) !== -1;\n }\n\n /**\n * Check if passed row is visible\n * @param {Number} rowIndex Row index\n * @return {Boolean}\n */\n isRowDisplayed(rowIndex) {\n let row = this.dom().rows[rowIndex];\n return this.getRowDisplay(row) === '';\n }\n\n /**\n * Check if specified column filter ignores diacritics.\n * Note this is only applicable to input filter types.\n * @param {Number} colIndex Column index\n * @return {Boolean}\n */\n ignoresDiacritics(colIndex) {\n let ignoreDiac = this.ignoreDiacritics;\n if (isArray(ignoreDiac)) {\n return ignoreDiac[colIndex];\n }\n return Boolean(ignoreDiac);\n }\n\n /**\n * Return clear all text for specified filter column\n * @param {Number} colIndex Column index\n * @return {String}\n */\n getClearFilterText(colIndex) {\n let clearText = this.clearFilterText;\n if (isArray(clearText)) {\n return clearText[colIndex];\n }\n return clearText;\n }\n\n /**\n * Column iterator invoking continue and break condition callbacks if any\n * then calling supplied callback for each item\n * @param {Function} [fn=EMPTY_FN] callback\n * @param {Function} [continueFn=EMPTY_FN] continue condition callback\n * @param {Function} [breakFn=EMPTY_FN] break condition callback\n */\n eachCol(fn = EMPTY_FN, continueFn = EMPTY_FN, breakFn = EMPTY_FN) {\n let len = this.getCellsNb(this.refRow);\n for (let i = 0; i < len; i++) {\n if (continueFn(i) === true) {\n continue;\n }\n if (breakFn(i) === true) {\n break;\n }\n fn(i);\n }\n }\n\n /**\n * Rows iterator starting from supplied row index or defaulting to reference\n * row index. Closure function accepts a callback function and optional\n * continue and break callbacks.\n * @param {Number} startIdx Row index from which filtering starts\n */\n eachRow(startIdx = this.refRow) {\n return (fn = EMPTY_FN, continueFn = EMPTY_FN, breakFn = EMPTY_FN) => {\n let rows = this.dom().rows;\n let len = this.getRowsNb(true);\n for (let i = startIdx; i < len; i++) {\n if (continueFn(rows[i], i) === true) {\n continue;\n }\n if (breakFn(rows[i], i) === true) {\n break;\n }\n fn(rows[i], i);\n }\n };\n }\n\n /**\n * Check if passed script or stylesheet is already imported\n * @param {String} filePath Ressource path\n * @param {String} type Possible values: 'script' or 'link'\n * @return {Boolean}\n */\n isImported(filePath, type = 'script') {\n let imported = false,\n attr = type === 'script' ? 'src' : 'href',\n files = tag(doc, type);\n for (let i = 0, len = files.length; i < len; i++) {\n if (isUndef(files[i][attr])) {\n continue;\n }\n if (files[i][attr].match(filePath)) {\n imported = true;\n break;\n }\n }\n return imported;\n }\n\n /**\n * Import script or stylesheet\n * @param {String} fileId Ressource ID\n * @param {String} filePath Ressource path\n * @param {Function} callback Callback\n * @param {String} type Possible values: 'script' or 'link'\n */\n import(fileId, filePath, callback, type = 'script') {\n if (this.isImported(filePath, type)) {\n return;\n }\n let o = this,\n isLoaded = false,\n file,\n head = tag(doc, 'head')[0];\n\n if (type.toLowerCase() === 'link') {\n file = createElm('link',\n ['id', fileId], ['type', 'text/css'],\n ['rel', 'stylesheet'], ['href', filePath]\n );\n } else {\n file = createElm('script',\n ['id', fileId],\n ['type', 'text/javascript'], ['src', filePath]\n );\n }\n\n //Browser <> IE onload event works only for scripts, not for stylesheets\n file.onload = file.onreadystatechange = () => {\n if (!isLoaded &&\n (!this.readyState || this.readyState === 'loaded' ||\n this.readyState === 'complete')) {\n isLoaded = true;\n if (typeof callback === 'function') {\n callback.call(null, o);\n }\n }\n };\n file.onerror = () => {\n throw new Error(`TableFilter could not load: ${filePath}`);\n };\n head.appendChild(file);\n }\n\n /**\n * Check if table has filters grid\n * @return {Boolean}\n */\n isInitialized() {\n return this.initialized;\n }\n\n /**\n * Get list of filter IDs\n * @return {Array} List of filters ids\n */\n getFiltersId() {\n return this.fltIds || [];\n }\n\n /**\n * Get filtered (valid) rows indexes\n * @param {Boolean} reCalc Force calculation of filtered rows list\n * @return {Array} List of row indexes\n */\n getValidRows(reCalc) {\n if (!reCalc) {\n return this.validRowsIndex;\n }\n\n this.validRowsIndex = [];\n\n let eachRow = this.eachRow();\n eachRow((row) => {\n if (!this.paging) {\n if (this.getRowDisplay(row) !== NONE) {\n this.validRowsIndex.push(row.rowIndex);\n }\n } else {\n if (row.getAttribute('validRow') === 'true' ||\n row.getAttribute('validRow') === null) {\n this.validRowsIndex.push(row.rowIndex);\n }\n }\n });\n return this.validRowsIndex;\n }\n\n /**\n * Get the index of the row containing the filters\n * @return {Number}\n */\n getFiltersRowIndex() {\n return this.filtersRowIndex;\n }\n\n /**\n * Get the index of the headers row\n * @return {Number}\n */\n getHeadersRowIndex() {\n return this.headersRow;\n }\n\n /**\n * Get the row index from where the filtering process start (1st filterable\n * row)\n * @return {Number}\n */\n getStartRowIndex() {\n return this.refRow;\n }\n\n /**\n * Get the index of the last row\n * @return {Number}\n */\n getLastRowIndex() {\n let nbRows = this.getRowsNb(true);\n return (nbRows - 1);\n }\n\n /**\n * Determine whether the specified column has one of the passed types\n * @param {Number} colIndex Column index\n * @param {Array} [types=[]] List of column types\n * @return {Boolean}\n */\n hasType(colIndex, types = []) {\n if (this.colTypes.length === 0) {\n return false;\n }\n let colType = this.colTypes[colIndex];\n if (isObj(colType)) {\n colType = colType.type;\n }\n return types.indexOf(colType) !== -1;\n }\n\n /**\n * Get the header DOM element for a given column index\n * @param {Number} colIndex Column index\n * @return {Element}\n */\n getHeaderElement(colIndex) {\n let table = this.gridLayout ? this.Mod.gridLayout.headTbl : this.dom();\n let tHead = tag(table, 'thead');\n let rowIdx = this.getHeadersRowIndex();\n let header;\n if (tHead.length === 0) {\n header = table.rows[rowIdx].cells[colIndex];\n }\n if (tHead.length === 1) {\n header = tHead[0].rows[rowIdx].cells[colIndex];\n }\n return header;\n }\n\n /**\n * Return the list of headers' text\n * @param {Boolean} excludeHiddenCols Optional: exclude hidden columns\n * @return {Array} list of headers' text\n */\n getHeadersText(excludeHiddenCols = false) {\n let headers = [];\n this.eachCol(\n (j) => {\n let header = this.getHeaderElement(j);\n let headerText = getFirstTextNode(header);\n headers.push(headerText);\n },\n // continue condition function\n (j) => {\n if (excludeHiddenCols && this.hasExtension('colsVisibility')) {\n return this.extension('colsVisibility').isColHidden(j);\n }\n return false;\n }\n );\n return headers;\n }\n\n /**\n * Return the filter type for a specified column\n * @param {Number} colIndex Column's index\n * @return {String}\n */\n getFilterType(colIndex) {\n return this.filterTypes[colIndex];\n }\n\n /**\n * Get the total number of filterable rows\n * @return {Number}\n */\n getFilterableRowsNb() {\n return this.getRowsNb(false);\n }\n\n /**\n * Return the total number of valid rows\n * @param {Boolean} [reCalc=false] Forces calculation of filtered rows\n * @return {Number}\n */\n getValidRowsNb(reCalc = false) {\n return this.getValidRows(reCalc).length;\n }\n\n /**\n * Return the working DOM element\n * @return {HTMLTableElement}\n */\n dom() {\n return this.tbl;\n }\n\n /**\n * Return the decimal separator for supplied column as per column type\n * configuration or global setting\n * @param {Number} colIndex Column index\n * @returns {String} '.' or ','\n */\n getDecimal(colIndex) {\n let decimal = this.decimalSeparator;\n if (this.hasType(colIndex, [FORMATTED_NUMBER])) {\n let colType = this.colTypes[colIndex];\n if (colType.hasOwnProperty('decimal')) {\n decimal = colType.decimal;\n }\n }\n return decimal;\n }\n\n /**\n * Get the configuration object (literal object)\n * @return {Object}\n */\n config() {\n return this.cfg;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/tablefilter.js",
"access": "public",
@@ -16939,7 +17113,7 @@
"lineNumber": 1
},
{
- "__docId__": 936,
+ "__docId__": 937,
"kind": "variable",
"name": "doc",
"memberof": "src/tablefilter.js",
@@ -16960,7 +17134,7 @@
"ignore": true
},
{
- "__docId__": 937,
+ "__docId__": 938,
"kind": "class",
"name": "TableFilter",
"memberof": "src/tablefilter.js",
@@ -16981,7 +17155,7 @@
"interface": false
},
{
- "__docId__": 938,
+ "__docId__": 939,
"kind": "constructor",
"name": "constructor",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17036,7 +17210,7 @@
]
},
{
- "__docId__": 939,
+ "__docId__": 940,
"kind": "member",
"name": "id",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17052,10 +17226,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 940,
+ "__docId__": 941,
"kind": "member",
"name": "version",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17074,7 +17249,7 @@
}
},
{
- "__docId__": 941,
+ "__docId__": 942,
"kind": "member",
"name": "year",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17090,10 +17265,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 942,
+ "__docId__": 943,
"kind": "member",
"name": "tbl",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17109,10 +17285,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 943,
+ "__docId__": 944,
"kind": "member",
"name": "refRow",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17131,7 +17308,7 @@
}
},
{
- "__docId__": 944,
+ "__docId__": 945,
"kind": "member",
"name": "headersRow",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17147,10 +17324,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 945,
+ "__docId__": 946,
"kind": "member",
"name": "cfg",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17166,10 +17344,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 946,
+ "__docId__": 947,
"kind": "member",
"name": "nbFilterableRows",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17185,10 +17364,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 947,
+ "__docId__": 948,
"kind": "member",
"name": "nbCells",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17204,10 +17384,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 948,
+ "__docId__": 949,
"kind": "member",
"name": "hasConfig",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17223,10 +17404,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 949,
+ "__docId__": 950,
"kind": "member",
"name": "initialized",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17235,6 +17417,7 @@
"access": "private",
"description": null,
"lineNumber": 119,
+ "ignore": true,
"type": {
"types": [
"boolean"
@@ -17242,7 +17425,7 @@
}
},
{
- "__docId__": 956,
+ "__docId__": 957,
"kind": "member",
"name": "emitter",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17261,7 +17444,7 @@
}
},
{
- "__docId__": 958,
+ "__docId__": 959,
"kind": "member",
"name": "filterTypes",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17277,10 +17460,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 959,
+ "__docId__": 960,
"kind": "member",
"name": "basePath",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17299,7 +17483,7 @@
}
},
{
- "__docId__": 960,
+ "__docId__": 961,
"kind": "member",
"name": "fltGrid",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17318,7 +17502,7 @@
}
},
{
- "__docId__": 961,
+ "__docId__": 962,
"kind": "member",
"name": "gridLayout",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17338,7 +17522,7 @@
}
},
{
- "__docId__": 962,
+ "__docId__": 963,
"kind": "member",
"name": "filtersRowIndex",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17357,7 +17541,7 @@
}
},
{
- "__docId__": 964,
+ "__docId__": 965,
"kind": "member",
"name": "fltCellTag",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17376,7 +17560,7 @@
}
},
{
- "__docId__": 965,
+ "__docId__": 966,
"kind": "member",
"name": "fltIds",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17392,10 +17576,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 966,
+ "__docId__": 967,
"kind": "member",
"name": "validRowsIndex",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17411,10 +17596,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 967,
+ "__docId__": 968,
"kind": "member",
"name": "stylePath",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17433,7 +17619,7 @@
}
},
{
- "__docId__": 968,
+ "__docId__": 969,
"kind": "member",
"name": "stylesheet",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17452,7 +17638,7 @@
}
},
{
- "__docId__": 969,
+ "__docId__": 970,
"kind": "member",
"name": "stylesheetId",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17468,10 +17654,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 970,
+ "__docId__": 971,
"kind": "member",
"name": "fltsRowCssClass",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17490,7 +17677,7 @@
}
},
{
- "__docId__": 971,
+ "__docId__": 972,
"kind": "member",
"name": "enableIcons",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17509,7 +17696,7 @@
}
},
{
- "__docId__": 972,
+ "__docId__": 973,
"kind": "member",
"name": "alternateRows",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17528,7 +17715,7 @@
}
},
{
- "__docId__": 973,
+ "__docId__": 974,
"kind": "member",
"name": "colWidths",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17547,7 +17734,7 @@
}
},
{
- "__docId__": 974,
+ "__docId__": 975,
"kind": "member",
"name": "fltCssClass",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17566,7 +17753,7 @@
}
},
{
- "__docId__": 975,
+ "__docId__": 976,
"kind": "member",
"name": "fltMultiCssClass",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17585,7 +17772,7 @@
}
},
{
- "__docId__": 976,
+ "__docId__": 977,
"kind": "member",
"name": "fltSmallCssClass",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17604,7 +17791,7 @@
}
},
{
- "__docId__": 977,
+ "__docId__": 978,
"kind": "member",
"name": "singleFltCssClass",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17623,7 +17810,7 @@
}
},
{
- "__docId__": 978,
+ "__docId__": 979,
"kind": "member",
"name": "enterKey",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17642,7 +17829,7 @@
}
},
{
- "__docId__": 979,
+ "__docId__": 980,
"kind": "member",
"name": "onBeforeFilter",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17661,7 +17848,7 @@
}
},
{
- "__docId__": 980,
+ "__docId__": 981,
"kind": "member",
"name": "onAfterFilter",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17680,7 +17867,7 @@
}
},
{
- "__docId__": 981,
+ "__docId__": 982,
"kind": "member",
"name": "caseSensitive",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17699,7 +17886,7 @@
}
},
{
- "__docId__": 982,
+ "__docId__": 983,
"kind": "member",
"name": "hasExactMatchByCol",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17715,10 +17902,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 983,
+ "__docId__": 984,
"kind": "member",
"name": "exactMatchByCol",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17737,7 +17925,7 @@
}
},
{
- "__docId__": 984,
+ "__docId__": 985,
"kind": "member",
"name": "exactMatch",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17756,7 +17944,7 @@
}
},
{
- "__docId__": 985,
+ "__docId__": 986,
"kind": "member",
"name": "ignoreDiacritics",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17776,7 +17964,7 @@
}
},
{
- "__docId__": 986,
+ "__docId__": 987,
"kind": "member",
"name": "linkedFilters",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17795,7 +17983,7 @@
}
},
{
- "__docId__": 987,
+ "__docId__": 988,
"kind": "member",
"name": "disableExcludedOptions",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17814,7 +18002,7 @@
}
},
{
- "__docId__": 988,
+ "__docId__": 989,
"kind": "member",
"name": "activeFilterId",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17830,10 +18018,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 989,
+ "__docId__": 990,
"kind": "member",
"name": "hasExcludedRows",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17849,10 +18038,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 990,
+ "__docId__": 991,
"kind": "member",
"name": "excludeRows",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17871,7 +18061,7 @@
}
},
{
- "__docId__": 991,
+ "__docId__": 992,
"kind": "member",
"name": "externalFltIds",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17890,7 +18080,7 @@
}
},
{
- "__docId__": 992,
+ "__docId__": 993,
"kind": "member",
"name": "onFiltersLoaded",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17909,7 +18099,7 @@
}
},
{
- "__docId__": 993,
+ "__docId__": 994,
"kind": "member",
"name": "singleFlt",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17929,7 +18119,7 @@
}
},
{
- "__docId__": 994,
+ "__docId__": 995,
"kind": "member",
"name": "singleFltExcludeCols",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17945,7 +18135,7 @@
}
},
{
- "__docId__": 995,
+ "__docId__": 996,
"kind": "member",
"name": "onRowValidated",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17964,7 +18154,7 @@
}
},
{
- "__docId__": 996,
+ "__docId__": 997,
"kind": "member",
"name": "cellParser",
"memberof": "src/tablefilter.js~TableFilter",
@@ -17983,7 +18173,7 @@
}
},
{
- "__docId__": 997,
+ "__docId__": 998,
"kind": "member",
"name": "watermark",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18003,7 +18193,7 @@
}
},
{
- "__docId__": 998,
+ "__docId__": 999,
"kind": "member",
"name": "isWatermarkArray",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18019,10 +18209,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 999,
+ "__docId__": 1000,
"kind": "member",
"name": "help",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18041,7 +18232,7 @@
}
},
{
- "__docId__": 1000,
+ "__docId__": 1001,
"kind": "member",
"name": "popupFilters",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18061,7 +18252,7 @@
}
},
{
- "__docId__": 1001,
+ "__docId__": 1002,
"kind": "member",
"name": "markActiveColumns",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18080,7 +18271,7 @@
}
},
{
- "__docId__": 1002,
+ "__docId__": 1003,
"kind": "member",
"name": "clearFilterText",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18100,7 +18291,7 @@
}
},
{
- "__docId__": 1003,
+ "__docId__": 1004,
"kind": "member",
"name": "enableEmptyOption",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18119,7 +18310,7 @@
}
},
{
- "__docId__": 1004,
+ "__docId__": 1005,
"kind": "member",
"name": "emptyText",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18138,7 +18329,7 @@
}
},
{
- "__docId__": 1005,
+ "__docId__": 1006,
"kind": "member",
"name": "enableNonEmptyOption",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18157,7 +18348,7 @@
}
},
{
- "__docId__": 1006,
+ "__docId__": 1007,
"kind": "member",
"name": "nonEmptyText",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18176,7 +18367,7 @@
}
},
{
- "__docId__": 1007,
+ "__docId__": 1008,
"kind": "member",
"name": "onSlcChange",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18195,7 +18386,7 @@
}
},
{
- "__docId__": 1008,
+ "__docId__": 1009,
"kind": "member",
"name": "sortSlc",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18215,7 +18406,7 @@
}
},
{
- "__docId__": 1009,
+ "__docId__": 1010,
"kind": "member",
"name": "isSortNumAsc",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18231,10 +18422,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1010,
+ "__docId__": 1011,
"kind": "member",
"name": "sortNumAsc",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18253,7 +18445,7 @@
}
},
{
- "__docId__": 1011,
+ "__docId__": 1012,
"kind": "member",
"name": "isSortNumDesc",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18269,10 +18461,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1012,
+ "__docId__": 1013,
"kind": "member",
"name": "sortNumDesc",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18291,7 +18484,7 @@
}
},
{
- "__docId__": 1013,
+ "__docId__": 1014,
"kind": "member",
"name": "loadFltOnDemand",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18310,7 +18503,7 @@
}
},
{
- "__docId__": 1014,
+ "__docId__": 1015,
"kind": "member",
"name": "hasCustomOptions",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18329,7 +18522,7 @@
}
},
{
- "__docId__": 1015,
+ "__docId__": 1016,
"kind": "member",
"name": "customOptions",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18348,7 +18541,7 @@
}
},
{
- "__docId__": 1016,
+ "__docId__": 1017,
"kind": "member",
"name": "rgxOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18367,7 +18560,7 @@
}
},
{
- "__docId__": 1017,
+ "__docId__": 1018,
"kind": "member",
"name": "emOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18386,7 +18579,7 @@
}
},
{
- "__docId__": 1018,
+ "__docId__": 1019,
"kind": "member",
"name": "nmOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18405,7 +18598,7 @@
}
},
{
- "__docId__": 1019,
+ "__docId__": 1020,
"kind": "member",
"name": "orOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18424,7 +18617,7 @@
}
},
{
- "__docId__": 1020,
+ "__docId__": 1021,
"kind": "member",
"name": "anOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18443,7 +18636,7 @@
}
},
{
- "__docId__": 1021,
+ "__docId__": 1022,
"kind": "member",
"name": "grOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18462,7 +18655,7 @@
}
},
{
- "__docId__": 1022,
+ "__docId__": 1023,
"kind": "member",
"name": "lwOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18481,7 +18674,7 @@
}
},
{
- "__docId__": 1023,
+ "__docId__": 1024,
"kind": "member",
"name": "leOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18500,7 +18693,7 @@
}
},
{
- "__docId__": 1024,
+ "__docId__": 1025,
"kind": "member",
"name": "geOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18519,7 +18712,7 @@
}
},
{
- "__docId__": 1025,
+ "__docId__": 1026,
"kind": "member",
"name": "dfOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18538,7 +18731,7 @@
}
},
{
- "__docId__": 1026,
+ "__docId__": 1027,
"kind": "member",
"name": "lkOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18557,7 +18750,7 @@
}
},
{
- "__docId__": 1027,
+ "__docId__": 1028,
"kind": "member",
"name": "eqOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18576,7 +18769,7 @@
}
},
{
- "__docId__": 1028,
+ "__docId__": 1029,
"kind": "member",
"name": "stOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18595,7 +18788,7 @@
}
},
{
- "__docId__": 1029,
+ "__docId__": 1030,
"kind": "member",
"name": "enOperator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18614,7 +18807,7 @@
}
},
{
- "__docId__": 1030,
+ "__docId__": 1031,
"kind": "member",
"name": "separator",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18633,7 +18826,7 @@
}
},
{
- "__docId__": 1031,
+ "__docId__": 1032,
"kind": "member",
"name": "rowsCounter",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18653,7 +18846,7 @@
}
},
{
- "__docId__": 1032,
+ "__docId__": 1033,
"kind": "member",
"name": "statusBar",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18673,7 +18866,7 @@
}
},
{
- "__docId__": 1033,
+ "__docId__": 1034,
"kind": "member",
"name": "loader",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18693,7 +18886,7 @@
}
},
{
- "__docId__": 1034,
+ "__docId__": 1035,
"kind": "member",
"name": "displayBtn",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18712,7 +18905,7 @@
}
},
{
- "__docId__": 1035,
+ "__docId__": 1036,
"kind": "member",
"name": "btnText",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18731,7 +18924,7 @@
}
},
{
- "__docId__": 1036,
+ "__docId__": 1037,
"kind": "member",
"name": "btnCssClass",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18750,7 +18943,7 @@
}
},
{
- "__docId__": 1037,
+ "__docId__": 1038,
"kind": "member",
"name": "btnReset",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18770,7 +18963,7 @@
}
},
{
- "__docId__": 1038,
+ "__docId__": 1039,
"kind": "member",
"name": "onBeforeReset",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18789,7 +18982,7 @@
}
},
{
- "__docId__": 1039,
+ "__docId__": 1040,
"kind": "member",
"name": "onAfterReset",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18808,7 +19001,7 @@
}
},
{
- "__docId__": 1040,
+ "__docId__": 1041,
"kind": "member",
"name": "paging",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18828,7 +19021,7 @@
}
},
{
- "__docId__": 1041,
+ "__docId__": 1042,
"kind": "member",
"name": "nbHiddenRows",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18844,10 +19037,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1042,
+ "__docId__": 1043,
"kind": "member",
"name": "autoFilter",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18859,6 +19053,7 @@
"type": {
"nullable": null,
"types": [
+ "Object",
"Boolean"
],
"spread": false,
@@ -18866,14 +19061,14 @@
}
},
{
- "__docId__": 1043,
+ "__docId__": 1044,
"kind": "member",
"name": "autoFilterDelay",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
"longname": "src/tablefilter.js~TableFilter#autoFilterDelay",
"access": "public",
- "description": "Auto-filter delay in msecs",
+ "description": "Auto-filter delay in milliseconds",
"lineNumber": 751,
"type": {
"nullable": null,
@@ -18885,7 +19080,7 @@
}
},
{
- "__docId__": 1044,
+ "__docId__": 1045,
"kind": "member",
"name": "isUserTyping",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18893,7 +19088,7 @@
"longname": "src/tablefilter.js~TableFilter#isUserTyping",
"access": "private",
"description": "Indicate whether user is typing",
- "lineNumber": 759,
+ "lineNumber": 760,
"type": {
"nullable": null,
"types": [
@@ -18901,10 +19096,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1045,
+ "__docId__": 1046,
"kind": "member",
"name": "autoFilterTimer",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18912,7 +19108,7 @@
"longname": "src/tablefilter.js~TableFilter#autoFilterTimer",
"access": "private",
"description": "Auto-filter interval ID",
- "lineNumber": 766,
+ "lineNumber": 767,
"type": {
"nullable": null,
"types": [
@@ -18920,10 +19116,11 @@
],
"spread": false,
"description": null
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1046,
+ "__docId__": 1047,
"kind": "member",
"name": "highlightKeywords",
"memberof": "src/tablefilter.js~TableFilter",
@@ -18931,7 +19128,7 @@
"longname": "src/tablefilter.js~TableFilter#highlightKeywords",
"access": "public",
"description": "Enable keyword highlighting behaviour",
- "lineNumber": 772,
+ "lineNumber": 773,
"type": {
"nullable": null,
"types": [
@@ -18941,36 +19138,16 @@
"description": null
}
},
- {
- "__docId__": 1047,
- "kind": "member",
- "name": "noResults",
- "memberof": "src/tablefilter.js~TableFilter",
- "static": false,
- "longname": "src/tablefilter.js~TableFilter#noResults",
- "access": "public",
- "description": "Enable no results message UI component",
- "lineNumber": 778,
- "type": {
- "nullable": null,
- "types": [
- "Object",
- "Boolean"
- ],
- "spread": false,
- "description": null
- }
- },
{
"__docId__": 1048,
"kind": "member",
- "name": "state",
+ "name": "noResults",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
- "longname": "src/tablefilter.js~TableFilter#state",
+ "longname": "src/tablefilter.js~TableFilter#noResults",
"access": "public",
- "description": "Enable state persistence",
- "lineNumber": 785,
+ "description": "Enable no results message UI component",
+ "lineNumber": 779,
"type": {
"nullable": null,
"types": [
@@ -18984,16 +19161,17 @@
{
"__docId__": 1049,
"kind": "member",
- "name": "dateType",
+ "name": "state",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
- "longname": "src/tablefilter.js~TableFilter#dateType",
- "access": "private",
- "description": "Enable date type module",
- "lineNumber": 794,
+ "longname": "src/tablefilter.js~TableFilter#state",
+ "access": "public",
+ "description": "Enable state persistence",
+ "lineNumber": 786,
"type": {
"nullable": null,
"types": [
+ "Object",
"Boolean"
],
"spread": false,
@@ -19003,32 +19181,33 @@
{
"__docId__": 1050,
"kind": "member",
+ "name": "dateType",
+ "memberof": "src/tablefilter.js~TableFilter",
+ "static": false,
+ "longname": "src/tablefilter.js~TableFilter#dateType",
+ "access": "private",
+ "description": "Enable date type module",
+ "lineNumber": 795,
+ "type": {
+ "nullable": null,
+ "types": [
+ "Boolean"
+ ],
+ "spread": false,
+ "description": null
+ },
+ "ignore": true
+ },
+ {
+ "__docId__": 1051,
+ "kind": "member",
"name": "locale",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
"longname": "src/tablefilter.js~TableFilter#locale",
"access": "public",
"description": "Define default locale, default to 'en' as per Sugar Date module:\nhttps://sugarjs.com/docs/#/DateLocales",
- "lineNumber": 801,
- "type": {
- "nullable": null,
- "types": [
- "String"
- ],
- "spread": false,
- "description": null
- }
- },
- {
- "__docId__": 1051,
- "kind": "member",
- "name": "thousandsSeparator",
- "memberof": "src/tablefilter.js~TableFilter",
- "static": false,
- "longname": "src/tablefilter.js~TableFilter#thousandsSeparator",
- "access": "public",
- "description": "Define thousands separator ',' or '.', defaults to ','",
- "lineNumber": 807,
+ "lineNumber": 802,
"type": {
"nullable": null,
"types": [
@@ -19041,13 +19220,13 @@
{
"__docId__": 1052,
"kind": "member",
- "name": "decimalSeparator",
+ "name": "thousandsSeparator",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
- "longname": "src/tablefilter.js~TableFilter#decimalSeparator",
+ "longname": "src/tablefilter.js~TableFilter#thousandsSeparator",
"access": "public",
- "description": "Define decimal separator ',' or '.', defaults to '.'",
- "lineNumber": 813,
+ "description": "Define thousands separator ',' or '.', defaults to ','",
+ "lineNumber": 808,
"type": {
"nullable": null,
"types": [
@@ -19060,13 +19239,32 @@
{
"__docId__": 1053,
"kind": "member",
+ "name": "decimalSeparator",
+ "memberof": "src/tablefilter.js~TableFilter",
+ "static": false,
+ "longname": "src/tablefilter.js~TableFilter#decimalSeparator",
+ "access": "public",
+ "description": "Define decimal separator ',' or '.', defaults to '.'",
+ "lineNumber": 814,
+ "type": {
+ "nullable": null,
+ "types": [
+ "String"
+ ],
+ "spread": false,
+ "description": null
+ }
+ },
+ {
+ "__docId__": 1054,
+ "kind": "member",
"name": "colTypes",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
"longname": "src/tablefilter.js~TableFilter#colTypes",
"access": "public",
"description": "Define data types on a column basis, possible values 'string',\n'number', 'formatted-number', 'date', 'ipaddress' ie:\ncol_types : [\n 'string', 'date', 'number',\n { type: 'formatted-number', decimal: ',', thousands: '.' },\n { type: 'date', locale: 'en-gb' },\n { type: 'date', format: ['{dd}-{months}-{yyyy|yy}'] }\n]\n\nRefer to https://sugarjs.com/docs/#/DateParsing for exhaustive\ninformation on date parsing formats supported by Sugar Date",
- "lineNumber": 829,
+ "lineNumber": 830,
"type": {
"nullable": null,
"types": [
@@ -19077,7 +19275,7 @@
}
},
{
- "__docId__": 1054,
+ "__docId__": 1055,
"kind": "member",
"name": "prfxTf",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19085,23 +19283,8 @@
"longname": "src/tablefilter.js~TableFilter#prfxTf",
"access": "private",
"description": "Main prefix",
- "lineNumber": 836,
- "type": {
- "types": [
- "string"
- ]
- }
- },
- {
- "__docId__": 1055,
- "kind": "member",
- "name": "prfxFlt",
- "memberof": "src/tablefilter.js~TableFilter",
- "static": false,
- "longname": "src/tablefilter.js~TableFilter#prfxFlt",
- "access": "private",
- "description": "Filter's ID prefix (inputs - selects)",
- "lineNumber": 842,
+ "lineNumber": 837,
+ "ignore": true,
"type": {
"types": [
"string"
@@ -19111,13 +19294,14 @@
{
"__docId__": 1056,
"kind": "member",
- "name": "prfxValButton",
+ "name": "prfxFlt",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
- "longname": "src/tablefilter.js~TableFilter#prfxValButton",
+ "longname": "src/tablefilter.js~TableFilter#prfxFlt",
"access": "private",
- "description": "Button's ID prefix",
- "lineNumber": 848,
+ "description": "Filter's ID prefix (inputs - selects)",
+ "lineNumber": 843,
+ "ignore": true,
"type": {
"types": [
"string"
@@ -19127,13 +19311,14 @@
{
"__docId__": 1057,
"kind": "member",
- "name": "prfxResponsive",
+ "name": "prfxValButton",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
- "longname": "src/tablefilter.js~TableFilter#prfxResponsive",
+ "longname": "src/tablefilter.js~TableFilter#prfxValButton",
"access": "private",
- "description": "Responsive Css class",
- "lineNumber": 854,
+ "description": "Button's ID prefix",
+ "lineNumber": 849,
+ "ignore": true,
"type": {
"types": [
"string"
@@ -19143,13 +19328,30 @@
{
"__docId__": 1058,
"kind": "member",
+ "name": "prfxResponsive",
+ "memberof": "src/tablefilter.js~TableFilter",
+ "static": false,
+ "longname": "src/tablefilter.js~TableFilter#prfxResponsive",
+ "access": "private",
+ "description": "Responsive Css class",
+ "lineNumber": 855,
+ "ignore": true,
+ "type": {
+ "types": [
+ "string"
+ ]
+ }
+ },
+ {
+ "__docId__": 1059,
+ "kind": "member",
"name": "extensions",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
"longname": "src/tablefilter.js~TableFilter#extensions",
"access": "public",
"description": "List of loaded extensions",
- "lineNumber": 861,
+ "lineNumber": 862,
"type": {
"nullable": null,
"types": [
@@ -19160,7 +19362,7 @@
}
},
{
- "__docId__": 1059,
+ "__docId__": 1060,
"kind": "member",
"name": "enableDefaultTheme",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19168,26 +19370,7 @@
"longname": "src/tablefilter.js~TableFilter#enableDefaultTheme",
"access": "public",
"description": "Enable default theme",
- "lineNumber": 868,
- "type": {
- "nullable": null,
- "types": [
- "Boolean"
- ],
- "spread": false,
- "description": null
- }
- },
- {
- "__docId__": 1060,
- "kind": "member",
- "name": "hasThemes",
- "memberof": "src/tablefilter.js~TableFilter",
- "static": false,
- "longname": "src/tablefilter.js~TableFilter#hasThemes",
- "access": "private",
- "description": "Determine whether themes are enables",
- "lineNumber": 875,
+ "lineNumber": 869,
"type": {
"nullable": null,
"types": [
@@ -19200,32 +19383,33 @@
{
"__docId__": 1061,
"kind": "member",
+ "name": "hasThemes",
+ "memberof": "src/tablefilter.js~TableFilter",
+ "static": false,
+ "longname": "src/tablefilter.js~TableFilter#hasThemes",
+ "access": "private",
+ "description": "Determine whether themes are enables",
+ "lineNumber": 876,
+ "type": {
+ "nullable": null,
+ "types": [
+ "Boolean"
+ ],
+ "spread": false,
+ "description": null
+ },
+ "ignore": true
+ },
+ {
+ "__docId__": 1062,
+ "kind": "member",
"name": "themes",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
"longname": "src/tablefilter.js~TableFilter#themes",
"access": "public",
"description": "List of themes, ie:\nthemes: [{ name: 'skyblue' }]",
- "lineNumber": 882,
- "type": {
- "nullable": null,
- "types": [
- "Array"
- ],
- "spread": false,
- "description": null
- }
- },
- {
- "__docId__": 1062,
- "kind": "member",
- "name": "themesPath",
- "memberof": "src/tablefilter.js~TableFilter",
- "static": false,
- "longname": "src/tablefilter.js~TableFilter#themesPath",
- "access": "public",
- "description": "Define path to themes assets, defaults to\n'tablefilter/style/themes/'. Usage:\nthemes: [{ name: 'skyblue' }]",
- "lineNumber": 890,
+ "lineNumber": 883,
"type": {
"nullable": null,
"types": [
@@ -19238,13 +19422,32 @@
{
"__docId__": 1063,
"kind": "member",
+ "name": "themesPath",
+ "memberof": "src/tablefilter.js~TableFilter",
+ "static": false,
+ "longname": "src/tablefilter.js~TableFilter#themesPath",
+ "access": "public",
+ "description": "Define path to themes assets, defaults to\n'tablefilter/style/themes/'. Usage:\nthemes: [{ name: 'skyblue' }]",
+ "lineNumber": 891,
+ "type": {
+ "nullable": null,
+ "types": [
+ "Array"
+ ],
+ "spread": false,
+ "description": null
+ }
+ },
+ {
+ "__docId__": 1064,
+ "kind": "member",
"name": "responsive",
"memberof": "src/tablefilter.js~TableFilter",
"static": false,
"longname": "src/tablefilter.js~TableFilter#responsive",
"access": "public",
"description": "Enable responsive layout",
- "lineNumber": 896,
+ "lineNumber": 897,
"type": {
"nullable": null,
"types": [
@@ -19255,7 +19458,7 @@
}
},
{
- "__docId__": 1064,
+ "__docId__": 1065,
"kind": "member",
"name": "toolbar",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19263,7 +19466,7 @@
"longname": "src/tablefilter.js~TableFilter#toolbar",
"access": "public",
"description": "Enable toolbar component",
- "lineNumber": 902,
+ "lineNumber": 903,
"type": {
"nullable": null,
"types": [
@@ -19275,7 +19478,7 @@
}
},
{
- "__docId__": 1065,
+ "__docId__": 1066,
"kind": "member",
"name": "Mod",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19283,23 +19486,8 @@
"longname": "src/tablefilter.js~TableFilter#Mod",
"access": "private",
"description": "Features registry",
- "lineNumber": 908,
- "type": {
- "types": [
- "{}"
- ]
- }
- },
- {
- "__docId__": 1066,
- "kind": "member",
- "name": "ExtRegistry",
- "memberof": "src/tablefilter.js~TableFilter",
- "static": false,
- "longname": "src/tablefilter.js~TableFilter#ExtRegistry",
- "access": "private",
- "description": "Extensions registry",
- "lineNumber": 914,
+ "lineNumber": 909,
+ "ignore": true,
"type": {
"types": [
"{}"
@@ -19308,6 +19496,23 @@
},
{
"__docId__": 1067,
+ "kind": "member",
+ "name": "ExtRegistry",
+ "memberof": "src/tablefilter.js~TableFilter",
+ "static": false,
+ "longname": "src/tablefilter.js~TableFilter#ExtRegistry",
+ "access": "private",
+ "description": "Extensions registry",
+ "lineNumber": 915,
+ "ignore": true,
+ "type": {
+ "types": [
+ "{}"
+ ]
+ }
+ },
+ {
+ "__docId__": 1068,
"kind": "method",
"name": "init",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19317,12 +19522,12 @@
"longname": "src/tablefilter.js~TableFilter#init",
"access": "public",
"description": "Initialise features and layout",
- "lineNumber": 925,
+ "lineNumber": 926,
"params": [],
"return": null
},
{
- "__docId__": 1071,
+ "__docId__": 1072,
"kind": "method",
"name": "detectKey",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19332,7 +19537,7 @@
"longname": "src/tablefilter.js~TableFilter#detectKey",
"access": "public",
"description": "Detect key",
- "lineNumber": 1063,
+ "lineNumber": 1064,
"params": [
{
"nullable": null,
@@ -19348,7 +19553,7 @@
"return": null
},
{
- "__docId__": 1074,
+ "__docId__": 1075,
"kind": "method",
"name": "onKeyUp",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19358,7 +19563,7 @@
"longname": "src/tablefilter.js~TableFilter#onKeyUp",
"access": "public",
"description": "Filter's keyup event: if auto-filter on, detect user is typing and filter\ncolumns",
- "lineNumber": 1086,
+ "lineNumber": 1085,
"params": [
{
"nullable": null,
@@ -19374,7 +19579,7 @@
"return": null
},
{
- "__docId__": 1080,
+ "__docId__": 1081,
"kind": "method",
"name": "onKeyDown",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19389,7 +19594,7 @@
"return": null
},
{
- "__docId__": 1082,
+ "__docId__": 1083,
"kind": "method",
"name": "onInpFocus",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19415,7 +19620,7 @@
"return": null
},
{
- "__docId__": 1083,
+ "__docId__": 1084,
"kind": "method",
"name": "onInpBlur",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19430,7 +19635,7 @@
"return": null
},
{
- "__docId__": 1085,
+ "__docId__": 1086,
"kind": "method",
"name": "_insertFiltersRow",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19441,6 +19646,7 @@
"access": "private",
"description": "Insert filters row at initialization",
"lineNumber": 1146,
+ "ignore": true,
"params": [],
"return": {
"types": [
@@ -19449,7 +19655,7 @@
}
},
{
- "__docId__": 1086,
+ "__docId__": 1087,
"kind": "method",
"name": "_initNoFilters",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19460,11 +19666,12 @@
"access": "private",
"description": "Initialize filtersless table",
"lineNumber": 1175,
+ "ignore": true,
"params": [],
"return": null
},
{
- "__docId__": 1089,
+ "__docId__": 1090,
"kind": "method",
"name": "_buildInputFilter",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19507,10 +19714,11 @@
"description": "Container DOM element"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 1090,
+ "__docId__": 1091,
"kind": "method",
"name": "_buildSubmitButton",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19533,10 +19741,11 @@
"description": "Container DOM element"
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 1091,
+ "__docId__": 1092,
"kind": "method",
"name": "instantiateFeatures",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19561,10 +19770,11 @@
"description": ""
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 1092,
+ "__docId__": 1093,
"kind": "method",
"name": "initFeatures",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19589,10 +19799,11 @@
"description": ""
}
],
+ "ignore": true,
"return": null
},
{
- "__docId__": 1093,
+ "__docId__": 1094,
"kind": "method",
"name": "feature",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19625,7 +19836,7 @@
}
},
{
- "__docId__": 1094,
+ "__docId__": 1095,
"kind": "method",
"name": "initExtensions",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19640,7 +19851,7 @@
"return": null
},
{
- "__docId__": 1095,
+ "__docId__": 1096,
"kind": "method",
"name": "loadExtension",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19666,7 +19877,7 @@
"return": null
},
{
- "__docId__": 1096,
+ "__docId__": 1097,
"kind": "method",
"name": "extension",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19699,7 +19910,7 @@
}
},
{
- "__docId__": 1097,
+ "__docId__": 1098,
"kind": "method",
"name": "hasExtension",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19732,7 +19943,7 @@
}
},
{
- "__docId__": 1098,
+ "__docId__": 1099,
"kind": "method",
"name": "registerExtension",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19768,7 +19979,7 @@
"return": null
},
{
- "__docId__": 1099,
+ "__docId__": 1100,
"kind": "method",
"name": "destroyExtensions",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19783,7 +19994,7 @@
"return": null
},
{
- "__docId__": 1100,
+ "__docId__": 1101,
"kind": "method",
"name": "loadThemes",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19798,7 +20009,7 @@
"return": null
},
{
- "__docId__": 1102,
+ "__docId__": 1103,
"kind": "method",
"name": "getStylesheet",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19830,7 +20041,7 @@
]
},
{
- "__docId__": 1103,
+ "__docId__": 1104,
"kind": "method",
"name": "destroy",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19845,7 +20056,7 @@
"return": null
},
{
- "__docId__": 1108,
+ "__docId__": 1109,
"kind": "method",
"name": "removeExternalFlts",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19860,7 +20071,7 @@
"return": null
},
{
- "__docId__": 1109,
+ "__docId__": 1110,
"kind": "method",
"name": "isCustomOptions",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19893,7 +20104,7 @@
}
},
{
- "__docId__": 1110,
+ "__docId__": 1111,
"kind": "method",
"name": "getCustomOptions",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19926,7 +20137,7 @@
}
},
{
- "__docId__": 1111,
+ "__docId__": 1112,
"kind": "method",
"name": "filter",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19941,7 +20152,7 @@
"return": null
},
{
- "__docId__": 1114,
+ "__docId__": 1115,
"kind": "method",
"name": "_match",
"memberof": "src/tablefilter.js~TableFilter",
@@ -19991,10 +20202,11 @@
],
"spread": false,
"description": ""
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1115,
+ "__docId__": 1116,
"kind": "method",
"name": "getColumnData",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20051,7 +20263,7 @@
}
},
{
- "__docId__": 1116,
+ "__docId__": 1117,
"kind": "method",
"name": "getColumnValues",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20108,7 +20320,7 @@
}
},
{
- "__docId__": 1117,
+ "__docId__": 1118,
"kind": "method",
"name": "getColValues",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20174,10 +20386,11 @@
],
"spread": false,
"description": "Flat list of data for a column"
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1118,
+ "__docId__": 1119,
"kind": "method",
"name": "getFilterValue",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20210,7 +20423,7 @@
}
},
{
- "__docId__": 1119,
+ "__docId__": 1120,
"kind": "method",
"name": "getFiltersValue",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20232,7 +20445,7 @@
"params": []
},
{
- "__docId__": 1120,
+ "__docId__": 1121,
"kind": "method",
"name": "getFilterId",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20265,7 +20478,7 @@
}
},
{
- "__docId__": 1121,
+ "__docId__": 1122,
"kind": "method",
"name": "getFiltersByType",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20308,7 +20521,7 @@
}
},
{
- "__docId__": 1122,
+ "__docId__": 1123,
"kind": "method",
"name": "getFilterElement",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20341,7 +20554,7 @@
}
},
{
- "__docId__": 1123,
+ "__docId__": 1124,
"kind": "method",
"name": "getCellsNb",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20374,7 +20587,7 @@
}
},
{
- "__docId__": 1124,
+ "__docId__": 1125,
"kind": "method",
"name": "getRowsNb",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20407,7 +20620,7 @@
}
},
{
- "__docId__": 1125,
+ "__docId__": 1126,
"kind": "method",
"name": "getWorkingRows",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20435,7 +20648,7 @@
"params": []
},
{
- "__docId__": 1126,
+ "__docId__": 1127,
"kind": "method",
"name": "getCellValue",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20468,7 +20681,7 @@
}
},
{
- "__docId__": 1127,
+ "__docId__": 1128,
"kind": "method",
"name": "getCellData",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20503,7 +20716,7 @@
}
},
{
- "__docId__": 1128,
+ "__docId__": 1129,
"kind": "method",
"name": "getData",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20550,7 +20763,7 @@
}
},
{
- "__docId__": 1129,
+ "__docId__": 1130,
"kind": "method",
"name": "getValues",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20597,7 +20810,7 @@
}
},
{
- "__docId__": 1130,
+ "__docId__": 1131,
"kind": "method",
"name": "getTableData",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20653,10 +20866,11 @@
],
"spread": false,
"description": ""
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1131,
+ "__docId__": 1132,
"kind": "method",
"name": "getFilteredData",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20703,7 +20917,7 @@
}
},
{
- "__docId__": 1132,
+ "__docId__": 1133,
"kind": "method",
"name": "getFilteredValues",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20750,7 +20964,7 @@
}
},
{
- "__docId__": 1133,
+ "__docId__": 1134,
"kind": "method",
"name": "filteredData",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20806,10 +21020,11 @@
],
"spread": false,
"description": ""
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1134,
+ "__docId__": 1135,
"kind": "method",
"name": "getFilteredColumnData",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20866,7 +21081,7 @@
}
},
{
- "__docId__": 1135,
+ "__docId__": 1136,
"kind": "method",
"name": "getVisibleColumnData",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20923,7 +21138,7 @@
}
},
{
- "__docId__": 1136,
+ "__docId__": 1137,
"kind": "method",
"name": "getFilteredColumnValues",
"memberof": "src/tablefilter.js~TableFilter",
@@ -20980,7 +21195,7 @@
}
},
{
- "__docId__": 1137,
+ "__docId__": 1138,
"kind": "method",
"name": "getVisibleColumnValues",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21037,7 +21252,7 @@
}
},
{
- "__docId__": 1138,
+ "__docId__": 1139,
"kind": "method",
"name": "getFilteredDataCol",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21115,10 +21330,11 @@
],
"spread": false,
"description": "Flat list of values ['val0','val1','val2'...]"
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1139,
+ "__docId__": 1140,
"kind": "method",
"name": "getRowDisplay",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21151,7 +21367,7 @@
}
},
{
- "__docId__": 1140,
+ "__docId__": 1141,
"kind": "method",
"name": "validateRow",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21187,7 +21403,7 @@
"return": null
},
{
- "__docId__": 1141,
+ "__docId__": 1142,
"kind": "method",
"name": "validateAllRows",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21202,7 +21418,7 @@
"return": null
},
{
- "__docId__": 1143,
+ "__docId__": 1144,
"kind": "method",
"name": "setFilterValue",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21238,7 +21454,7 @@
"return": null
},
{
- "__docId__": 1144,
+ "__docId__": 1145,
"kind": "method",
"name": "setColWidths",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21264,7 +21480,7 @@
"return": null
},
{
- "__docId__": 1145,
+ "__docId__": 1146,
"kind": "method",
"name": "setExcludeRows",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21279,7 +21495,7 @@
"return": null
},
{
- "__docId__": 1146,
+ "__docId__": 1147,
"kind": "method",
"name": "clearFilters",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21294,7 +21510,7 @@
"return": null
},
{
- "__docId__": 1147,
+ "__docId__": 1148,
"kind": "method",
"name": "getActiveFilterId",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21316,7 +21532,7 @@
"params": []
},
{
- "__docId__": 1148,
+ "__docId__": 1149,
"kind": "method",
"name": "setActiveFilterId",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21342,7 +21558,7 @@
"return": null
},
{
- "__docId__": 1150,
+ "__docId__": 1151,
"kind": "method",
"name": "getColumnIndexFromFilterId",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21377,7 +21593,7 @@
}
},
{
- "__docId__": 1151,
+ "__docId__": 1152,
"kind": "method",
"name": "buildFilterId",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21407,10 +21623,11 @@
],
"spread": false,
"description": "Filter element ID string"
- }
+ },
+ "ignore": true
},
{
- "__docId__": 1152,
+ "__docId__": 1153,
"kind": "method",
"name": "isExternalFlt",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21435,10 +21652,11 @@
"spread": false,
"description": ""
},
+ "ignore": true,
"params": []
},
{
- "__docId__": 1153,
+ "__docId__": 1154,
"kind": "method",
"name": "getStylePath",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21463,10 +21681,11 @@
"spread": false,
"description": ""
},
+ "ignore": true,
"params": []
},
{
- "__docId__": 1154,
+ "__docId__": 1155,
"kind": "method",
"name": "getStylesheetPath",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21491,10 +21710,11 @@
"spread": false,
"description": ""
},
+ "ignore": true,
"params": []
},
{
- "__docId__": 1155,
+ "__docId__": 1156,
"kind": "method",
"name": "getThemesPath",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21519,10 +21739,11 @@
"spread": false,
"description": ""
},
+ "ignore": true,
"params": []
},
{
- "__docId__": 1156,
+ "__docId__": 1157,
"kind": "method",
"name": "activateFilter",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21548,7 +21769,7 @@
"return": null
},
{
- "__docId__": 1157,
+ "__docId__": 1158,
"kind": "method",
"name": "linkFilters",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21563,7 +21784,7 @@
"return": null
},
{
- "__docId__": 1158,
+ "__docId__": 1159,
"kind": "method",
"name": "isExactMatch",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21596,7 +21817,7 @@
}
},
{
- "__docId__": 1159,
+ "__docId__": 1160,
"kind": "method",
"name": "isRowValid",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21629,7 +21850,7 @@
}
},
{
- "__docId__": 1160,
+ "__docId__": 1161,
"kind": "method",
"name": "isRowDisplayed",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21662,7 +21883,7 @@
}
},
{
- "__docId__": 1161,
+ "__docId__": 1162,
"kind": "method",
"name": "ignoresDiacritics",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21695,7 +21916,7 @@
}
},
{
- "__docId__": 1162,
+ "__docId__": 1163,
"kind": "method",
"name": "getClearFilterText",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21728,7 +21949,7 @@
}
},
{
- "__docId__": 1163,
+ "__docId__": 1164,
"kind": "method",
"name": "eachCol",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21780,7 +22001,7 @@
"return": null
},
{
- "__docId__": 1164,
+ "__docId__": 1165,
"kind": "method",
"name": "eachRow",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21810,7 +22031,7 @@
}
},
{
- "__docId__": 1165,
+ "__docId__": 1166,
"kind": "method",
"name": "isImported",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21853,7 +22074,7 @@
}
},
{
- "__docId__": 1166,
+ "__docId__": 1167,
"kind": "method",
"name": "import",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21909,7 +22130,7 @@
"return": null
},
{
- "__docId__": 1167,
+ "__docId__": 1168,
"kind": "method",
"name": "isInitialized",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21931,7 +22152,7 @@
"params": []
},
{
- "__docId__": 1168,
+ "__docId__": 1169,
"kind": "method",
"name": "getFiltersId",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21953,7 +22174,7 @@
"params": []
},
{
- "__docId__": 1169,
+ "__docId__": 1170,
"kind": "method",
"name": "getValidRows",
"memberof": "src/tablefilter.js~TableFilter",
@@ -21986,7 +22207,7 @@
}
},
{
- "__docId__": 1171,
+ "__docId__": 1172,
"kind": "method",
"name": "getFiltersRowIndex",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22008,7 +22229,7 @@
"params": []
},
{
- "__docId__": 1172,
+ "__docId__": 1173,
"kind": "method",
"name": "getHeadersRowIndex",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22030,7 +22251,7 @@
"params": []
},
{
- "__docId__": 1173,
+ "__docId__": 1174,
"kind": "method",
"name": "getStartRowIndex",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22052,7 +22273,7 @@
"params": []
},
{
- "__docId__": 1174,
+ "__docId__": 1175,
"kind": "method",
"name": "getLastRowIndex",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22074,7 +22295,7 @@
"params": []
},
{
- "__docId__": 1175,
+ "__docId__": 1176,
"kind": "method",
"name": "hasType",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22119,7 +22340,7 @@
}
},
{
- "__docId__": 1176,
+ "__docId__": 1177,
"kind": "method",
"name": "getHeaderElement",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22152,7 +22373,7 @@
}
},
{
- "__docId__": 1177,
+ "__docId__": 1178,
"kind": "method",
"name": "getHeadersText",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22185,7 +22406,7 @@
}
},
{
- "__docId__": 1178,
+ "__docId__": 1179,
"kind": "method",
"name": "getFilterType",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22218,7 +22439,7 @@
}
},
{
- "__docId__": 1179,
+ "__docId__": 1180,
"kind": "method",
"name": "getFilterableRowsNb",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22240,7 +22461,7 @@
"params": []
},
{
- "__docId__": 1180,
+ "__docId__": 1181,
"kind": "method",
"name": "getValidRowsNb",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22275,7 +22496,7 @@
}
},
{
- "__docId__": 1181,
+ "__docId__": 1182,
"kind": "method",
"name": "dom",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22297,7 +22518,7 @@
"params": []
},
{
- "__docId__": 1182,
+ "__docId__": 1183,
"kind": "method",
"name": "getDecimal",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22336,7 +22557,7 @@
}
},
{
- "__docId__": 1183,
+ "__docId__": 1184,
"kind": "method",
"name": "config",
"memberof": "src/tablefilter.js~TableFilter",
@@ -22358,7 +22579,7 @@
"params": []
},
{
- "__docId__": 1184,
+ "__docId__": 1185,
"kind": "file",
"name": "src/types.js",
"content": "\n/**\n * Types utilities\n */\n\nconst UNDEFINED = void 0;\n\n/**\n * Return an empty function\n * @return {Function}\n */\nexport const EMPTY_FN = function() {};\n\n/**\n * Check passed argument is an object\n * @param {Object} obj\n * @return {Boolean}\n */\nexport const isObj =\n (obj) => Object.prototype.toString.call(obj) === '[object Object]';\n\n/**\n * Check passed argument is a function\n * @param {Function} obj\n * @return {Boolean}\n */\nexport const isFn =\n (obj) => Object.prototype.toString.call(obj) === '[object Function]';\n\n/**\n * Check passed argument is an array\n * @param {Array} obj\n * @return {Boolean}\n */\nexport const isArray =\n (obj) => Object.prototype.toString.call(obj) === '[object Array]';\n\n/**\n * Check passed argument is a string\n * @param {String} obj obj\n * @returns {Boolean}\n */\nexport const isString =\n (obj) => Object.prototype.toString.call(obj) === '[object String]';\n\n/**\n * Check passed argument is a number\n * @param {Number} obj\n * @returns {Boolean}\n */\nexport const isNumber =\n (obj) => Object.prototype.toString.call(obj) === '[object Number]';\n\n/**\n * Check passed argument is a boolean\n * @param {Boolean} obj\n * @returns {Boolean}\n */\nexport const isBoolean =\n (obj) => Object.prototype.toString.call(obj) === '[object Boolean]';\n\n/**\n * Check passed argument is undefined\n * @param {Any} obj\n * @return {Boolean}\n */\nexport const isUndef = (obj) => obj === UNDEFINED;\n\n/**\n * Check passed argument is null\n * @param {Any} obj\n * @return {Boolean}\n */\nexport const isNull = (obj) => obj === null;\n\n/**\n * Check passed argument is empty (undefined, null or empty string)\n * @param {Any} obj\n * @return {Boolean}\n */\nexport const isEmpty = (obj) => isUndef(obj) || isNull(obj) || obj.length === 0;\n",
@@ -22369,7 +22590,7 @@
"lineNumber": 1
},
{
- "__docId__": 1185,
+ "__docId__": 1186,
"kind": "variable",
"name": "UNDEFINED",
"memberof": "src/types.js",
@@ -22389,7 +22610,7 @@
"ignore": true
},
{
- "__docId__": 1186,
+ "__docId__": 1187,
"kind": "function",
"name": "EMPTY_FN",
"memberof": "src/types.js",
@@ -22414,7 +22635,7 @@
"params": []
},
{
- "__docId__": 1187,
+ "__docId__": 1188,
"kind": "function",
"name": "isObj",
"memberof": "src/types.js",
@@ -22450,7 +22671,7 @@
}
},
{
- "__docId__": 1188,
+ "__docId__": 1189,
"kind": "function",
"name": "isFn",
"memberof": "src/types.js",
@@ -22486,7 +22707,7 @@
}
},
{
- "__docId__": 1189,
+ "__docId__": 1190,
"kind": "function",
"name": "isArray",
"memberof": "src/types.js",
@@ -22522,7 +22743,7 @@
}
},
{
- "__docId__": 1190,
+ "__docId__": 1191,
"kind": "function",
"name": "isString",
"memberof": "src/types.js",
@@ -22564,7 +22785,7 @@
}
},
{
- "__docId__": 1191,
+ "__docId__": 1192,
"kind": "function",
"name": "isNumber",
"memberof": "src/types.js",
@@ -22606,7 +22827,7 @@
}
},
{
- "__docId__": 1192,
+ "__docId__": 1193,
"kind": "function",
"name": "isBoolean",
"memberof": "src/types.js",
@@ -22648,7 +22869,7 @@
}
},
{
- "__docId__": 1193,
+ "__docId__": 1194,
"kind": "function",
"name": "isUndef",
"memberof": "src/types.js",
@@ -22684,7 +22905,7 @@
}
},
{
- "__docId__": 1194,
+ "__docId__": 1195,
"kind": "function",
"name": "isNull",
"memberof": "src/types.js",
@@ -22720,7 +22941,7 @@
}
},
{
- "__docId__": 1195,
+ "__docId__": 1196,
"kind": "function",
"name": "isEmpty",
"memberof": "src/types.js",
@@ -22765,7 +22986,7 @@
},
{
"kind": "packageJSON",
- "content": "{\n \"name\": \"tablefilter\",\n \"version\": \"0.6.16\",\n \"description\": \"A Javascript library making HTML tables filterable and a bit more\",\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Max Guglielmi\",\n \"url\": \"https://github.com/koalyptus\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/koalyptus/TableFilter.git\"\n },\n \"keywords\": [\n \"filter\",\n \"table\",\n \"javascript\",\n \"filterable\",\n \"grid\",\n \"datagrid\",\n \"sort\",\n \"pagination\"\n ],\n \"scripts\": {\n \"lint\": \"eslint src/**/*.js test/*.js *.js\",\n \"dev\": \"grunt dev\",\n \"build\": \"grunt build\",\n \"build:demos\": \"grunt build-demos\",\n \"build:test\": \"grunt build-test\",\n \"server\": \"grunt server\",\n \"test\": \"grunt test\",\n \"codecov\": \"./node_modules/.bin/codecov\",\n \"esdoc\": \"esdoc\",\n \"dist\": \"grunt\",\n \"deploy\": \"grunt deploy\",\n \"start\": \"npm run server\"\n },\n \"publishConfig\": {\n \"tag\": \"next\"\n },\n \"devDependencies\": {\n \"babel-core\": \"^6.24.1\",\n \"babel-eslint\": \"8.2.1\",\n \"babel-loader\": \"^7.0.0\",\n \"babel-plugin-transform-es2015-classes\": \"^6.24.1\",\n \"babel-preset-es2015\": \"^6.24.1\",\n \"clean-webpack-plugin\": \"^0.1.16\",\n \"codecov\": \"3.0.0\",\n \"diacritics\": \"1.3.0\",\n \"esdoc\": \"1.0.4\",\n \"esdoc-standard-plugin\": \"1.0.0\",\n \"eslint\": \"4.17.0\",\n \"format-number\": \"3.0.0\",\n \"grunt\": \"^1.0.1\",\n \"grunt-babel\": \"^7.0.0\",\n \"grunt-cli\": \"1.2.0\",\n \"grunt-contrib-clean\": \"^1.1.0\",\n \"grunt-contrib-connect\": \"^1.0.2\",\n \"grunt-contrib-copy\": \"^1.0.0\",\n \"grunt-contrib-stylus\": \"^1.2.0\",\n \"grunt-contrib-watch\": \"^1.0.0\",\n \"grunt-gh-pages\": \"^2.0.0\",\n \"grunt-qunit-istanbul\": \"1.0.0\",\n \"grunt-shell\": \"2.1.0\",\n \"grunt-string-replace\": \"^1.3.1\",\n \"grunt-webpack\": \"^3.0.0\",\n \"isparta-loader\": \"2.0.0\",\n \"script-loader\": \"^0.7.0\",\n \"string-replace-webpack-plugin\": \"^0.1.3\",\n \"sugar-date\": \"2.0.4\",\n \"webpack\": \"^3.0.0\",\n \"webpack-dev-server\": \"^2.4.5\"\n },\n \"dependencies\": {},\n \"bugs\": {\n \"url\": \"https://github.com/koalyptus/TableFilter/issues\"\n },\n \"homepage\": \"http://koalyptus.github.io/TableFilter\"\n}\n",
+ "content": "{\n \"name\": \"tablefilter\",\n \"version\": \"0.6.17\",\n \"description\": \"A Javascript library making HTML tables filterable and a bit more\",\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Max Guglielmi\",\n \"url\": \"https://github.com/koalyptus\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/koalyptus/TableFilter.git\"\n },\n \"keywords\": [\n \"filter\",\n \"table\",\n \"javascript\",\n \"filterable\",\n \"grid\",\n \"datagrid\",\n \"sort\",\n \"pagination\"\n ],\n \"scripts\": {\n \"lint\": \"eslint src/**/*.js test/*.js *.js\",\n \"dev\": \"grunt dev\",\n \"build\": \"grunt build\",\n \"build:demos\": \"grunt build-demos\",\n \"build:test\": \"grunt build-test\",\n \"server\": \"grunt server\",\n \"test\": \"grunt test\",\n \"codecov\": \"./node_modules/.bin/codecov\",\n \"esdoc\": \"esdoc\",\n \"dist\": \"grunt\",\n \"deploy\": \"grunt deploy\",\n \"start\": \"npm run server\"\n },\n \"publishConfig\": {\n \"tag\": \"next\"\n },\n \"devDependencies\": {\n \"babel-core\": \"^6.24.1\",\n \"babel-eslint\": \"8.2.1\",\n \"babel-loader\": \"^7.0.0\",\n \"babel-plugin-transform-es2015-classes\": \"^6.24.1\",\n \"babel-preset-es2015\": \"^6.24.1\",\n \"clean-webpack-plugin\": \"^0.1.16\",\n \"codecov\": \"3.0.0\",\n \"diacritics\": \"1.3.0\",\n \"esdoc\": \"1.0.4\",\n \"esdoc-standard-plugin\": \"1.0.0\",\n \"eslint\": \"4.17.0\",\n \"format-number\": \"3.0.0\",\n \"grunt\": \"^1.0.1\",\n \"grunt-babel\": \"^7.0.0\",\n \"grunt-cli\": \"1.2.0\",\n \"grunt-contrib-clean\": \"^1.1.0\",\n \"grunt-contrib-connect\": \"^1.0.2\",\n \"grunt-contrib-copy\": \"^1.0.0\",\n \"grunt-contrib-stylus\": \"^1.2.0\",\n \"grunt-contrib-watch\": \"^1.0.0\",\n \"grunt-gh-pages\": \"^2.0.0\",\n \"grunt-qunit-istanbul\": \"1.0.0\",\n \"grunt-shell\": \"2.1.0\",\n \"grunt-string-replace\": \"^1.3.1\",\n \"grunt-webpack\": \"^3.0.0\",\n \"isparta-loader\": \"2.0.0\",\n \"script-loader\": \"^0.7.0\",\n \"string-replace-webpack-plugin\": \"^0.1.3\",\n \"sugar-date\": \"2.0.4\",\n \"webpack\": \"^3.0.0\",\n \"webpack-dev-server\": \"^2.4.5\"\n },\n \"dependencies\": {},\n \"bugs\": {\n \"url\": \"https://github.com/koalyptus/TableFilter/issues\"\n },\n \"homepage\": \"http://koalyptus.github.io/TableFilter\"\n}\n",
"longname": "/home/travis/build/koalyptus/TableFilter/package.json",
"name": "package.json",
"static": true,
diff --git a/docs/script/search_index.js b/docs/script/search_index.js
index 4f129bc8..336380a2 100644
--- a/docs/script/search_index.js
+++ b/docs/script/search_index.js
@@ -473,6 +473,12 @@ window.esdocSearchIndex = [
"isFn tablefilter/src/types.js",
"function"
],
+ [
+ "tablefilter/src/event.js~iskeypressed",
+ "function/index.html#static-function-isKeyPressed",
+ "isKeyPressed tablefilter/src/event.js",
+ "function"
+ ],
[
"tablefilter/src/types.js~isnull",
"function/index.html#static-function-isNull",
@@ -953,30 +959,6 @@ window.esdocSearchIndex = [
"src/extensions/advancedGrid/adapterEzEditTable.js",
"file"
],
- [
- "src/extensions/advancedgrid/adapterezedittable.js~adapterezedittable#_ezedittable",
- "class/src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable.html#instance-member-_ezEditTable",
- "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_ezEditTable",
- "member"
- ],
- [
- "src/extensions/advancedgrid/adapterezedittable.js~adapterezedittable#_setadvancedgrid",
- "class/src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable.html#instance-method-_setAdvancedGrid",
- "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_setAdvancedGrid",
- "method"
- ],
- [
- "src/extensions/advancedgrid/adapterezedittable.js~adapterezedittable#_toggleforinputfilter",
- "class/src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable.html#instance-method-_toggleForInputFilter",
- "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_toggleForInputFilter",
- "method"
- ],
- [
- "src/extensions/advancedgrid/adapterezedittable.js~adapterezedittable#cfg",
- "class/src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable.html#instance-member-cfg",
- "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#cfg",
- "member"
- ],
[
"src/extensions/advancedgrid/adapterezedittable.js~adapterezedittable#constructor",
"class/src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable.html#instance-constructor-constructor",
@@ -1061,12 +1043,6 @@ window.esdocSearchIndex = [
"src/extensions/colOps/colOps.js",
"file"
],
- [
- "src/extensions/colops/colops.js~colops#calc",
- "class/src/extensions/colOps/colOps.js~ColOps.html#instance-method-calc",
- "src/extensions/colOps/colOps.js~ColOps#calc",
- "method"
- ],
[
"src/extensions/colops/colops.js~colops#calcall",
"class/src/extensions/colOps/colOps.js~ColOps.html#instance-method-calcAll",
@@ -1127,12 +1103,6 @@ window.esdocSearchIndex = [
"src/extensions/colOps/colOps.js~ColOps#columnCalc",
"method"
],
- [
- "src/extensions/colops/colops.js~colops#configureformat",
- "class/src/extensions/colOps/colOps.js~ColOps.html#instance-method-configureFormat",
- "src/extensions/colOps/colOps.js~ColOps#configureFormat",
- "method"
- ],
[
"src/extensions/colops/colops.js~colops#constructor",
"class/src/extensions/colOps/colOps.js~ColOps.html#instance-constructor-constructor",
@@ -1223,60 +1193,18 @@ window.esdocSearchIndex = [
"src/extensions/colOps/colOps.js~ColOps#totRowIndexes",
"member"
],
- [
- "src/extensions/colops/colops.js~colops#writeresult",
- "class/src/extensions/colOps/colOps.js~ColOps.html#instance-method-writeResult",
- "src/extensions/colOps/colOps.js~ColOps#writeResult",
- "method"
- ],
[
"src/extensions/colsvisibility/colsvisibility.js",
"file/src/extensions/colsVisibility/colsVisibility.js.html",
"src/extensions/colsVisibility/colsVisibility.js",
"file"
],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#_getheadertext",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-method-_getHeaderText",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_getHeaderText",
- "method"
- ],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#_hideatstart",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-method-_hideAtStart",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideAtStart",
- "method"
- ],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#_hidecells",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-method-_hideCells",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideCells",
- "method"
- ],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#_hidecol",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-method-_hideCol",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideCol",
- "method"
- ],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#_hideelements",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-method-_hideElements",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideElements",
- "method"
- ],
[
"src/extensions/colsvisibility/colsvisibility.js~colsvisibility#atstart",
"class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-atStart",
"src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#atStart",
"member"
],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#boundmouseup",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-boundMouseup",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#boundMouseup",
- "member"
- ],
[
"src/extensions/colsvisibility/colsvisibility.js~colsvisibility#btnclosecssclass",
"class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-btnCloseCssClass",
@@ -1301,12 +1229,6 @@ window.esdocSearchIndex = [
"src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnCssClass",
"member"
],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#btnel",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-btnEl",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnEl",
- "member"
- ],
[
"src/extensions/colsvisibility/colsvisibility.js~colsvisibility#btnhtml",
"class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-btnHtml",
@@ -1337,12 +1259,6 @@ window.esdocSearchIndex = [
"src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#buildManager",
"method"
],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#checkitem",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-method-checkItem",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#checkItem",
- "method"
- ],
[
"src/extensions/colsvisibility/colsvisibility.js~colsvisibility#constructor",
"class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-constructor-constructor",
@@ -1355,12 +1271,6 @@ window.esdocSearchIndex = [
"src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contCssClass",
"member"
],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#contel",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-contEl",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contEl",
- "member"
- ],
[
"src/extensions/colsvisibility/colsvisibility.js~colsvisibility#conteltgtid",
"class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-contElTgtId",
@@ -1415,12 +1325,6 @@ window.esdocSearchIndex = [
"src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#headersText",
"member"
],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#hiddencols",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-hiddenCols",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#hiddenCols",
- "member"
- ],
[
"src/extensions/colsvisibility/colsvisibility.js~colsvisibility#hidecol",
"class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-method-hideCol",
@@ -1529,12 +1433,6 @@ window.esdocSearchIndex = [
"src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onLoaded",
"member"
],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#onmouseup",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-method-onMouseup",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onMouseup",
- "method"
- ],
[
"src/extensions/colsvisibility/colsvisibility.js~colsvisibility#sethidden",
"class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-method-setHidden",
@@ -1553,12 +1451,6 @@ window.esdocSearchIndex = [
"src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#spanCssClass",
"member"
],
- [
- "src/extensions/colsvisibility/colsvisibility.js~colsvisibility#spanel",
- "class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-spanEl",
- "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#spanEl",
- "member"
- ],
[
"src/extensions/colsvisibility/colsvisibility.js~colsvisibility#stylesheet",
"class/src/extensions/colsVisibility/colsVisibility.js~ColsVisibility.html#instance-member-stylesheet",
@@ -1613,12 +1505,6 @@ window.esdocSearchIndex = [
"src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnCssClass",
"member"
],
- [
- "src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#btnel",
- "class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-btnEl",
- "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl",
- "member"
- ],
[
"src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#btnhtml",
"class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-btnHtml",
@@ -1637,12 +1523,6 @@ window.esdocSearchIndex = [
"src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#buildUI",
"method"
],
- [
- "src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#collapsebtnhtml",
- "class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-collapseBtnHtml",
- "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#collapseBtnHtml",
- "member"
- ],
[
"src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#constructor",
"class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-constructor-constructor",
@@ -1655,18 +1535,6 @@ window.esdocSearchIndex = [
"src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contCssClass",
"member"
],
- [
- "src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#contel",
- "class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-contEl",
- "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contEl",
- "member"
- ],
- [
- "src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#defaulttext",
- "class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-defaultText",
- "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#defaultText",
- "member"
- ],
[
"src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#desc",
"class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-desc",
@@ -1685,12 +1553,6 @@ window.esdocSearchIndex = [
"src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#enableIcon",
"member"
],
- [
- "src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#expandbtnhtml",
- "class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-expandBtnHtml",
- "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#expandBtnHtml",
- "member"
- ],
[
"src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#filtersrowindex",
"class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-filtersRowIndex",
@@ -1703,24 +1565,12 @@ window.esdocSearchIndex = [
"src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapse",
"member"
],
- [
- "src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#icncollapsehtml",
- "class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-icnCollapseHtml",
- "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapseHtml",
- "member"
- ],
[
"src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#icnexpand",
"class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-icnExpand",
"src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpand",
"member"
],
- [
- "src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#icnexpandhtml",
- "class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-member-icnExpandHtml",
- "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpandHtml",
- "member"
- ],
[
"src/extensions/filtersvisibility/filtersvisibility.js~filtersvisibility#init",
"class/src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility.html#instance-method-init",
@@ -1805,18 +1655,6 @@ window.esdocSearchIndex = [
"src/extensions/sort/adapterSortabletable.js",
"file"
],
- [
- "src/extensions/sort/adaptersortabletable.js~adaptersortabletable#_adddatetype",
- "class/src/extensions/sort/adapterSortabletable.js~AdapterSortableTable.html#instance-method-_addDateType",
- "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#_addDateType",
- "method"
- ],
- [
- "src/extensions/sort/adaptersortabletable.js~adaptersortabletable#_addnumbertype",
- "class/src/extensions/sort/adapterSortabletable.js~AdapterSortableTable.html#instance-method-_addNumberType",
- "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#_addNumberType",
- "method"
- ],
[
"src/extensions/sort/adaptersortabletable.js~adaptersortabletable#addsorttype",
"class/src/extensions/sort/adapterSortabletable.js~AdapterSortableTable.html#instance-method-addSortType",
@@ -1925,12 +1763,6 @@ window.esdocSearchIndex = [
"src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#overrideSortableTable",
"method"
],
- [
- "src/extensions/sort/adaptersortabletable.js~adaptersortabletable#setsorttypes",
- "class/src/extensions/sort/adapterSortabletable.js~AdapterSortableTable.html#instance-method-setSortTypes",
- "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#setSortTypes",
- "method"
- ],
[
"src/extensions/sort/adaptersortabletable.js~adaptersortabletable#sortbycolumnindex",
"class/src/extensions/sort/adapterSortabletable.js~AdapterSortableTable.html#instance-method-sortByColumnIndex",
@@ -1949,18 +1781,6 @@ window.esdocSearchIndex = [
"src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sortTypes",
"member"
],
- [
- "src/extensions/sort/adaptersortabletable.js~adaptersortabletable#sorted",
- "class/src/extensions/sort/adapterSortabletable.js~AdapterSortableTable.html#instance-member-sorted",
- "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sorted",
- "member"
- ],
- [
- "src/extensions/sort/adaptersortabletable.js~adaptersortabletable#stt",
- "class/src/extensions/sort/adapterSortabletable.js~AdapterSortableTable.html#instance-member-stt",
- "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#stt",
- "member"
- ],
[
"src/extensions/sort/adaptersortabletable.js~adaptersortabletable#triggerids",
"class/src/extensions/sort/adapterSortabletable.js~AdapterSortableTable.html#instance-member-triggerIds",
@@ -2111,18 +1931,6 @@ window.esdocSearchIndex = [
"src/modules/alternateRows.js~AlternateRows#processRow",
"method"
],
- [
- "src/modules/alternaterows.js~alternaterows#removerowbg",
- "class/src/modules/alternateRows.js~AlternateRows.html#instance-method-removeRowBg",
- "src/modules/alternateRows.js~AlternateRows#removeRowBg",
- "method"
- ],
- [
- "src/modules/alternaterows.js~alternaterows#setrowbg",
- "class/src/modules/alternateRows.js~AlternateRows.html#instance-method-setRowBg",
- "src/modules/alternateRows.js~AlternateRows#setRowBg",
- "method"
- ],
[
"src/modules/basedropdown.js",
"file/src/modules/baseDropdown.js.html",
@@ -2141,48 +1949,12 @@ window.esdocSearchIndex = [
"src/modules/baseDropdown.js~BaseDropdown#customSorter",
"member"
],
- [
- "src/modules/basedropdown.js~basedropdown#excludedopts",
- "class/src/modules/baseDropdown.js~BaseDropdown.html#instance-member-excludedOpts",
- "src/modules/baseDropdown.js~BaseDropdown#excludedOpts",
- "member"
- ],
- [
- "src/modules/basedropdown.js~basedropdown#iscustom",
- "class/src/modules/baseDropdown.js~BaseDropdown.html#instance-member-isCustom",
- "src/modules/baseDropdown.js~BaseDropdown#isCustom",
- "member"
- ],
[
"src/modules/basedropdown.js~basedropdown#isvalidlinkedvalue",
"class/src/modules/baseDropdown.js~BaseDropdown.html#instance-method-isValidLinkedValue",
"src/modules/baseDropdown.js~BaseDropdown#isValidLinkedValue",
"method"
],
- [
- "src/modules/basedropdown.js~basedropdown#opts",
- "class/src/modules/baseDropdown.js~BaseDropdown.html#instance-member-opts",
- "src/modules/baseDropdown.js~BaseDropdown#opts",
- "member"
- ],
- [
- "src/modules/basedropdown.js~basedropdown#optstxt",
- "class/src/modules/baseDropdown.js~BaseDropdown.html#instance-member-optsTxt",
- "src/modules/baseDropdown.js~BaseDropdown#optsTxt",
- "member"
- ],
- [
- "src/modules/basedropdown.js~basedropdown#refreshfilters",
- "class/src/modules/baseDropdown.js~BaseDropdown.html#instance-method-refreshFilters",
- "src/modules/baseDropdown.js~BaseDropdown#refreshFilters",
- "method"
- ],
- [
- "src/modules/basedropdown.js~basedropdown#sortoptions",
- "class/src/modules/baseDropdown.js~BaseDropdown.html#instance-method-sortOptions",
- "src/modules/baseDropdown.js~BaseDropdown#sortOptions",
- "method"
- ],
[
"src/modules/checklist.js",
"file/src/modules/checkList.js.html",
@@ -2195,18 +1967,6 @@ window.esdocSearchIndex = [
"src/modules/checkList.js~CheckList#activateText",
"member"
],
- [
- "src/modules/checklist.js~checklist#addchecks",
- "class/src/modules/checkList.js~CheckList.html#instance-method-addChecks",
- "src/modules/checkList.js~CheckList#addChecks",
- "method"
- ],
- [
- "src/modules/checklist.js~checklist#addtchecks",
- "class/src/modules/checkList.js~CheckList.html#instance-method-addTChecks",
- "src/modules/checkList.js~CheckList#addTChecks",
- "method"
- ],
[
"src/modules/checklist.js~checklist#build",
"class/src/modules/checkList.js~CheckList.html#instance-method-build",
@@ -2291,18 +2051,6 @@ window.esdocSearchIndex = [
"src/modules/checkList.js~CheckList#itemCssClass",
"member"
],
- [
- "src/modules/checklist.js~checklist#onchecklistclick",
- "class/src/modules/checkList.js~CheckList.html#instance-method-onCheckListClick",
- "src/modules/checkList.js~CheckList#onCheckListClick",
- "method"
- ],
- [
- "src/modules/checklist.js~checklist#optionclick",
- "class/src/modules/checkList.js~CheckList.html#instance-method-optionClick",
- "src/modules/checkList.js~CheckList#optionClick",
- "method"
- ],
[
"src/modules/checklist.js~checklist#opts",
"class/src/modules/checkList.js~CheckList.html#instance-member-opts",
@@ -2315,12 +2063,6 @@ window.esdocSearchIndex = [
"src/modules/checkList.js~CheckList#optsTxt",
"member"
],
- [
- "src/modules/checklist.js~checklist#prfx",
- "class/src/modules/checkList.js~CheckList.html#instance-member-prfx",
- "src/modules/checkList.js~CheckList#prfx",
- "member"
- ],
[
"src/modules/checklist.js~checklist#refreshall",
"class/src/modules/checkList.js~CheckList.html#instance-method-refreshAll",
@@ -2339,12 +2081,6 @@ window.esdocSearchIndex = [
"src/modules/checkList.js~CheckList#selectedItemCssClass",
"member"
],
- [
- "src/modules/checklist.js~checklist#setchecklistvalues",
- "class/src/modules/checkList.js~CheckList.html#instance-method-setCheckListValues",
- "src/modules/checkList.js~CheckList#setCheckListValues",
- "method"
- ],
[
"src/modules/clearbutton.js",
"file/src/modules/clearButton.js.html",
@@ -2357,12 +2093,6 @@ window.esdocSearchIndex = [
"src/modules/clearButton.js~ClearButton#constructor",
"method"
],
- [
- "src/modules/clearbutton.js~clearbutton#container",
- "class/src/modules/clearButton.js~ClearButton.html#instance-member-container",
- "src/modules/clearButton.js~ClearButton#container",
- "member"
- ],
[
"src/modules/clearbutton.js~clearbutton#cssclass",
"class/src/modules/clearButton.js~ClearButton.html#instance-member-cssClass",
@@ -2375,12 +2105,6 @@ window.esdocSearchIndex = [
"src/modules/clearButton.js~ClearButton#destroy",
"method"
],
- [
- "src/modules/clearbutton.js~clearbutton#element",
- "class/src/modules/clearButton.js~ClearButton.html#instance-member-element",
- "src/modules/clearButton.js~ClearButton#element",
- "member"
- ],
[
"src/modules/clearbutton.js~clearbutton#html",
"class/src/modules/clearButton.js~ClearButton.html#instance-member-html",
@@ -2399,12 +2123,6 @@ window.esdocSearchIndex = [
"src/modules/clearButton.js~ClearButton#initialized",
"member"
],
- [
- "src/modules/clearbutton.js~clearbutton#onclick",
- "class/src/modules/clearButton.js~ClearButton.html#instance-method-onClick",
- "src/modules/clearButton.js~ClearButton#onClick",
- "method"
- ],
[
"src/modules/clearbutton.js~clearbutton#targetid",
"class/src/modules/clearButton.js~ClearButton.html#instance-member-targetId",
@@ -2579,18 +2297,6 @@ window.esdocSearchIndex = [
"src/modules/dropdown.js~Dropdown#nonEmptyText",
"member"
],
- [
- "src/modules/dropdown.js~dropdown#onslcchange",
- "class/src/modules/dropdown.js~Dropdown.html#instance-method-onSlcChange",
- "src/modules/dropdown.js~Dropdown#onSlcChange",
- "method"
- ],
- [
- "src/modules/dropdown.js~dropdown#onslcfocus",
- "class/src/modules/dropdown.js~Dropdown.html#instance-method-onSlcFocus",
- "src/modules/dropdown.js~Dropdown#onSlcFocus",
- "method"
- ],
[
"src/modules/dropdown.js~dropdown#opts",
"class/src/modules/dropdown.js~Dropdown.html#instance-member-opts",
@@ -2621,12 +2327,6 @@ window.esdocSearchIndex = [
"src/modules/gridLayout.js",
"file"
],
- [
- "src/modules/gridlayout.js~gridlayout#colelms",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-member-colElms",
- "src/modules/gridLayout.js~GridLayout#colElms",
- "member"
- ],
[
"src/modules/gridlayout.js~gridlayout#constructor",
"class/src/modules/gridLayout.js~GridLayout.html#instance-constructor-constructor",
@@ -2639,18 +2339,6 @@ window.esdocSearchIndex = [
"src/modules/gridLayout.js~GridLayout#contCssClass",
"member"
],
- [
- "src/modules/gridlayout.js~gridlayout#createcontainer",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-method-createContainer",
- "src/modules/gridLayout.js~GridLayout#createContainer",
- "method"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#createfiltersrow",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-method-createFiltersRow",
- "src/modules/gridLayout.js~GridLayout#createFiltersRow",
- "method"
- ],
[
"src/modules/gridlayout.js~gridlayout#defaultcolwidth",
"class/src/modules/gridLayout.js~GridLayout.html#instance-member-defaultColWidth",
@@ -2669,12 +2357,6 @@ window.esdocSearchIndex = [
"src/modules/gridLayout.js~GridLayout#filters",
"member"
],
- [
- "src/modules/gridlayout.js~gridlayout#getsorttriggerids",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-method-getSortTriggerIds",
- "src/modules/gridLayout.js~GridLayout#getSortTriggerIds",
- "method"
- ],
[
"src/modules/gridlayout.js~gridlayout#headcontcssclass",
"class/src/modules/gridLayout.js~GridLayout.html#instance-member-headContCssClass",
@@ -2693,18 +2375,6 @@ window.esdocSearchIndex = [
"src/modules/gridLayout.js~GridLayout#headRows",
"member"
],
- [
- "src/modules/gridlayout.js~gridlayout#headtbl",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-member-headTbl",
- "src/modules/gridLayout.js~GridLayout#headTbl",
- "member"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#headtblcont",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-member-headTblCont",
- "src/modules/gridLayout.js~GridLayout#headTblCont",
- "member"
- ],
[
"src/modules/gridlayout.js~gridlayout#height",
"class/src/modules/gridLayout.js~GridLayout.html#instance-member-height",
@@ -2723,12 +2393,6 @@ window.esdocSearchIndex = [
"src/modules/gridLayout.js~GridLayout#init",
"method"
],
- [
- "src/modules/gridlayout.js~gridlayout#initialtablewidth",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-method-initialTableWidth",
- "src/modules/gridLayout.js~GridLayout#initialTableWidth",
- "method"
- ],
[
"src/modules/gridlayout.js~gridlayout#initialized",
"class/src/modules/gridLayout.js~GridLayout.html#instance-member-initialized",
@@ -2747,72 +2411,6 @@ window.esdocSearchIndex = [
"src/modules/gridLayout.js~GridLayout#noHeaders",
"member"
],
- [
- "src/modules/gridlayout.js~gridlayout#prfxgridflttd",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-member-prfxGridFltTd",
- "src/modules/gridLayout.js~GridLayout#prfxGridFltTd",
- "member"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#prfxgridth",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-member-prfxGridTh",
- "src/modules/gridLayout.js~GridLayout#prfxGridTh",
- "member"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#setcolumnelements",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-method-setColumnElements",
- "src/modules/gridLayout.js~GridLayout#setColumnElements",
- "method"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#setconfigwidth",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-method-setConfigWidth",
- "src/modules/gridLayout.js~GridLayout#setConfigWidth",
- "method"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#setdefaultcolwidths",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-method-setDefaultColWidths",
- "src/modules/gridLayout.js~GridLayout#setDefaultColWidths",
- "method"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#setheadersrow",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-method-setHeadersRow",
- "src/modules/gridLayout.js~GridLayout#setHeadersRow",
- "method"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#setoverrides",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-method-setOverrides",
- "src/modules/gridLayout.js~GridLayout#setOverrides",
- "method"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#sourcetblhtml",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-member-sourceTblHtml",
- "src/modules/gridLayout.js~GridLayout#sourceTblHtml",
- "member"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#tblcont",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-member-tblCont",
- "src/modules/gridLayout.js~GridLayout#tblCont",
- "member"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#tblhascoltag",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-member-tblHasColTag",
- "src/modules/gridLayout.js~GridLayout#tblHasColTag",
- "member"
- ],
- [
- "src/modules/gridlayout.js~gridlayout#tblmaincont",
- "class/src/modules/gridLayout.js~GridLayout.html#instance-member-tblMainCont",
- "src/modules/gridLayout.js~GridLayout#tblMainCont",
- "member"
- ],
[
"src/modules/gridlayout.js~gridlayout#width",
"class/src/modules/gridLayout.js~GridLayout.html#instance-member-width",
@@ -2825,12 +2423,6 @@ window.esdocSearchIndex = [
"src/modules/hash.js",
"file"
],
- [
- "src/modules/hash.js~hash#boundsync",
- "class/src/modules/hash.js~Hash.html#instance-member-boundSync",
- "src/modules/hash.js~Hash#boundSync",
- "member"
- ],
[
"src/modules/hash.js~hash#constructor",
"class/src/modules/hash.js~Hash.html#instance-constructor-constructor",
@@ -2855,12 +2447,6 @@ window.esdocSearchIndex = [
"src/modules/hash.js~Hash#init",
"method"
],
- [
- "src/modules/hash.js~hash#lasthash",
- "class/src/modules/hash.js~Hash.html#instance-member-lastHash",
- "src/modules/hash.js~Hash#lastHash",
- "member"
- ],
[
"src/modules/hash.js~hash#parse",
"class/src/modules/hash.js~Hash.html#instance-method-parse",
@@ -2891,12 +2477,6 @@ window.esdocSearchIndex = [
"src/modules/help.js",
"file"
],
- [
- "src/modules/help.js~help#boundmouseup",
- "class/src/modules/help.js~Help.html#instance-member-boundMouseup",
- "src/modules/help.js~Help#boundMouseup",
- "member"
- ],
[
"src/modules/help.js~help#btn",
"class/src/modules/help.js~Help.html#instance-member-btn",
@@ -2981,12 +2561,6 @@ window.esdocSearchIndex = [
"src/modules/help.js~Help#instrText",
"member"
],
- [
- "src/modules/help.js~help#onmouseup",
- "class/src/modules/help.js~Help.html#instance-method-onMouseup",
- "src/modules/help.js~Help#onMouseup",
- "method"
- ],
[
"src/modules/help.js~help#tgtid",
"class/src/modules/help.js~Help.html#instance-member-tgtId",
@@ -3011,12 +2585,6 @@ window.esdocSearchIndex = [
"src/modules/highlightKeywords.js",
"file"
],
- [
- "src/modules/highlightkeywords.js~highlightkeyword#_processterm",
- "class/src/modules/highlightKeywords.js~HighlightKeyword.html#instance-method-_processTerm",
- "src/modules/highlightKeywords.js~HighlightKeyword#_processTerm",
- "method"
- ],
[
"src/modules/highlightkeywords.js~highlightkeyword#constructor",
"class/src/modules/highlightKeywords.js~HighlightKeyword.html#instance-constructor-constructor",
@@ -3185,12 +2753,6 @@ window.esdocSearchIndex = [
"src/modules/markActiveColumns.js~MarkActiveColumns#destroy",
"method"
],
- [
- "src/modules/markactivecolumns.js~markactivecolumns#eachcolumncell",
- "class/src/modules/markActiveColumns.js~MarkActiveColumns.html#instance-method-eachColumnCell",
- "src/modules/markActiveColumns.js~MarkActiveColumns#eachColumnCell",
- "method"
- ],
[
"src/modules/markactivecolumns.js~markactivecolumns#headercssclass",
"class/src/modules/markActiveColumns.js~MarkActiveColumns.html#instance-member-headerCssClass",
@@ -3299,12 +2861,6 @@ window.esdocSearchIndex = [
"src/modules/noResults.js~NoResults#initialized",
"member"
],
- [
- "src/modules/noresults.js~noresults#isexternal",
- "class/src/modules/noResults.js~NoResults.html#instance-member-isExternal",
- "src/modules/noResults.js~NoResults#isExternal",
- "member"
- ],
[
"src/modules/noresults.js~noresults#onafterhide",
"class/src/modules/noResults.js~NoResults.html#instance-member-onAfterHide",
@@ -3329,12 +2885,6 @@ window.esdocSearchIndex = [
"src/modules/noResults.js~NoResults#onBeforeShow",
"member"
],
- [
- "src/modules/noresults.js~noresults#setwidth",
- "class/src/modules/noResults.js~NoResults.html#instance-method-setWidth",
- "src/modules/noResults.js~NoResults#setWidth",
- "method"
- ],
[
"src/modules/noresults.js~noresults#show",
"class/src/modules/noResults.js~NoResults.html#instance-method-show",
@@ -3359,12 +2909,6 @@ window.esdocSearchIndex = [
"src/modules/paging.js~Paging#btnCssClass",
"member"
],
- [
- "src/modules/paging.js~paging#btnfirstcont",
- "class/src/modules/paging.js~Paging.html#instance-member-btnFirstCont",
- "src/modules/paging.js~Paging#btnFirstCont",
- "member"
- ],
[
"src/modules/paging.js~paging#btnfirstpagehtml",
"class/src/modules/paging.js~Paging.html#instance-member-btnFirstPageHtml",
@@ -3377,12 +2921,6 @@ window.esdocSearchIndex = [
"src/modules/paging.js~Paging#btnFirstPageText",
"member"
],
- [
- "src/modules/paging.js~paging#btnlastcont",
- "class/src/modules/paging.js~Paging.html#instance-member-btnLastCont",
- "src/modules/paging.js~Paging#btnLastCont",
- "member"
- ],
[
"src/modules/paging.js~paging#btnlastpagehtml",
"class/src/modules/paging.js~Paging.html#instance-member-btnLastPageHtml",
@@ -3395,12 +2933,6 @@ window.esdocSearchIndex = [
"src/modules/paging.js~Paging#btnLastPageText",
"member"
],
- [
- "src/modules/paging.js~paging#btnnextcont",
- "class/src/modules/paging.js~Paging.html#instance-member-btnNextCont",
- "src/modules/paging.js~Paging#btnNextCont",
- "member"
- ],
[
"src/modules/paging.js~paging#btnnextpagehtml",
"class/src/modules/paging.js~Paging.html#instance-member-btnNextPageHtml",
@@ -3413,12 +2945,6 @@ window.esdocSearchIndex = [
"src/modules/paging.js~Paging#btnNextPageText",
"member"
],
- [
- "src/modules/paging.js~paging#btnprevcont",
- "class/src/modules/paging.js~Paging.html#instance-member-btnPrevCont",
- "src/modules/paging.js~Paging#btnPrevCont",
- "member"
- ],
[
"src/modules/paging.js~paging#btnprevpagehtml",
"class/src/modules/paging.js~Paging.html#instance-member-btnPrevPageHtml",
@@ -3449,24 +2975,12 @@ window.esdocSearchIndex = [
"src/modules/paging.js~Paging#constructor",
"method"
],
- [
- "src/modules/paging.js~paging#currentpagenb",
- "class/src/modules/paging.js~Paging.html#instance-member-currentPageNb",
- "src/modules/paging.js~Paging#currentPageNb",
- "member"
- ],
[
"src/modules/paging.js~paging#destroy",
"class/src/modules/paging.js~Paging.html#instance-method-destroy",
"src/modules/paging.js~Paging#destroy",
"method"
],
- [
- "src/modules/paging.js~paging#evt",
- "class/src/modules/paging.js~Paging.html#instance-member-evt",
- "src/modules/paging.js~Paging#evt",
- "member"
- ],
[
"src/modules/paging.js~paging#getpage",
"class/src/modules/paging.js~Paging.html#instance-method-getPage",
@@ -3503,12 +3017,6 @@ window.esdocSearchIndex = [
"src/modules/paging.js~Paging#initialized",
"member"
],
- [
- "src/modules/paging.js~paging#nbpages",
- "class/src/modules/paging.js~Paging.html#instance-member-nbPages",
- "src/modules/paging.js~Paging#nbPages",
- "member"
- ],
[
"src/modules/paging.js~paging#nbpgspancssclass",
"class/src/modules/paging.js~Paging.html#instance-member-nbPgSpanCssClass",
@@ -3575,24 +3083,6 @@ window.esdocSearchIndex = [
"src/modules/paging.js~Paging#pageText",
"member"
],
- [
- "src/modules/paging.js~paging#pgafter",
- "class/src/modules/paging.js~Paging.html#instance-member-pgAfter",
- "src/modules/paging.js~Paging#pgAfter",
- "member"
- ],
- [
- "src/modules/paging.js~paging#pgbefore",
- "class/src/modules/paging.js~Paging.html#instance-member-pgBefore",
- "src/modules/paging.js~Paging#pgBefore",
- "member"
- ],
- [
- "src/modules/paging.js~paging#pgcont",
- "class/src/modules/paging.js~Paging.html#instance-member-pgCont",
- "src/modules/paging.js~Paging#pgCont",
- "member"
- ],
[
"src/modules/paging.js~paging#pginpcssclass",
"class/src/modules/paging.js~Paging.html#instance-member-pgInpCssClass",
@@ -3671,18 +3161,6 @@ window.esdocSearchIndex = [
"src/modules/paging.js~Paging#setResultsPerPage",
"method"
],
- [
- "src/modules/paging.js~paging#slcresultstxt",
- "class/src/modules/paging.js~Paging.html#instance-member-slcResultsTxt",
- "src/modules/paging.js~Paging#slcResultsTxt",
- "member"
- ],
- [
- "src/modules/paging.js~paging#startpagingrow",
- "class/src/modules/paging.js~Paging.html#instance-member-startPagingRow",
- "src/modules/paging.js~Paging#startPagingRow",
- "member"
- ],
[
"src/modules/paging.js~paging#tgtid",
"class/src/modules/paging.js~Paging.html#instance-member-tgtId",
@@ -3701,12 +3179,6 @@ window.esdocSearchIndex = [
"src/modules/popupFilter.js",
"file"
],
- [
- "src/modules/popupfilter.js~popupfilter#activefilteridx",
- "class/src/modules/popupFilter.js~PopupFilter.html#instance-member-activeFilterIdx",
- "src/modules/popupFilter.js~PopupFilter#activeFilterIdx",
- "member"
- ],
[
"src/modules/popupfilter.js~popupfilter#activeiconpath",
"class/src/modules/popupFilter.js~PopupFilter.html#instance-member-activeIconPath",
@@ -3779,30 +3251,6 @@ window.esdocSearchIndex = [
"src/modules/popupFilter.js~PopupFilter#destroy",
"method"
],
- [
- "src/modules/popupfilter.js~popupfilter#filterscache",
- "class/src/modules/popupFilter.js~PopupFilter.html#instance-member-filtersCache",
- "src/modules/popupFilter.js~PopupFilter#filtersCache",
- "member"
- ],
- [
- "src/modules/popupfilter.js~popupfilter#fltelms",
- "class/src/modules/popupFilter.js~PopupFilter.html#instance-member-fltElms",
- "src/modules/popupFilter.js~PopupFilter#fltElms",
- "member"
- ],
- [
- "src/modules/popupfilter.js~popupfilter#flticons",
- "class/src/modules/popupFilter.js~PopupFilter.html#instance-member-fltIcons",
- "src/modules/popupFilter.js~PopupFilter#fltIcons",
- "member"
- ],
- [
- "src/modules/popupfilter.js~popupfilter#fltspans",
- "class/src/modules/popupFilter.js~PopupFilter.html#instance-member-fltSpans",
- "src/modules/popupFilter.js~PopupFilter#fltSpans",
- "member"
- ],
[
"src/modules/popupfilter.js~popupfilter#iconhtml",
"class/src/modules/popupFilter.js~PopupFilter.html#instance-member-iconHtml",
@@ -3857,18 +3305,6 @@ window.esdocSearchIndex = [
"src/modules/popupFilter.js~PopupFilter#onBeforeOpen",
"member"
],
- [
- "src/modules/popupfilter.js~popupfilter#onclick",
- "class/src/modules/popupFilter.js~PopupFilter.html#instance-method-onClick",
- "src/modules/popupFilter.js~PopupFilter#onClick",
- "method"
- ],
- [
- "src/modules/popupfilter.js~popupfilter#onmouseup",
- "class/src/modules/popupFilter.js~PopupFilter.html#instance-method-onMouseup",
- "src/modules/popupFilter.js~PopupFilter#onMouseup",
- "method"
- ],
[
"src/modules/popupfilter.js~popupfilter#open",
"class/src/modules/popupFilter.js~PopupFilter.html#instance-method-open",
@@ -3881,12 +3317,6 @@ window.esdocSearchIndex = [
"src/modules/popupFilter.js~PopupFilter#placeholderCssClass",
"member"
],
- [
- "src/modules/popupfilter.js~popupfilter#prfxdiv",
- "class/src/modules/popupFilter.js~PopupFilter.html#instance-member-prfxDiv",
- "src/modules/popupFilter.js~PopupFilter#prfxDiv",
- "member"
- ],
[
"src/modules/popupfilter.js~popupfilter#reset",
"class/src/modules/popupFilter.js~PopupFilter.html#instance-method-reset",
@@ -3917,12 +3347,6 @@ window.esdocSearchIndex = [
"src/modules/rowsCounter.js~RowsCounter#constructor",
"method"
],
- [
- "src/modules/rowscounter.js~rowscounter#container",
- "class/src/modules/rowsCounter.js~RowsCounter.html#instance-member-container",
- "src/modules/rowsCounter.js~RowsCounter#container",
- "member"
- ],
[
"src/modules/rowscounter.js~rowscounter#cssclass",
"class/src/modules/rowsCounter.js~RowsCounter.html#instance-member-cssClass",
@@ -3953,12 +3377,6 @@ window.esdocSearchIndex = [
"src/modules/rowsCounter.js~RowsCounter#initialized",
"member"
],
- [
- "src/modules/rowscounter.js~rowscounter#label",
- "class/src/modules/rowsCounter.js~RowsCounter.html#instance-member-label",
- "src/modules/rowsCounter.js~RowsCounter#label",
- "member"
- ],
[
"src/modules/rowscounter.js~rowscounter#onafterrefreshcounter",
"class/src/modules/rowsCounter.js~RowsCounter.html#instance-member-onAfterRefreshCounter",
@@ -4007,30 +3425,6 @@ window.esdocSearchIndex = [
"src/modules/state.js",
"file"
],
- [
- "src/modules/state.js~state#_synccolsvisibility",
- "class/src/modules/state.js~State.html#instance-method-_syncColsVisibility",
- "src/modules/state.js~State#_syncColsVisibility",
- "method"
- ],
- [
- "src/modules/state.js~state#_syncfilters",
- "class/src/modules/state.js~State.html#instance-method-_syncFilters",
- "src/modules/state.js~State#_syncFilters",
- "method"
- ],
- [
- "src/modules/state.js~state#_syncfiltersvisibility",
- "class/src/modules/state.js~State.html#instance-method-_syncFiltersVisibility",
- "src/modules/state.js~State#_syncFiltersVisibility",
- "method"
- ],
- [
- "src/modules/state.js~state#_syncsort",
- "class/src/modules/state.js~State.html#instance-method-_syncSort",
- "src/modules/state.js~State#_syncSort",
- "method"
- ],
[
"src/modules/state.js~state#constructor",
"class/src/modules/state.js~State.html#instance-constructor-constructor",
@@ -4067,36 +3461,6 @@ window.esdocSearchIndex = [
"src/modules/state.js~State#enableLocalStorage",
"member"
],
- [
- "src/modules/state.js~state#enablestorage",
- "class/src/modules/state.js~State.html#instance-member-enableStorage",
- "src/modules/state.js~State#enableStorage",
- "member"
- ],
- [
- "src/modules/state.js~state#filtersviskey",
- "class/src/modules/state.js~State.html#instance-member-filtersVisKey",
- "src/modules/state.js~State#filtersVisKey",
- "member"
- ],
- [
- "src/modules/state.js~state#filtersvisibility",
- "class/src/modules/state.js~State.html#instance-member-filtersVisibility",
- "src/modules/state.js~State#filtersVisibility",
- "member"
- ],
- [
- "src/modules/state.js~state#hash",
- "class/src/modules/state.js~State.html#instance-member-hash",
- "src/modules/state.js~State#hash",
- "member"
- ],
- [
- "src/modules/state.js~state#hiddencols",
- "class/src/modules/state.js~State.html#instance-member-hiddenCols",
- "src/modules/state.js~State#hiddenCols",
- "member"
- ],
[
"src/modules/state.js~state#init",
"class/src/modules/state.js~State.html#instance-method-init",
@@ -4121,30 +3485,6 @@ window.esdocSearchIndex = [
"src/modules/state.js~State#overrideAndSync",
"method"
],
- [
- "src/modules/state.js~state#pagelength",
- "class/src/modules/state.js~State.html#instance-member-pageLength",
- "src/modules/state.js~State#pageLength",
- "member"
- ],
- [
- "src/modules/state.js~state#pagelengthkey",
- "class/src/modules/state.js~State.html#instance-member-pageLengthKey",
- "src/modules/state.js~State#pageLengthKey",
- "member"
- ],
- [
- "src/modules/state.js~state#pagenb",
- "class/src/modules/state.js~State.html#instance-member-pageNb",
- "src/modules/state.js~State#pageNb",
- "member"
- ],
- [
- "src/modules/state.js~state#pagenbkey",
- "class/src/modules/state.js~State.html#instance-member-pageNbKey",
- "src/modules/state.js~State#pageNbKey",
- "member"
- ],
[
"src/modules/state.js~state#persistcolsvisibility",
"class/src/modules/state.js~State.html#instance-member-persistColsVisibility",
@@ -4181,30 +3521,6 @@ window.esdocSearchIndex = [
"src/modules/state.js~State#persistSort",
"member"
],
- [
- "src/modules/state.js~state#prfxcol",
- "class/src/modules/state.js~State.html#instance-member-prfxCol",
- "src/modules/state.js~State#prfxCol",
- "member"
- ],
- [
- "src/modules/state.js~state#sort",
- "class/src/modules/state.js~State.html#instance-member-sort",
- "src/modules/state.js~State#sort",
- "member"
- ],
- [
- "src/modules/state.js~state#state",
- "class/src/modules/state.js~State.html#instance-member-state",
- "src/modules/state.js~State#state",
- "member"
- ],
- [
- "src/modules/state.js~state#storage",
- "class/src/modules/state.js~State.html#instance-member-storage",
- "src/modules/state.js~State#storage",
- "member"
- ],
[
"src/modules/state.js~state#sync",
"class/src/modules/state.js~State.html#instance-method-sync",
@@ -4259,24 +3575,12 @@ window.esdocSearchIndex = [
"src/modules/statusBar.js~StatusBar#constructor",
"method"
],
- [
- "src/modules/statusbar.js~statusbar#container",
- "class/src/modules/statusBar.js~StatusBar.html#instance-member-container",
- "src/modules/statusBar.js~StatusBar#container",
- "member"
- ],
[
"src/modules/statusbar.js~statusbar#cssclass",
"class/src/modules/statusBar.js~StatusBar.html#instance-member-cssClass",
"src/modules/statusBar.js~StatusBar#cssClass",
"member"
],
- [
- "src/modules/statusbar.js~statusbar#delay",
- "class/src/modules/statusBar.js~StatusBar.html#instance-member-delay",
- "src/modules/statusBar.js~StatusBar#delay",
- "member"
- ],
[
"src/modules/statusbar.js~statusbar#destroy",
"class/src/modules/statusBar.js~StatusBar.html#instance-method-destroy",
@@ -4295,12 +3599,6 @@ window.esdocSearchIndex = [
"src/modules/statusBar.js~StatusBar#initialized",
"member"
],
- [
- "src/modules/statusbar.js~statusbar#labelcontainer",
- "class/src/modules/statusBar.js~StatusBar.html#instance-member-labelContainer",
- "src/modules/statusBar.js~StatusBar#labelContainer",
- "member"
- ],
[
"src/modules/statusbar.js~statusbar#message",
"class/src/modules/statusBar.js~StatusBar.html#instance-method-message",
@@ -4325,12 +3623,6 @@ window.esdocSearchIndex = [
"src/modules/statusBar.js~StatusBar#msgClear",
"member"
],
- [
- "src/modules/statusbar.js~statusbar#msgcontainer",
- "class/src/modules/statusBar.js~StatusBar.html#instance-member-msgContainer",
- "src/modules/statusBar.js~StatusBar#msgContainer",
- "member"
- ],
[
"src/modules/statusbar.js~statusbar#msgfilter",
"class/src/modules/statusBar.js~StatusBar.html#instance-member-msgFilter",
@@ -4427,30 +3719,6 @@ window.esdocSearchIndex = [
"src/modules/storage.js~Storage#destroy",
"method"
],
- [
- "src/modules/storage.js~storage#duration",
- "class/src/modules/storage.js~Storage.html#instance-member-duration",
- "src/modules/storage.js~Storage#duration",
- "member"
- ],
- [
- "src/modules/storage.js~storage#emitter",
- "class/src/modules/storage.js~Storage.html#instance-member-emitter",
- "src/modules/storage.js~Storage#emitter",
- "member"
- ],
- [
- "src/modules/storage.js~storage#enablecookie",
- "class/src/modules/storage.js~Storage.html#instance-member-enableCookie",
- "src/modules/storage.js~Storage#enableCookie",
- "member"
- ],
- [
- "src/modules/storage.js~storage#enablelocalstorage",
- "class/src/modules/storage.js~Storage.html#instance-member-enableLocalStorage",
- "src/modules/storage.js~Storage#enableLocalStorage",
- "member"
- ],
[
"src/modules/storage.js~storage#getkey",
"class/src/modules/storage.js~Storage.html#instance-method-getKey",
@@ -4481,36 +3749,18 @@ window.esdocSearchIndex = [
"src/modules/storage.js~Storage#save",
"method"
],
- [
- "src/modules/storage.js~storage#state",
- "class/src/modules/storage.js~Storage.html#instance-member-state",
- "src/modules/storage.js~Storage#state",
- "member"
- ],
[
"src/modules/storage.js~storage#sync",
"class/src/modules/storage.js~Storage.html#instance-method-sync",
"src/modules/storage.js~Storage#sync",
"method"
],
- [
- "src/modules/storage.js~storage#tf",
- "class/src/modules/storage.js~Storage.html#instance-member-tf",
- "src/modules/storage.js~Storage#tf",
- "member"
- ],
[
"src/modules/toolbar.js",
"file/src/modules/toolbar.js.html",
"src/modules/toolbar.js",
"file"
],
- [
- "src/modules/toolbar.js~toolbar#ccont",
- "class/src/modules/toolbar.js~Toolbar.html#instance-member-cCont",
- "src/modules/toolbar.js~Toolbar#cCont",
- "member"
- ],
[
"src/modules/toolbar.js~toolbar#ccontcssclass",
"class/src/modules/toolbar.js~Toolbar.html#instance-member-cContCssClass",
@@ -4523,12 +3773,6 @@ window.esdocSearchIndex = [
"src/modules/toolbar.js~Toolbar#constructor",
"method"
],
- [
- "src/modules/toolbar.js~toolbar#cont",
- "class/src/modules/toolbar.js~Toolbar.html#instance-member-cont",
- "src/modules/toolbar.js~Toolbar#cont",
- "member"
- ],
[
"src/modules/toolbar.js~toolbar#contcssclass",
"class/src/modules/toolbar.js~Toolbar.html#instance-member-contCssClass",
@@ -4541,12 +3785,6 @@ window.esdocSearchIndex = [
"src/modules/toolbar.js~Toolbar#container",
"method"
],
- [
- "src/modules/toolbar.js~toolbar#createcontainer",
- "class/src/modules/toolbar.js~Toolbar.html#instance-method-createContainer",
- "src/modules/toolbar.js~Toolbar#createContainer",
- "method"
- ],
[
"src/modules/toolbar.js~toolbar#destroy",
"class/src/modules/toolbar.js~Toolbar.html#instance-method-destroy",
@@ -4571,30 +3809,12 @@ window.esdocSearchIndex = [
"src/modules/toolbar.js~Toolbar#initialized",
"member"
],
- [
- "src/modules/toolbar.js~toolbar#innercont",
- "class/src/modules/toolbar.js~Toolbar.html#instance-member-innerCont",
- "src/modules/toolbar.js~Toolbar#innerCont",
- "member"
- ],
- [
- "src/modules/toolbar.js~toolbar#lcont",
- "class/src/modules/toolbar.js~Toolbar.html#instance-member-lCont",
- "src/modules/toolbar.js~Toolbar#lCont",
- "member"
- ],
[
"src/modules/toolbar.js~toolbar#lcontcssclass",
"class/src/modules/toolbar.js~Toolbar.html#instance-member-lContCssClass",
"src/modules/toolbar.js~Toolbar#lContCssClass",
"member"
],
- [
- "src/modules/toolbar.js~toolbar#rcont",
- "class/src/modules/toolbar.js~Toolbar.html#instance-member-rCont",
- "src/modules/toolbar.js~Toolbar#rCont",
- "member"
- ],
[
"src/modules/toolbar.js~toolbar#rcontcssclass",
"class/src/modules/toolbar.js~Toolbar.html#instance-member-rContCssClass",
@@ -4643,60 +3863,12 @@ window.esdocSearchIndex = [
"src/tablefilter.js",
"file"
],
- [
- "src/tablefilter.js~tablefilter#extregistry",
- "class/src/tablefilter.js~TableFilter.html#instance-member-ExtRegistry",
- "src/tablefilter.js~TableFilter#ExtRegistry",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#mod",
- "class/src/tablefilter.js~TableFilter.html#instance-member-Mod",
- "src/tablefilter.js~TableFilter#Mod",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#_buildinputfilter",
- "class/src/tablefilter.js~TableFilter.html#instance-method-_buildInputFilter",
- "src/tablefilter.js~TableFilter#_buildInputFilter",
- "method"
- ],
- [
- "src/tablefilter.js~tablefilter#_buildsubmitbutton",
- "class/src/tablefilter.js~TableFilter.html#instance-method-_buildSubmitButton",
- "src/tablefilter.js~TableFilter#_buildSubmitButton",
- "method"
- ],
- [
- "src/tablefilter.js~tablefilter#_initnofilters",
- "class/src/tablefilter.js~TableFilter.html#instance-method-_initNoFilters",
- "src/tablefilter.js~TableFilter#_initNoFilters",
- "method"
- ],
- [
- "src/tablefilter.js~tablefilter#_insertfiltersrow",
- "class/src/tablefilter.js~TableFilter.html#instance-method-_insertFiltersRow",
- "src/tablefilter.js~TableFilter#_insertFiltersRow",
- "method"
- ],
- [
- "src/tablefilter.js~tablefilter#_match",
- "class/src/tablefilter.js~TableFilter.html#instance-method-_match",
- "src/tablefilter.js~TableFilter#_match",
- "method"
- ],
[
"src/tablefilter.js~tablefilter#activatefilter",
"class/src/tablefilter.js~TableFilter.html#instance-method-activateFilter",
"src/tablefilter.js~TableFilter#activateFilter",
"method"
],
- [
- "src/tablefilter.js~tablefilter#activefilterid",
- "class/src/tablefilter.js~TableFilter.html#instance-member-activeFilterId",
- "src/tablefilter.js~TableFilter#activeFilterId",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#alternaterows",
"class/src/tablefilter.js~TableFilter.html#instance-member-alternateRows",
@@ -4721,12 +3893,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#autoFilterDelay",
"member"
],
- [
- "src/tablefilter.js~tablefilter#autofiltertimer",
- "class/src/tablefilter.js~TableFilter.html#instance-member-autoFilterTimer",
- "src/tablefilter.js~TableFilter#autoFilterTimer",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#basepath",
"class/src/tablefilter.js~TableFilter.html#instance-member-basePath",
@@ -4751,12 +3917,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#btnText",
"member"
],
- [
- "src/tablefilter.js~tablefilter#buildfilterid",
- "class/src/tablefilter.js~TableFilter.html#instance-method-buildFilterId",
- "src/tablefilter.js~TableFilter#buildFilterId",
- "method"
- ],
[
"src/tablefilter.js~tablefilter#casesensitive",
"class/src/tablefilter.js~TableFilter.html#instance-member-caseSensitive",
@@ -4769,12 +3929,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#cellParser",
"member"
],
- [
- "src/tablefilter.js~tablefilter#cfg",
- "class/src/tablefilter.js~TableFilter.html#instance-member-cfg",
- "src/tablefilter.js~TableFilter#cfg",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#clearfiltertext",
"class/src/tablefilter.js~TableFilter.html#instance-member-clearFilterText",
@@ -4817,12 +3971,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#customOptions",
"member"
],
- [
- "src/tablefilter.js~tablefilter#datetype",
- "class/src/tablefilter.js~TableFilter.html#instance-member-dateType",
- "src/tablefilter.js~TableFilter#dateType",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#decimalseparator",
"class/src/tablefilter.js~TableFilter.html#instance-member-decimalSeparator",
@@ -4991,18 +4139,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#filter",
"method"
],
- [
- "src/tablefilter.js~tablefilter#filtertypes",
- "class/src/tablefilter.js~TableFilter.html#instance-member-filterTypes",
- "src/tablefilter.js~TableFilter#filterTypes",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#filtereddata",
- "class/src/tablefilter.js~TableFilter.html#instance-method-filteredData",
- "src/tablefilter.js~TableFilter#filteredData",
- "method"
- ],
[
"src/tablefilter.js~tablefilter#filtersrowindex",
"class/src/tablefilter.js~TableFilter.html#instance-member-filtersRowIndex",
@@ -5027,12 +4163,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#fltGrid",
"member"
],
- [
- "src/tablefilter.js~tablefilter#fltids",
- "class/src/tablefilter.js~TableFilter.html#instance-member-fltIds",
- "src/tablefilter.js~TableFilter#fltIds",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#fltmulticssclass",
"class/src/tablefilter.js~TableFilter.html#instance-member-fltMultiCssClass",
@@ -5087,12 +4217,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#getClearFilterText",
"method"
],
- [
- "src/tablefilter.js~tablefilter#getcolvalues",
- "class/src/tablefilter.js~TableFilter.html#instance-method-getColValues",
- "src/tablefilter.js~TableFilter#getColValues",
- "method"
- ],
[
"src/tablefilter.js~tablefilter#getcolumndata",
"class/src/tablefilter.js~TableFilter.html#instance-method-getColumnData",
@@ -5177,12 +4301,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#getFilteredData",
"method"
],
- [
- "src/tablefilter.js~tablefilter#getfiltereddatacol",
- "class/src/tablefilter.js~TableFilter.html#instance-method-getFilteredDataCol",
- "src/tablefilter.js~TableFilter#getFilteredDataCol",
- "method"
- ],
[
"src/tablefilter.js~tablefilter#getfilteredvalues",
"class/src/tablefilter.js~TableFilter.html#instance-method-getFilteredValues",
@@ -5255,36 +4373,12 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#getStartRowIndex",
"method"
],
- [
- "src/tablefilter.js~tablefilter#getstylepath",
- "class/src/tablefilter.js~TableFilter.html#instance-method-getStylePath",
- "src/tablefilter.js~TableFilter#getStylePath",
- "method"
- ],
[
"src/tablefilter.js~tablefilter#getstylesheet",
"class/src/tablefilter.js~TableFilter.html#instance-method-getStylesheet",
"src/tablefilter.js~TableFilter#getStylesheet",
"method"
],
- [
- "src/tablefilter.js~tablefilter#getstylesheetpath",
- "class/src/tablefilter.js~TableFilter.html#instance-method-getStylesheetPath",
- "src/tablefilter.js~TableFilter#getStylesheetPath",
- "method"
- ],
- [
- "src/tablefilter.js~tablefilter#gettabledata",
- "class/src/tablefilter.js~TableFilter.html#instance-method-getTableData",
- "src/tablefilter.js~TableFilter#getTableData",
- "method"
- ],
- [
- "src/tablefilter.js~tablefilter#getthemespath",
- "class/src/tablefilter.js~TableFilter.html#instance-method-getThemesPath",
- "src/tablefilter.js~TableFilter#getThemesPath",
- "method"
- ],
[
"src/tablefilter.js~tablefilter#getvalidrows",
"class/src/tablefilter.js~TableFilter.html#instance-method-getValidRows",
@@ -5333,54 +4427,24 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#gridLayout",
"member"
],
- [
- "src/tablefilter.js~tablefilter#hasconfig",
- "class/src/tablefilter.js~TableFilter.html#instance-member-hasConfig",
- "src/tablefilter.js~TableFilter#hasConfig",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#hascustomoptions",
"class/src/tablefilter.js~TableFilter.html#instance-member-hasCustomOptions",
"src/tablefilter.js~TableFilter#hasCustomOptions",
"member"
],
- [
- "src/tablefilter.js~tablefilter#hasexactmatchbycol",
- "class/src/tablefilter.js~TableFilter.html#instance-member-hasExactMatchByCol",
- "src/tablefilter.js~TableFilter#hasExactMatchByCol",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#hasexcludedrows",
- "class/src/tablefilter.js~TableFilter.html#instance-member-hasExcludedRows",
- "src/tablefilter.js~TableFilter#hasExcludedRows",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#hasextension",
"class/src/tablefilter.js~TableFilter.html#instance-method-hasExtension",
"src/tablefilter.js~TableFilter#hasExtension",
"method"
],
- [
- "src/tablefilter.js~tablefilter#hasthemes",
- "class/src/tablefilter.js~TableFilter.html#instance-member-hasThemes",
- "src/tablefilter.js~TableFilter#hasThemes",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#hastype",
"class/src/tablefilter.js~TableFilter.html#instance-method-hasType",
"src/tablefilter.js~TableFilter#hasType",
"method"
],
- [
- "src/tablefilter.js~tablefilter#headersrow",
- "class/src/tablefilter.js~TableFilter.html#instance-member-headersRow",
- "src/tablefilter.js~TableFilter#headersRow",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#help",
"class/src/tablefilter.js~TableFilter.html#instance-member-help",
@@ -5393,12 +4457,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#highlightKeywords",
"member"
],
- [
- "src/tablefilter.js~tablefilter#id",
- "class/src/tablefilter.js~TableFilter.html#instance-member-id",
- "src/tablefilter.js~TableFilter#id",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#ignorediacritics",
"class/src/tablefilter.js~TableFilter.html#instance-member-ignoreDiacritics",
@@ -5429,24 +4487,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#initExtensions",
"method"
],
- [
- "src/tablefilter.js~tablefilter#initfeatures",
- "class/src/tablefilter.js~TableFilter.html#instance-method-initFeatures",
- "src/tablefilter.js~TableFilter#initFeatures",
- "method"
- ],
- [
- "src/tablefilter.js~tablefilter#initialized",
- "class/src/tablefilter.js~TableFilter.html#instance-member-initialized",
- "src/tablefilter.js~TableFilter#initialized",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#instantiatefeatures",
- "class/src/tablefilter.js~TableFilter.html#instance-method-instantiateFeatures",
- "src/tablefilter.js~TableFilter#instantiateFeatures",
- "method"
- ],
[
"src/tablefilter.js~tablefilter#iscustomoptions",
"class/src/tablefilter.js~TableFilter.html#instance-method-isCustomOptions",
@@ -5459,12 +4499,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#isExactMatch",
"method"
],
- [
- "src/tablefilter.js~tablefilter#isexternalflt",
- "class/src/tablefilter.js~TableFilter.html#instance-method-isExternalFlt",
- "src/tablefilter.js~TableFilter#isExternalFlt",
- "method"
- ],
[
"src/tablefilter.js~tablefilter#isimported",
"class/src/tablefilter.js~TableFilter.html#instance-method-isImported",
@@ -5489,30 +4523,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#isRowValid",
"method"
],
- [
- "src/tablefilter.js~tablefilter#issortnumasc",
- "class/src/tablefilter.js~TableFilter.html#instance-member-isSortNumAsc",
- "src/tablefilter.js~TableFilter#isSortNumAsc",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#issortnumdesc",
- "class/src/tablefilter.js~TableFilter.html#instance-member-isSortNumDesc",
- "src/tablefilter.js~TableFilter#isSortNumDesc",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#isusertyping",
- "class/src/tablefilter.js~TableFilter.html#instance-member-isUserTyping",
- "src/tablefilter.js~TableFilter#isUserTyping",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#iswatermarkarray",
- "class/src/tablefilter.js~TableFilter.html#instance-member-isWatermarkArray",
- "src/tablefilter.js~TableFilter#isWatermarkArray",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#leoperator",
"class/src/tablefilter.js~TableFilter.html#instance-member-leOperator",
@@ -5579,24 +4589,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#markActiveColumns",
"member"
],
- [
- "src/tablefilter.js~tablefilter#nbcells",
- "class/src/tablefilter.js~TableFilter.html#instance-member-nbCells",
- "src/tablefilter.js~TableFilter#nbCells",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#nbfilterablerows",
- "class/src/tablefilter.js~TableFilter.html#instance-member-nbFilterableRows",
- "src/tablefilter.js~TableFilter#nbFilterableRows",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#nbhiddenrows",
- "class/src/tablefilter.js~TableFilter.html#instance-member-nbHiddenRows",
- "src/tablefilter.js~TableFilter#nbHiddenRows",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#nmoperator",
"class/src/tablefilter.js~TableFilter.html#instance-member-nmOperator",
@@ -5699,30 +4691,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#popupFilters",
"member"
],
- [
- "src/tablefilter.js~tablefilter#prfxflt",
- "class/src/tablefilter.js~TableFilter.html#instance-member-prfxFlt",
- "src/tablefilter.js~TableFilter#prfxFlt",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#prfxresponsive",
- "class/src/tablefilter.js~TableFilter.html#instance-member-prfxResponsive",
- "src/tablefilter.js~TableFilter#prfxResponsive",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#prfxtf",
- "class/src/tablefilter.js~TableFilter.html#instance-member-prfxTf",
- "src/tablefilter.js~TableFilter#prfxTf",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#prfxvalbutton",
- "class/src/tablefilter.js~TableFilter.html#instance-member-prfxValButton",
- "src/tablefilter.js~TableFilter#prfxValButton",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#refrow",
"class/src/tablefilter.js~TableFilter.html#instance-member-refRow",
@@ -5855,18 +4823,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#stylesheet",
"member"
],
- [
- "src/tablefilter.js~tablefilter#stylesheetid",
- "class/src/tablefilter.js~TableFilter.html#instance-member-stylesheetId",
- "src/tablefilter.js~TableFilter#stylesheetId",
- "member"
- ],
- [
- "src/tablefilter.js~tablefilter#tbl",
- "class/src/tablefilter.js~TableFilter.html#instance-member-tbl",
- "src/tablefilter.js~TableFilter#tbl",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#themes",
"class/src/tablefilter.js~TableFilter.html#instance-member-themes",
@@ -5891,12 +4847,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#toolbar",
"member"
],
- [
- "src/tablefilter.js~tablefilter#validrowsindex",
- "class/src/tablefilter.js~TableFilter.html#instance-member-validRowsIndex",
- "src/tablefilter.js~TableFilter#validRowsIndex",
- "member"
- ],
[
"src/tablefilter.js~tablefilter#validateallrows",
"class/src/tablefilter.js~TableFilter.html#instance-method-validateAllRows",
@@ -5921,12 +4871,6 @@ window.esdocSearchIndex = [
"src/tablefilter.js~TableFilter#watermark",
"member"
],
- [
- "src/tablefilter.js~tablefilter#year",
- "class/src/tablefilter.js~TableFilter.html#instance-member-year",
- "src/tablefilter.js~TableFilter#year",
- "member"
- ],
[
"src/types.js",
"file/src/types.js.html",
diff --git a/docs/source.html b/docs/source.html
index 12021030..961b7e11 100644
--- a/docs/source.html
+++ b/docs/source.html
@@ -47,6 +47,7 @@
Ftag
FaddEvt
FcancelEvt
+FisKeyPressed
FkeyCode
FremoveEvt
FstopEvt
@@ -133,7 +134,7 @@
-Source
896/930
+Source
897/931
@@ -154,7 +155,7 @@
100 %1/1
-
+
src/const.js
@@ -180,7 +181,7 @@
100 %19/19
-
+
src/cookie.js
@@ -188,7 +189,7 @@
100 %1/1
-
+
src/dom.js
@@ -207,7 +208,7 @@
92 %13/14
-
+
src/emitter.js
@@ -215,20 +216,21 @@
100 %6/6
-
+
src/event.js
addEvt
cancelEvt
+isKeyPressed
keyCode
removeEvt
stopEvt
targetEvt
- 100 %6/6
-
-
-
+ 100 %7/7
+
+
+
src/extensions/advancedGrid/adapterEzEditTable.js
@@ -236,7 +238,7 @@
88 %16/18
-
+
src/extensions/advancedGrid/advancedGrid.js
@@ -244,7 +246,7 @@
-
-
+
src/extensions/colOps/colOps.js
@@ -252,7 +254,7 @@
78 %29/37
-
+
src/extensions/colsVisibility/colsVisibility.js
@@ -260,7 +262,7 @@
91 %57/62
-
+
src/extensions/filtersVisibility/filtersVisibility.js
@@ -268,7 +270,7 @@
100 %33/33
-
+
src/extensions/sort/adapterSortabletable.js
@@ -276,7 +278,7 @@
86 %26/30
-
+
src/extensions/sort/sort.js
@@ -284,7 +286,7 @@
-
-
+
src/feature.js
@@ -292,7 +294,7 @@
93 %14/15
-
+
src/modules/alternateRows.js
@@ -300,7 +302,7 @@
100 %11/11
-
+
src/modules/baseDropdown.js
@@ -308,7 +310,7 @@
100 %10/10
-
+
src/modules/checkList.js
@@ -316,7 +318,7 @@
100 %27/27
-
+
src/modules/clearButton.js
@@ -324,7 +326,7 @@
100 %14/14
-
+
src/modules/dateType.js
@@ -332,7 +334,7 @@
100 %12/12
-
+
src/modules/dropdown.js
@@ -340,7 +342,7 @@
100 %19/19
-
+
src/modules/gridLayout.js
@@ -348,7 +350,7 @@
100 %34/34
-
+
src/modules/hash.js
@@ -357,7 +359,7 @@
75 %12/16
-
+
src/modules/help.js
@@ -365,7 +367,7 @@
90 %20/22
-
+
src/modules/highlightKeywords.js
@@ -373,7 +375,7 @@
100 %11/11
-
+
src/modules/loader.js
@@ -381,7 +383,7 @@
93 %14/15
-
+
src/modules/markActiveColumns.js
@@ -389,7 +391,7 @@
100 %13/13
-
+
src/modules/noResults.js
@@ -397,15 +399,15 @@
100 %19/19
-
+
src/modules/paging.js
Paging
100 %58/58
-
-
-
+
+
+
src/modules/popupFilter.js
@@ -413,7 +415,7 @@
100 %35/35
-
+
src/modules/rowsCounter.js
@@ -421,7 +423,7 @@
100 %16/16
-
+
src/modules/state.js
@@ -429,7 +431,7 @@
100 %41/41
-
+
src/modules/statusBar.js
@@ -437,7 +439,7 @@
96 %27/28
-
+
src/modules/storage.js
@@ -446,7 +448,7 @@
84 %16/19
-
+
src/modules/toolbar.js
@@ -457,7 +459,7 @@
95 %21/22
-
+
src/number.js
@@ -465,7 +467,7 @@
100 %1/1
-
+
src/root.js
@@ -473,7 +475,7 @@
100 %1/1
-
+
src/settings.js
@@ -485,7 +487,7 @@
100 %5/5
-
+
src/sort.js
@@ -499,7 +501,7 @@
100 %7/7
-
+
src/string.js
@@ -511,15 +513,15 @@
100 %5/5
-
+
src/tablefilter.js
TableFilter
99 %215/216
-
+
-
+
src/types.js
@@ -536,7 +538,7 @@
100 %11/11
-
+
diff --git a/docs/variable/index.html b/docs/variable/index.html
index f4bcf14b..db4c77c7 100644
--- a/docs/variable/index.html
+++ b/docs/variable/index.html
@@ -47,6 +47,7 @@
Ftag
FaddEvt
FcancelEvt
+FisKeyPressed
FkeyCode
FremoveEvt
FstopEvt