[
{
"__docId__": 0,
"kind": "file",
"static": true,
"variation": null,
"name": "src/array.js",
"memberof": null,
"longname": "src/array.js",
"access": null,
"description": null,
"lineNumber": 5,
"content": "/**\n * Array utilities\n */\n\nimport {matchCase} from './string';\n\n/**\n * Checks if given item can be found in the passed collection\n * @param {Array} arr collection\n * @param {Any} val item to search\n * @param {Boolean} caseSensitive respects case if true\n * @return {Boolean}\n */\nexport const has = (arr, val, caseSensitive) => {\n let sCase = Boolean(caseSensitive);\n for (var i = 0, l = arr.length; i < l; i++) {\n if (matchCase(arr[i].toString(), sCase) === val) {\n return true;\n }\n }\n return false;\n}\n"
},
{
"__docId__": 1,
"kind": "variable",
"static": true,
"variation": null,
"name": "has",
"memberof": "src/array.js",
"longname": "src/array.js~has",
"access": null,
"export": true,
"importPath": "tablefilter/src/array.js",
"importStyle": "{has}",
"description": "Checks if given item can be found in the passed collection",
"lineNumber": 14,
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "arr",
"description": "collection"
},
{
"nullable": null,
"types": [
"Any"
],
"spread": false,
"optional": false,
"name": "val",
"description": "item to search"
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "caseSensitive",
"description": "respects case if true"
}
],
"return": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 2,
"kind": "file",
"static": true,
"variation": null,
"name": "src/const.js",
"memberof": null,
"longname": "src/const.js",
"access": null,
"description": null,
"lineNumber": 9,
"content": "/**\n * Filter types\n */\n\n/**\n * Input filter type\n * @type {String}\n */\nexport const INPUT = 'input';\n/**\n * Select filter type\n * @type {String}\n */\nexport const SELECT = 'select';\n/**\n * Multiple select filter type\n * @type {String}\n */\nexport const MULTIPLE = 'multiple';\n/**\n * Checklist filter type\n * @type {String}\n */\nexport const CHECKLIST = 'checklist';\n/**\n * None filter type\n * @type {String}\n */\nexport const NONE = 'none';\n\n/**\n * Key codes\n */\n\n/**\n * Enter key code\n * @type {Number}\n */\nexport const ENTER_KEY = 13;\n/**\n * Tab key code\n * @type {Number}\n */\nexport const TAB_KEY = 9;\n/**\n * Escape key code\n * @type {Number}\n */\nexport const ESC_KEY = 27;\n/**\n * Up arrow key code\n * @type {Number}\n */\nexport const UP_ARROW_KEY = 38;\n/**\n * Down arrow key code\n * @type {Number}\n */\nexport const DOWN_ARROW_KEY = 40;\n\n/**\n * HTML tags\n */\n\n/**\n * Header cell tag\n * @type {String}\n */\nexport const HEADER_TAG = 'TH';\n/**\n * Cell tag\n * @type {String}\n */\nexport const CELL_TAG = 'TD';\n\n/**\n * Default values\n */\n\n/**\n * Auto filter delay in milliseconds\n * @type {Number}\n */\nexport const AUTO_FILTER_DELAY = 750;\n"
},
{
"__docId__": 3,
"kind": "variable",
"static": true,
"variation": null,
"name": "INPUT",
"memberof": "src/const.js",
"longname": "src/const.js~INPUT",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{INPUT}",
"description": "Input filter type",
"lineNumber": 9,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 4,
"kind": "variable",
"static": true,
"variation": null,
"name": "SELECT",
"memberof": "src/const.js",
"longname": "src/const.js~SELECT",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{SELECT}",
"description": "Select filter type",
"lineNumber": 14,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 5,
"kind": "variable",
"static": true,
"variation": null,
"name": "MULTIPLE",
"memberof": "src/const.js",
"longname": "src/const.js~MULTIPLE",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{MULTIPLE}",
"description": "Multiple select filter type",
"lineNumber": 19,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 6,
"kind": "variable",
"static": true,
"variation": null,
"name": "CHECKLIST",
"memberof": "src/const.js",
"longname": "src/const.js~CHECKLIST",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{CHECKLIST}",
"description": "Checklist filter type",
"lineNumber": 24,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 7,
"kind": "variable",
"static": true,
"variation": null,
"name": "NONE",
"memberof": "src/const.js",
"longname": "src/const.js~NONE",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{NONE}",
"description": "None filter type",
"lineNumber": 29,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 8,
"kind": "variable",
"static": true,
"variation": null,
"name": "ENTER_KEY",
"memberof": "src/const.js",
"longname": "src/const.js~ENTER_KEY",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{ENTER_KEY}",
"description": "Enter key code",
"lineNumber": 39,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 9,
"kind": "variable",
"static": true,
"variation": null,
"name": "TAB_KEY",
"memberof": "src/const.js",
"longname": "src/const.js~TAB_KEY",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{TAB_KEY}",
"description": "Tab key code",
"lineNumber": 44,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 10,
"kind": "variable",
"static": true,
"variation": null,
"name": "ESC_KEY",
"memberof": "src/const.js",
"longname": "src/const.js~ESC_KEY",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{ESC_KEY}",
"description": "Escape key code",
"lineNumber": 49,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 11,
"kind": "variable",
"static": true,
"variation": null,
"name": "UP_ARROW_KEY",
"memberof": "src/const.js",
"longname": "src/const.js~UP_ARROW_KEY",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{UP_ARROW_KEY}",
"description": "Up arrow key code",
"lineNumber": 54,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 12,
"kind": "variable",
"static": true,
"variation": null,
"name": "DOWN_ARROW_KEY",
"memberof": "src/const.js",
"longname": "src/const.js~DOWN_ARROW_KEY",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{DOWN_ARROW_KEY}",
"description": "Down arrow key code",
"lineNumber": 59,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 13,
"kind": "variable",
"static": true,
"variation": null,
"name": "HEADER_TAG",
"memberof": "src/const.js",
"longname": "src/const.js~HEADER_TAG",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{HEADER_TAG}",
"description": "Header cell tag",
"lineNumber": 69,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 14,
"kind": "variable",
"static": true,
"variation": null,
"name": "CELL_TAG",
"memberof": "src/const.js",
"longname": "src/const.js~CELL_TAG",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{CELL_TAG}",
"description": "Cell tag",
"lineNumber": 74,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 15,
"kind": "variable",
"static": true,
"variation": null,
"name": "AUTO_FILTER_DELAY",
"memberof": "src/const.js",
"longname": "src/const.js~AUTO_FILTER_DELAY",
"access": null,
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{AUTO_FILTER_DELAY}",
"description": "Auto filter delay in milliseconds",
"lineNumber": 84,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 16,
"kind": "file",
"static": true,
"variation": null,
"name": "src/cookie.js",
"memberof": null,
"longname": "src/cookie.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {root} from './root';\n\n/**\n * Cookie utilities\n */\n\nconst doc = root.document;\n\nexport default {\n\n write(name, value, hours) {\n let expire = '';\n if (hours) {\n expire = new Date((new Date()).getTime() + hours * 3600000);\n expire = '; expires=' + expire.toGMTString();\n }\n doc.cookie = name + '=' + escape(value) + expire;\n },\n\n read(name) {\n let cookieValue = '',\n search = name + '=';\n if (doc.cookie.length > 0) {\n let cookie = doc.cookie,\n offset = cookie.indexOf(search);\n if (offset !== -1) {\n offset += search.length;\n let end = cookie.indexOf(';', offset);\n if (end === -1) {\n end = cookie.length;\n }\n cookieValue = unescape(cookie.substring(offset, end));\n }\n }\n return cookieValue;\n },\n\n remove(name) {\n this.write(name, '', -1);\n },\n\n valueToArray(name, separator) {\n if (!separator) {\n separator = ',';\n }\n //reads the cookie\n let val = this.read(name);\n //creates an array with filters' values\n let arr = val.split(separator);\n return arr;\n },\n\n getValueByIndex(name, index, separator) {\n if (!separator) {\n separator = ',';\n }\n //reads the cookie\n let val = this.valueToArray(name, separator);\n return val[index];\n }\n\n};\n"
},
{
"__docId__": 17,
"kind": "variable",
"static": true,
"variation": null,
"name": "doc",
"memberof": "src/cookie.js",
"longname": "src/cookie.js~doc",
"access": null,
"export": false,
"importPath": "tablefilter/src/cookie.js",
"importStyle": null,
"description": "Cookie utilities",
"lineNumber": 7,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 18,
"kind": "file",
"static": true,
"variation": null,
"name": "src/date.js",
"memberof": null,
"longname": "src/date.js",
"access": null,
"description": null,
"lineNumber": 11,
"content": "/**\n * Date utilities\n */\n\n/**\n * Verifies passed formatted date string is valid\n * @param {String} dateStr Formatted date string\n * @param {String} format accepted formats: 'DMY', 'MDY', 'YMD', 'DDMMMYYYY'\n * @return {Boolean}\n */\nexport const isValidDate = (dateStr, format) => {\n if (!format) {\n format = 'DMY';\n }\n format = format.toUpperCase();\n if (format.length !== 3) {\n if (format === 'DDMMMYYYY') {\n let d = formatDate(dateStr, format);\n dateStr = d.getDate() + '/' + (d.getMonth() + 1) + '/' +\n d.getFullYear();\n format = 'DMY';\n }\n }\n if ((format.indexOf('M') === -1) || (format.indexOf('D') === -1) ||\n (format.indexOf('Y') === -1)) {\n format = 'DMY';\n }\n let reg1, reg2;\n // If the year is first\n if (format.substring(0, 1) === 'Y') {\n reg1 = /^\\d{2}(\\-|\\/|\\.)\\d{1,2}\\1\\d{1,2}$/;\n reg2 = /^\\d{4}(\\-|\\/|\\.)\\d{1,2}\\1\\d{1,2}$/;\n } else if (format.substring(1, 2) === 'Y') { // If the year is second\n reg1 = /^\\d{1,2}(\\-|\\/|\\.)\\d{2}\\1\\d{1,2}$/;\n reg2 = /^\\d{1,2}(\\-|\\/|\\.)\\d{4}\\1\\d{1,2}$/;\n } else { // The year must be third\n reg1 = /^\\d{1,2}(\\-|\\/|\\.)\\d{1,2}\\1\\d{2}$/;\n reg2 = /^\\d{1,2}(\\-|\\/|\\.)\\d{1,2}\\1\\d{4}$/;\n }\n // If it doesn't conform to the right format (with either a 2 digit year\n // or 4 digit year), fail\n if (reg1.test(dateStr) === false && reg2.test(dateStr) === false) {\n return false;\n }\n // Split into 3 parts based on what the divider was\n let parts = dateStr.split(RegExp.$1);\n let mm, dd, yy;\n // Check to see if the 3 parts end up making a valid date\n if (format.substring(0, 1) === 'M') {\n mm = parts[0];\n } else if (format.substring(1, 2) === 'M') {\n mm = parts[1];\n } else {\n mm = parts[2];\n }\n if (format.substring(0, 1) === 'D') {\n dd = parts[0];\n } else if (format.substring(1, 2) === 'D') {\n dd = parts[1];\n } else {\n dd = parts[2];\n }\n if (format.substring(0, 1) === 'Y') {\n yy = parts[0];\n } else if (format.substring(1, 2) === 'Y') {\n yy = parts[1];\n } else {\n yy = parts[2];\n }\n if (parseInt(yy, 10) <= 50) {\n yy = (parseInt(yy, 10) + 2000).toString();\n }\n if (parseInt(yy, 10) <= 99) {\n yy = (parseInt(yy, 10) + 1900).toString();\n }\n let dt = new Date(\n parseInt(yy, 10), parseInt(mm, 10) - 1, parseInt(dd, 10),\n 0, 0, 0, 0);\n if (parseInt(dd, 10) !== dt.getDate()) {\n return false;\n }\n if (parseInt(mm, 10) - 1 !== dt.getMonth()) {\n return false;\n }\n return true;\n}\n\n/**\n * Converts formatted date into a Date object\n * @param {String} dateStr Formatted date string\n * @param {String} format accepted formats: 'DMY', 'MDY', 'YMD', 'DDMMMYYYY'\n * @return {Object} date object\n */\nexport const formatDate = (dateStr, formatStr) => {\n if (!formatStr) {\n formatStr = 'DMY';\n }\n if (!dateStr || dateStr === '') {\n return new Date(1001, 0, 1);\n }\n let oDate;\n let parts;\n\n switch (formatStr.toUpperCase()) {\n case 'DDMMMYYYY':\n parts = dateStr.replace(/[- \\/.]/g, ' ').split(' ');\n oDate = new Date(y2kDate(parts[2]), mmm2mm(parts[1]) - 1, parts[0]);\n break;\n case 'DMY':\n /* eslint-disable */\n parts = dateStr.replace(\n /^(0?[1-9]|[12][0-9]|3[01])([- \\/.])(0?[1-9]|1[012])([- \\/.])((\\d\\d)?\\d\\d)$/, '$1 $3 $5').split(' ');\n oDate = new Date(y2kDate(parts[2]), parts[1] - 1, parts[0]);\n /* eslint-enable */\n break;\n case 'MDY':\n /* eslint-disable */\n parts = dateStr.replace(\n /^(0?[1-9]|1[012])([- \\/.])(0?[1-9]|[12][0-9]|3[01])([- \\/.])((\\d\\d)?\\d\\d)$/, '$1 $3 $5').split(' ');\n oDate = new Date(y2kDate(parts[2]), parts[0] - 1, parts[1]);\n /* eslint-enable */\n break;\n case 'YMD':\n /* eslint-disable */\n parts = dateStr.replace(/^((\\d\\d)?\\d\\d)([- \\/.])(0?[1-9]|1[012])([- \\/.])(0?[1-9]|[12][0-9]|3[01])$/, '$1 $4 $6').split(' ');\n oDate = new Date(y2kDate(parts[0]), parts[1] - 1, parts[2]);\n /* eslint-enable */\n break;\n default: //in case format is not correct\n /* eslint-disable */\n parts = dateStr.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \\/.])(0?[1-9]|1[012])([- \\/.])((\\d\\d)?\\d\\d)$/, '$1 $3 $5').split(' ');\n oDate = new Date(y2kDate(parts[2]), parts[1] - 1, parts[0]);\n /* eslint-enable */\n break;\n }\n return oDate;\n}\n\nfunction y2kDate(yr) {\n if (yr === undefined) {\n return 0;\n }\n if (yr.length > 2) {\n return yr;\n }\n let y;\n //>50 belong to 1900\n if (yr <= 99 && yr > 50) {\n y = '19' + yr;\n }\n //<50 belong to 2000\n if (yr < 50 || yr === '00') {\n y = '20' + yr;\n }\n return y;\n}\n\nfunction mmm2mm(mmm) {\n if (mmm === undefined) {\n return 0;\n }\n let mondigit;\n let MONTH_NAMES = [\n 'january', 'february', 'march', 'april', 'may', 'june', 'july',\n 'august', 'september', 'october', 'november', 'december',\n 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct',\n 'nov', 'dec'\n ];\n for (let m_i = 0; m_i < MONTH_NAMES.length; m_i++) {\n let month_name = MONTH_NAMES[m_i];\n if (mmm.toLowerCase() === month_name) {\n mondigit = m_i + 1;\n break;\n }\n }\n if (mondigit > 11 || mondigit < 23) {\n mondigit = mondigit - 12;\n }\n if (mondigit < 1 || mondigit > 12) {\n return 0;\n }\n return mondigit;\n}\n"
},
{
"__docId__": 19,
"kind": "variable",
"static": true,
"variation": null,
"name": "isValidDate",
"memberof": "src/date.js",
"longname": "src/date.js~isValidDate",
"access": null,
"export": true,
"importPath": "tablefilter/src/date.js",
"importStyle": "{isValidDate}",
"description": "Verifies passed formatted date string is valid",
"lineNumber": 11,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "dateStr",
"description": "Formatted date string"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "format",
"description": "accepted formats: 'DMY', 'MDY', 'YMD', 'DDMMMYYYY'"
}
],
"return": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 20,
"kind": "variable",
"static": true,
"variation": null,
"name": "formatDate",
"memberof": "src/date.js",
"longname": "src/date.js~formatDate",
"access": null,
"export": true,
"importPath": "tablefilter/src/date.js",
"importStyle": "{formatDate}",
"description": "Converts formatted date into a Date object",
"lineNumber": 94,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "dateStr",
"description": "Formatted date string"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "format",
"description": "accepted formats: 'DMY', 'MDY', 'YMD', 'DDMMMYYYY'"
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": "date object"
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 21,
"kind": "function",
"static": true,
"variation": null,
"name": "y2kDate",
"memberof": "src/date.js",
"longname": "src/date.js~y2kDate",
"access": null,
"export": false,
"importPath": "tablefilter/src/date.js",
"importStyle": null,
"description": null,
"lineNumber": 139,
"undocument": true,
"params": [
{
"name": "yr",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 22,
"kind": "function",
"static": true,
"variation": null,
"name": "mmm2mm",
"memberof": "src/date.js",
"longname": "src/date.js~mmm2mm",
"access": null,
"export": false,
"importPath": "tablefilter/src/date.js",
"importStyle": null,
"description": null,
"lineNumber": 158,
"undocument": true,
"params": [
{
"name": "mmm",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 23,
"kind": "file",
"static": true,
"variation": null,
"name": "src/dom.js",
"memberof": null,
"longname": "src/dom.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {root} from './root';\nimport {isArray, isString, isUndef} from './types';\nimport {trim} from './string';\n\n/**\n * DOM utilities\n */\n\nconst doc = root.document;\n\n/**\n * Returns text + text of children of given node\n * @param {NodeElement} node\n * @return {String}\n */\nexport const getText = node => {\n if (isUndef(node.textContent)) {\n return trim(node.innerText);\n }\n return trim(node.textContent);\n}\n\n/**\n * Returns the first text node contained in the supplied node\n * @param {NodeElement} node node\n * @return {String}\n */\nexport const getFirstTextNode = node => {\n for (let i = 0; i < node.childNodes.length; i++) {\n let n = node.childNodes[i];\n if (n.nodeType === 3) {\n return n.data;\n }\n }\n}\n\n/**\n * Creates an html element with given collection of attributes\n * @param {String} tag a string of the html tag to create\n * @param {Array} an undetermined number of arrays containing the with 2\n * items, the attribute name and its value ['id','myId']\n * @return {Object} created element\n */\nexport const createElm = (...args) => {\n let tag = args[0];\n if (!isString(tag)) {\n return null;\n }\n\n let el = doc.createElement(tag);\n for (let i = 0; i < args.length; i++) {\n let arg = args[i];\n\n if (isArray(arg) && arg.length === 2) {\n el.setAttribute(arg[0], arg[1]);\n }\n }\n\n return el;\n}\n\n/**\n * Removes passed node from DOM\n * @param {DOMElement} node\n * @return {DOMElement} old node reference\n */\nexport const removeElm = node => node.parentNode.removeChild(node);\n\n/**\n * Returns a text node with given text\n * @param {String} txt\n * @return {Object}\n */\nexport const createText = txt => doc.createTextNode(txt);\n\n/**\n * Determine whether the passed elements is assigned the given class\n * @param {DOMElement} ele DOM element\n * @param {String} cls CSS class name\n * @returns {Boolean}\n */\nexport const hasClass = (ele, cls) => {\n if (isUndef(ele)) {\n return false;\n }\n\n if (supportsClassList()) {\n return ele.classList.contains(cls);\n }\n return ele.className.match(new RegExp('(\\\\s|^)' + cls + '(\\\\s|$)'));\n}\n\n/**\n * Adds the specified class to the passed element\n * @param {DOMElement} ele DOM element\n * @param {String} cls CSS class name\n */\nexport const addClass = (ele, cls) => {\n if (isUndef(ele)) {\n return;\n }\n\n if (supportsClassList()) {\n ele.classList.add(cls);\n return;\n }\n\n if (ele.className === '') {\n ele.className = cls;\n }\n else if (!hasClass(ele, cls)) {\n ele.className += ' ' + cls;\n }\n}\n\n/**\n * Removes the specified class to the passed element\n * @param {DOMElement} ele DOM element\n * @param {String} cls CSS class name\n */\nexport const removeClass = (ele, cls) => {\n if (isUndef(ele)) {\n return;\n }\n\n if (supportsClassList()) {\n ele.classList.remove(cls);\n return;\n }\n let reg = new RegExp('(\\\\s|^)' + cls + '(\\\\s|$)', 'g');\n ele.className = ele.className.replace(reg, '');\n}\n\n/**\n * Creates and returns an option element\n * @param {String} text option text\n * @param {String} value option value\n * @param {Boolean} isSel whether option is selected\n * @return {Object} option element\n */\nexport const createOpt = (text, value, isSel) => {\n let isSelected = isSel ? true : false;\n let opt = isSelected ?\n createElm('option', ['value', value], ['selected', 'true']) :\n createElm('option', ['value', value]);\n opt.appendChild(createText(text));\n return opt;\n}\n\n/**\n * Creates and returns a checklist item\n * @param {Number} chkIndex index of check item\n * @param {String} chkValue check item value\n * @param {String} labelText check item label text\n * @return {Object} li DOM element\n */\nexport const createCheckItem = (chkIndex, chkValue, labelText) => {\n let li = createElm('li');\n let label = createElm('label', ['for', chkIndex]);\n let check = createElm('input',\n ['id', chkIndex],\n ['name', chkIndex],\n ['type', 'checkbox'],\n ['value', chkValue]\n );\n label.appendChild(check);\n label.appendChild(createText(labelText));\n li.appendChild(label);\n li.label = label;\n li.check = check;\n return li;\n}\n\n/**\n * Returns the element matching the supplied Id\n * @param {String} id Element identifier\n * @return {DOMElement}\n */\nexport const elm = id => doc.getElementById(id);\n\n/**\n * Returns list of element matching the supplied tag name\n * @param {String} tagname Tag name\n * @return {NodeList}\n */\nexport const tag = (o, tagname) => o.getElementsByTagName(tagname);\n\n// HTML5 classList API\nfunction supportsClassList() {\n return doc.documentElement.classList;\n}\n"
},
{
"__docId__": 24,
"kind": "variable",
"static": true,
"variation": null,
"name": "doc",
"memberof": "src/dom.js",
"longname": "src/dom.js~doc",
"access": null,
"export": false,
"importPath": "tablefilter/src/dom.js",
"importStyle": null,
"description": "DOM utilities",
"lineNumber": 9,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 25,
"kind": "variable",
"static": true,
"variation": null,
"name": "getText",
"memberof": "src/dom.js",
"longname": "src/dom.js~getText",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{getText}",
"description": "Returns text + text of children of given node",
"lineNumber": 16,
"params": [
{
"nullable": null,
"types": [
"NodeElement"
],
"spread": false,
"optional": false,
"name": "node",
"description": ""
}
],
"return": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 26,
"kind": "variable",
"static": true,
"variation": null,
"name": "getFirstTextNode",
"memberof": "src/dom.js",
"longname": "src/dom.js~getFirstTextNode",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{getFirstTextNode}",
"description": "Returns the first text node contained in the supplied node",
"lineNumber": 28,
"params": [
{
"nullable": null,
"types": [
"NodeElement"
],
"spread": false,
"optional": false,
"name": "node",
"description": "node"
}
],
"return": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 27,
"kind": "variable",
"static": true,
"variation": null,
"name": "createElm",
"memberof": "src/dom.js",
"longname": "src/dom.js~createElm",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{createElm}",
"description": "Creates an html element with given collection of attributes",
"lineNumber": 44,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "tag",
"description": "a string of the html tag to create"
},
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "an",
"description": "undetermined number of arrays containing the with 2\n items, the attribute name and its value ['id','myId']"
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": "created element"
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 28,
"kind": "variable",
"static": true,
"variation": null,
"name": "removeElm",
"memberof": "src/dom.js",
"longname": "src/dom.js~removeElm",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{removeElm}",
"description": "Removes passed node from DOM",
"lineNumber": 67,
"params": [
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "node",
"description": ""
}
],
"return": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": "old node reference"
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 29,
"kind": "variable",
"static": true,
"variation": null,
"name": "createText",
"memberof": "src/dom.js",
"longname": "src/dom.js~createText",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{createText}",
"description": "Returns a text node with given text",
"lineNumber": 74,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "txt",
"description": ""
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 30,
"kind": "variable",
"static": true,
"variation": null,
"name": "hasClass",
"memberof": "src/dom.js",
"longname": "src/dom.js~hasClass",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{hasClass}",
"description": "Determine whether the passed elements is assigned the given class",
"lineNumber": 82,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Boolean}"
}
],
"params": [
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "ele",
"description": "DOM element"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "cls",
"description": "CSS class name"
}
],
"return": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 31,
"kind": "variable",
"static": true,
"variation": null,
"name": "addClass",
"memberof": "src/dom.js",
"longname": "src/dom.js~addClass",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{addClass}",
"description": "Adds the specified class to the passed element",
"lineNumber": 98,
"params": [
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "ele",
"description": "DOM element"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "cls",
"description": "CSS class name"
}
],
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 32,
"kind": "variable",
"static": true,
"variation": null,
"name": "removeClass",
"memberof": "src/dom.js",
"longname": "src/dom.js~removeClass",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{removeClass}",
"description": "Removes the specified class to the passed element",
"lineNumber": 121,
"params": [
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "ele",
"description": "DOM element"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "cls",
"description": "CSS class name"
}
],
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 33,
"kind": "variable",
"static": true,
"variation": null,
"name": "createOpt",
"memberof": "src/dom.js",
"longname": "src/dom.js~createOpt",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{createOpt}",
"description": "Creates and returns an option element",
"lineNumber": 141,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "text",
"description": "option text"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "value",
"description": "option value"
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "isSel",
"description": "whether option is selected"
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": "option element"
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 34,
"kind": "variable",
"static": true,
"variation": null,
"name": "createCheckItem",
"memberof": "src/dom.js",
"longname": "src/dom.js~createCheckItem",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{createCheckItem}",
"description": "Creates and returns a checklist item",
"lineNumber": 157,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "chkIndex",
"description": "index of check item"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "chkValue",
"description": "check item value"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "labelText",
"description": "check item label text"
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": "li DOM element"
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 35,
"kind": "variable",
"static": true,
"variation": null,
"name": "elm",
"memberof": "src/dom.js",
"longname": "src/dom.js~elm",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{elm}",
"description": "Returns the element matching the supplied Id",
"lineNumber": 179,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "id",
"description": "Element identifier"
}
],
"return": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 36,
"kind": "variable",
"static": true,
"variation": null,
"name": "tag",
"memberof": "src/dom.js",
"longname": "src/dom.js~tag",
"access": null,
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{tag}",
"description": "Returns list of element matching the supplied tag name",
"lineNumber": 186,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "tagname",
"description": "Tag name"
}
],
"return": {
"nullable": null,
"types": [
"NodeList"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 37,
"kind": "function",
"static": true,
"variation": null,
"name": "supportsClassList",
"memberof": "src/dom.js",
"longname": "src/dom.js~supportsClassList",
"access": null,
"export": false,
"importPath": "tablefilter/src/dom.js",
"importStyle": null,
"description": null,
"lineNumber": 189,
"undocument": true,
"params": [],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 38,
"kind": "file",
"static": true,
"variation": null,
"name": "src/emitter.js",
"memberof": null,
"longname": "src/emitter.js",
"access": null,
"description": null,
"lineNumber": 4,
"content": "/**\n * Event emitter class\n */\nexport class Emitter {\n /**\n * Creates an instance of Emitter.\n */\n constructor() {\n /**\n * Events object\n * @type {Object}\n */\n this.events = {};\n }\n\n /**\n * Subscribe to an event\n * @param {Array} evts Collection of event names\n * @param {Function} fn Function invoked when event is emitted\n */\n on(evts, fn) {\n evts.forEach((evt) => {\n this.events[evt] = this.events[evt] || [];\n this.events[evt].push(fn);\n });\n }\n\n /**\n * Unsubscribe to an event\n * @param {Array} evts Collection of event names\n * @param {Function} fn Function invoked when event is emitted\n */\n off(evts, fn) {\n evts.forEach((evt) => {\n if (evt in this.events) {\n this.events[evt].splice(this.events[evt].indexOf(fn), 1);\n }\n });\n }\n\n /**\n * Emit an event\n * @param {String} evt Event name followed by any other argument passed to\n * the invoked function\n */\n emit(evt /*, args...*/) {\n if (evt in this.events) {\n for (let i = 0; i < this.events[evt].length; i++) {\n this.events[evt][i].apply(this, [].slice.call(arguments, 1));\n }\n }\n }\n}\n"
},
{
"__docId__": 39,
"kind": "class",
"static": true,
"variation": null,
"name": "Emitter",
"memberof": "src/emitter.js",
"longname": "src/emitter.js~Emitter",
"access": null,
"export": true,
"importPath": "tablefilter/src/emitter.js",
"importStyle": "{Emitter}",
"description": "Event emitter class",
"lineNumber": 4,
"interface": false
},
{
"__docId__": 40,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/emitter.js~Emitter",
"longname": "src/emitter.js~Emitter#constructor",
"access": null,
"description": "Creates an instance of Emitter.",
"lineNumber": 8,
"params": [],
"generator": false
},
{
"__docId__": 41,
"kind": "member",
"static": false,
"variation": null,
"name": "events",
"memberof": "src/emitter.js~Emitter",
"longname": "src/emitter.js~Emitter#events",
"access": null,
"description": "Events object",
"lineNumber": 13,
"type": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": null
}
},
{
"__docId__": 42,
"kind": "method",
"static": false,
"variation": null,
"name": "on",
"memberof": "src/emitter.js~Emitter",
"longname": "src/emitter.js~Emitter#on",
"access": null,
"description": "Subscribe to an event",
"lineNumber": 21,
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "evts",
"description": "Collection of event names"
},
{
"nullable": null,
"types": [
"Function"
],
"spread": false,
"optional": false,
"name": "fn",
"description": "Function invoked when event is emitted"
}
],
"generator": false
},
{
"__docId__": 43,
"kind": "method",
"static": false,
"variation": null,
"name": "off",
"memberof": "src/emitter.js~Emitter",
"longname": "src/emitter.js~Emitter#off",
"access": null,
"description": "Unsubscribe to an event",
"lineNumber": 33,
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "evts",
"description": "Collection of event names"
},
{
"nullable": null,
"types": [
"Function"
],
"spread": false,
"optional": false,
"name": "fn",
"description": "Function invoked when event is emitted"
}
],
"generator": false
},
{
"__docId__": 44,
"kind": "method",
"static": false,
"variation": null,
"name": "emit",
"memberof": "src/emitter.js~Emitter",
"longname": "src/emitter.js~Emitter#emit",
"access": null,
"description": "Emit an event",
"lineNumber": 46,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "evt",
"description": "Event name followed by any other argument passed to\nthe invoked function"
}
],
"generator": false
},
{
"__docId__": 45,
"kind": "file",
"static": true,
"variation": null,
"name": "src/event.js",
"memberof": null,
"longname": "src/event.js",
"access": null,
"description": null,
"lineNumber": 1,
"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.detachEvent) {\n obj.detachEvent('on' + type, func);\n }\n else if (obj.removeEventListener) {\n obj.removeEventListener(type, func, capture);\n } else {\n obj['on' + type] = null;\n }\n};\n\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"
},
{
"__docId__": 46,
"kind": "variable",
"static": true,
"variation": null,
"name": "addEvt",
"memberof": "src/event.js",
"longname": "src/event.js~addEvt",
"access": null,
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{addEvt}",
"description": "Add event handler for specified event on passed element",
"lineNumber": 16,
"params": [
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "obj",
"description": "Element"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "type",
"description": "Event type"
},
{
"nullable": null,
"types": [
"Function"
],
"spread": false,
"optional": false,
"name": "Handler",
"description": ""
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "capture",
"description": "Specifiy whether the event should be executed in\nthe capturing or in the bubbling phase"
}
],
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 47,
"kind": "variable",
"static": true,
"variation": null,
"name": "removeEvt",
"memberof": "src/event.js",
"longname": "src/event.js~removeEvt",
"access": null,
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{removeEvt}",
"description": "Remove event handler for specified event on passed element",
"lineNumber": 36,
"params": [
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "obj",
"description": "Element"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "type",
"description": "Event type"
},
{
"nullable": null,
"types": [
"Function"
],
"spread": false,
"optional": false,
"name": "Handler",
"description": ""
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "capture",
"description": "Specifiy whether the event should be executed in\nthe capturing or in the bubbling phase"
}
],
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 48,
"kind": "variable",
"static": true,
"variation": null,
"name": "stopEvt",
"memberof": "src/event.js",
"longname": "src/event.js~stopEvt",
"access": null,
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{stopEvt}",
"description": "Prevents further propagation of the current event in the bubbling phase",
"lineNumber": 52,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": "Event on the DOM"
}
],
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 49,
"kind": "variable",
"static": true,
"variation": null,
"name": "cancelEvt",
"memberof": "src/event.js",
"longname": "src/event.js~cancelEvt",
"access": null,
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{cancelEvt}",
"description": "Cancels the event if it is cancelable, without stopping further\npropagation of the event.",
"lineNumber": 69,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": "Event on the DOM"
}
],
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 50,
"kind": "variable",
"static": true,
"variation": null,
"name": "targetEvt",
"memberof": "src/event.js",
"longname": "src/event.js~targetEvt",
"access": null,
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{targetEvt}",
"description": "Reference to the object that dispatched the event",
"lineNumber": 86,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{DOMElement}"
}
],
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": "Event on the DOM"
}
],
"return": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 51,
"kind": "variable",
"static": true,
"variation": null,
"name": "keyCode",
"memberof": "src/event.js",
"longname": "src/event.js~keyCode",
"access": null,
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{keyCode}",
"description": "Returns the Unicode value of pressed key",
"lineNumber": 99,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": "Event on the DOM"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 52,
"kind": "file",
"static": true,
"variation": null,
"name": "src/extensions/advancedGrid/adapterEzEditTable.js",
"memberof": null,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../../feature';\nimport {tag} from '../../dom';\nimport {INPUT} from '../../const';\nimport {root} from '../../root';\n\nconst INSTANTIATION_ERROR = `Failed to instantiate EditTable object.\n \\n\"ezEditTable\" dependency not found.`;\n\nexport default class AdapterEzEditTable extends Feature {\n /**\n * Adapter module for ezEditTable, an external library providing advanced\n * grid features (selection and edition):\n * http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus\n *\n * @param {Object} tf TableFilter instance\n */\n constructor(tf, cfg) {\n super(tf, cfg.name);\n\n // ezEditTable config\n this.initialized = false;\n this.desc = cfg.description || 'ezEditTable adapter';\n this.filename = cfg.filename || 'ezEditTable.js';\n this.vendorPath = cfg.vendor_path;\n this.loadStylesheet = Boolean(cfg.load_stylesheet);\n this.stylesheet = cfg.stylesheet || this.vendorPath + 'ezEditTable.css';\n this.stylesheetName = cfg.stylesheet_name || 'ezEditTableCss';\n\n // Enable the ezEditTable's scroll into view behaviour if grid layout on\n cfg.scroll_into_view = cfg.scroll_into_view === false ?\n false : tf.gridLayout;\n\n this._ezEditTable = null;\n this.cfg = cfg;\n this.enable();\n }\n\n /**\n * Conditionally load ezEditTable library and set advanced grid\n * @return {[type]} [description]\n */\n init() {\n if (this.initialized) {\n return;\n }\n var tf = this.tf;\n if (root.EditTable) {\n this._setAdvancedGrid();\n } else {\n var path = this.vendorPath + this.filename;\n tf.import(this.filename, path, () => this._setAdvancedGrid());\n }\n if (this.loadStylesheet && !tf.isImported(this.stylesheet, 'link')) {\n tf.import(this.stylesheetName, this.stylesheet, null, 'link');\n }\n\n // TODO: hack to prevent ezEditTable enter key event hijaking.\n // Needs to be fixed in the vendor's library\n this.emitter.on(['filter-focus', 'filter-blur'],\n () => this._toggleForInputFilter());\n\n this.initialized = true;\n }\n\n /**\n * Instantiate ezEditTable component for advanced grid features\n * @private\n */\n _setAdvancedGrid() {\n var tf = this.tf;\n\n //start row for EditTable constructor needs to be calculated\n var startRow,\n cfg = this.cfg,\n thead = tag(tf.tbl, 'thead');\n\n //if thead exists and startRow not specified, startRow is calculated\n //automatically by EditTable\n if (thead.length > 0 && !cfg.startRow) {\n startRow = undefined;\n }\n //otherwise startRow config property if any or TableFilter refRow\n else {\n startRow = cfg.startRow || tf.refRow;\n }\n\n cfg.base_path = cfg.base_path || tf.basePath + 'ezEditTable/';\n var editable = cfg.editable;\n var selectable = cfg.selection;\n\n if (selectable) {\n cfg.default_selection = cfg.default_selection || 'row';\n }\n //CSS Styles\n cfg.active_cell_css = cfg.active_cell_css || 'ezETSelectedCell';\n\n var _lastValidRowIndex = 0;\n var _lastRowIndex = 0;\n\n if (selectable) {\n //Row navigation needs to be calculated according to TableFilter's\n //validRowsIndex array\n var onAfterSelection = function (et, selectedElm, e) {\n var slc = et.Selection;\n //Next valid filtered row needs to be selected\n var doSelect = function (nextRowIndex) {\n if (et.defaultSelection === 'row') {\n /* eslint-disable */\n slc.SelectRowByIndex(nextRowIndex);\n /* eslint-enable */\n } else {\n /* eslint-disable */\n et.ClearSelections();\n /* eslint-enable */\n var cellIndex = selectedElm.cellIndex,\n row = tf.tbl.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 var r = tf.tbl.rows[nextRowIndex];\n if (r) {\n r.scrollIntoView(false);\n }\n if (cell) {\n if (cell.cellIndex === (tf.getCellsNb() - 1) &&\n tf.gridLayout) {\n tf.tblCont.scrollLeft = 100000000;\n }\n else if (cell.cellIndex === 0 && tf.gridLayout) {\n tf.tblCont.scrollLeft = 0;\n } else {\n cell.scrollIntoView(false);\n }\n }\n }\n };\n\n //table is not filtered\n if (!tf.validRowsIndex) {\n return;\n }\n var validIndexes = tf.validRowsIndex,\n validIdxLen = validIndexes.length,\n row = et.defaultSelection !== 'row' ?\n selectedElm.parentNode : selectedElm,\n //cell for default_selection = 'both' or 'cell'\n cell = selectedElm.nodeName === 'TD' ? selectedElm : null,\n /* 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.pagingLength || 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 var calcRowIndex = (_lastValidRowIndex + d);\n if (calcRowIndex > (validIdxLen - 1)) {\n nextRowIndex = validIndexes[validIdxLen - 1];\n } else {\n nextRowIndex = validIndexes[calcRowIndex];\n }\n }\n } else {\n //first row\n if (row.rowIndex <= validIndexes[0]) {\n nextRowIndex = validIndexes[0];\n } else {\n var v = validIndexes[_lastValidRowIndex - d];\n nextRowIndex = v ? v : validIndexes[0];\n }\n }\n _lastRowIndex = row.rowIndex;\n doSelect(nextRowIndex);\n } else {\n //If filtered row is valid, special calculation for\n //pgup/pgdown keys\n if (keyCode !== 34 && keyCode !== 33) {\n _lastValidRowIndex = validIndexes.indexOf(row.rowIndex);\n _lastRowIndex = row.rowIndex;\n } else {\n if (keyCode === 34) { //pgdown\n //last row\n if ((_lastValidRowIndex + d) <= (validIdxLen - 1)) {\n nextRowIndex = validIndexes[\n _lastValidRowIndex + d];\n } else {\n nextRowIndex = [validIdxLen - 1];\n }\n } else { //pgup\n //first row\n if ((_lastValidRowIndex - d) <= validIndexes[0]) {\n nextRowIndex = validIndexes[0];\n } else {\n nextRowIndex = validIndexes[\n _lastValidRowIndex - d];\n }\n }\n _lastRowIndex = nextRowIndex;\n _lastValidRowIndex = validIndexes.indexOf(nextRowIndex);\n doSelect(nextRowIndex);\n }\n }\n };\n\n //Page navigation has to be enforced whenever selected row is out of\n //the current page range\n var onBeforeSelection = function (et, selectedElm) {\n var row = et.defaultSelection !== 'row' ?\n selectedElm.parentNode : selectedElm;\n if (tf.paging) {\n if (tf.feature('paging').nbPages > 1) {\n var paging = tf.feature('paging');\n //page length is re-assigned in case it has changed\n et.nbRowsPerPage = paging.pagingLength;\n var validIndexes = tf.validRowsIndex,\n validIdxLen = validIndexes.length,\n pagingEndRow = parseInt(paging.startPagingRow, 10) +\n parseInt(paging.pagingLength, 10);\n var rowIndex = row.rowIndex;\n\n if ((rowIndex === validIndexes[validIdxLen - 1]) &&\n paging.currentPageNb !== paging.nbPages) {\n paging.setPage('last');\n }\n else if ((rowIndex === validIndexes[0]) &&\n paging.currentPageNb !== 1) {\n paging.setPage('first');\n }\n else if (rowIndex > validIndexes[pagingEndRow - 1] &&\n rowIndex < validIndexes[validIdxLen - 1]) {\n paging.setPage('next');\n }\n else if (\n rowIndex < validIndexes[paging.startPagingRow] &&\n rowIndex > validIndexes[0]) {\n paging.setPage('previous');\n }\n }\n }\n };\n\n //Selected row needs to be visible when paging is activated\n if (tf.paging) {\n tf.feature('paging').onAfterChangePage = function (paging) {\n var advGrid = paging.tf.extension('advancedGrid');\n var et = advGrid._ezEditTable;\n var slc = et.Selection;\n /* eslint-disable */\n var row = slc.GetActiveRow();\n /* eslint-enable */\n if (row) {\n row.scrollIntoView(false);\n }\n /* eslint-disable */\n var 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 var fnB = cfg.on_before_selected_row;\n cfg.on_before_selected_row = function () {\n onBeforeSelection(arguments[0], arguments[1], arguments[2]);\n if (fnB) {\n fnB.call(\n null, arguments[0], arguments[1], arguments[2]);\n }\n };\n var fnA = cfg.on_after_selected_row;\n cfg.on_after_selected_row = function () {\n onAfterSelection(arguments[0], arguments[1], arguments[2]);\n if (fnA) {\n fnA.call(\n null, arguments[0], arguments[1], arguments[2]);\n }\n };\n } else {\n var fnD = cfg.on_before_selected_cell;\n cfg.on_before_selected_cell = function () {\n onBeforeSelection(arguments[0], arguments[1], arguments[2]);\n if (fnD) {\n fnD.call(\n null, arguments[0], arguments[1], arguments[2]);\n }\n };\n var fnC = cfg.on_after_selected_cell;\n cfg.on_after_selected_cell = function () {\n onAfterSelection(arguments[0], arguments[1], arguments[2]);\n if (fnC) {\n fnC.call(\n null, arguments[0], arguments[1], arguments[2]);\n }\n };\n }\n }\n if (editable) {\n //Added or removed rows, TF rows number needs to be re-calculated\n var fnE = cfg.on_added_dom_row;\n cfg.on_added_dom_row = function () {\n tf.nbFilterableRows++;\n if (!tf.paging) {\n tf.emitter.emit('rows-changed', tf, this);\n //tf.feature('rowsCounter').refresh();\n } else {\n tf.nbFilterableRows++;\n tf.paging = false;\n tf.feature('paging').destroy();\n tf.feature('paging').reset();\n }\n if (tf.alternateRows) {\n tf.feature('alternateRows').init();\n }\n if (fnE) {\n fnE.call(null, arguments[0], arguments[1], arguments[2]);\n }\n };\n if (cfg.actions && cfg.actions['delete']) {\n var fnF = cfg.actions['delete'].on_after_submit;\n cfg.actions['delete'].on_after_submit = function () {\n tf.nbFilterableRows--;\n if (!tf.paging) {\n // tf.feature('rowsCounter').refresh();\n tf.emitter.emit('rows-changed', tf, this);\n } else {\n tf.nbFilterableRows--;\n tf.paging = false;\n tf.feature('paging').destroy();\n tf.feature('paging').reset(false);\n }\n if (tf.alternateRows) {\n tf.feature('alternateRows').init();\n }\n if (fnF) {\n fnF.call(null, arguments[0], arguments[1]);\n }\n };\n }\n }\n\n try {\n /* 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 var 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 var 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 var tf = this.tf;\n if (!tf.getActiveFilterId()) {\n return;\n }\n var colIndex = tf.getColumnIndexFromFilterId(tf.getActiveFilterId());\n var 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 var 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"
},
{
"__docId__": 53,
"kind": "variable",
"static": true,
"variation": null,
"name": "INSTANTIATION_ERROR",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~INSTANTIATION_ERROR",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/advancedGrid/adapterEzEditTable.js",
"importStyle": null,
"description": null,
"lineNumber": 6,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 54,
"kind": "class",
"static": true,
"variation": null,
"name": "AdapterEzEditTable",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"access": null,
"export": true,
"importPath": "tablefilter/src/extensions/advancedGrid/adapterEzEditTable.js",
"importStyle": "AdapterEzEditTable",
"description": null,
"lineNumber": 9,
"undocument": true,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 55,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#constructor",
"access": null,
"description": "Adapter module for ezEditTable, an external library providing advanced\ngrid features (selection and edition):\nhttp://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus",
"lineNumber": 17,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
],
"generator": false
},
{
"__docId__": 56,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#initialized",
"access": null,
"description": null,
"lineNumber": 21,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 57,
"kind": "member",
"static": false,
"variation": null,
"name": "desc",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#desc",
"access": null,
"description": null,
"lineNumber": 22,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 58,
"kind": "member",
"static": false,
"variation": null,
"name": "filename",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#filename",
"access": null,
"description": null,
"lineNumber": 23,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 59,
"kind": "member",
"static": false,
"variation": null,
"name": "vendorPath",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#vendorPath",
"access": null,
"description": null,
"lineNumber": 24,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 60,
"kind": "member",
"static": false,
"variation": null,
"name": "loadStylesheet",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#loadStylesheet",
"access": null,
"description": null,
"lineNumber": 25,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 61,
"kind": "member",
"static": false,
"variation": null,
"name": "stylesheet",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#stylesheet",
"access": null,
"description": null,
"lineNumber": 26,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 62,
"kind": "member",
"static": false,
"variation": null,
"name": "stylesheetName",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#stylesheetName",
"access": null,
"description": null,
"lineNumber": 27,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 63,
"kind": "member",
"static": false,
"variation": null,
"name": "_ezEditTable",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_ezEditTable",
"access": null,
"description": null,
"lineNumber": 33,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 64,
"kind": "member",
"static": false,
"variation": null,
"name": "cfg",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#cfg",
"access": null,
"description": null,
"lineNumber": 34,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 65,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#init",
"access": null,
"description": "Conditionally load ezEditTable library and set advanced grid",
"lineNumber": 42,
"params": [],
"return": {
"nullable": null,
"types": [
"[type]"
],
"spread": false,
"description": "[description]"
},
"generator": false
},
{
"__docId__": 66,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#initialized",
"access": null,
"description": null,
"lineNumber": 62,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 67,
"kind": "method",
"static": false,
"variation": null,
"name": "_setAdvancedGrid",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_setAdvancedGrid",
"access": "private",
"description": "Instantiate ezEditTable component for advanced grid features",
"lineNumber": 69,
"params": [],
"generator": false
},
{
"__docId__": 68,
"kind": "member",
"static": false,
"variation": null,
"name": "_ezEditTable",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_ezEditTable",
"access": null,
"description": null,
"lineNumber": 369,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 69,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#initialized",
"access": null,
"description": null,
"lineNumber": 374,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 70,
"kind": "method",
"static": false,
"variation": null,
"name": "reset",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#reset",
"access": null,
"description": "Reset advanced grid when previously removed",
"lineNumber": 380,
"params": [],
"generator": false
},
{
"__docId__": 71,
"kind": "method",
"static": false,
"variation": null,
"name": "toggle",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#toggle",
"access": null,
"description": "Toggle behaviour",
"lineNumber": 399,
"params": [],
"generator": false
},
{
"__docId__": 72,
"kind": "method",
"static": false,
"variation": null,
"name": "_toggleForInputFilter",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_toggleForInputFilter",
"access": null,
"description": null,
"lineNumber": 421,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 73,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#destroy",
"access": null,
"description": "Remove advanced grid",
"lineNumber": 436,
"params": [],
"generator": false
},
{
"__docId__": 74,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#initialized",
"access": null,
"description": null,
"lineNumber": 457,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 75,
"kind": "file",
"static": true,
"variation": null,
"name": "src/extensions/advancedGrid/advancedGrid.js",
"memberof": null,
"longname": "src/extensions/advancedGrid/advancedGrid.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import AdapterEzEditTable from './adapterEzEditTable';\n\nexport default AdapterEzEditTable;"
},
{
"__docId__": 76,
"kind": "file",
"static": true,
"variation": null,
"name": "src/extensions/colOps/colOps.js",
"memberof": null,
"longname": "src/extensions/colOps/colOps.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../../feature';\nimport {createText, elm} from '../../dom';\nimport {isArray, isFn, isUndef} from '../../types';\n\nexport default class ColOps extends Feature {\n\n /**\n * Column calculations\n * @param {Object} tf TableFilter instance\n */\n constructor(tf, opts) {\n super(tf, opts.name);\n\n //calls function before col operation\n this.onBeforeOperation = isFn(opts.on_before_operation) ?\n opts.on_before_operation : null;\n //calls function after col operation\n this.onAfterOperation = isFn(opts.on_after_operation) ?\n opts.on_after_operation : null;\n\n this.opts = opts;\n this.enable();\n }\n\n init() {\n if (this.initialized) {\n return;\n }\n // subscribe to events\n this.tf.emitter.on(['after-filtering'], () => this.calc());\n\n this.calc();\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 calc() {\n var tf = this.tf;\n if (!tf.isInitialized()) {\n return;\n }\n\n if (this.onBeforeOperation) {\n this.onBeforeOperation.call(null, tf);\n }\n\n var opts = this.opts,\n labelId = opts.id,\n colIndex = opts.col,\n operation = opts.operation,\n outputType = opts.write_method,\n totRowIndex = opts.tot_row_index,\n excludeRow = opts.exclude_row,\n decimalPrecision = isUndef(opts.decimal_precision) ?\n 2 : opts.decimal_precision;\n\n //nuovella: determine unique list of columns to operate on\n var ucolIndex = [],\n ucolMax = 0;\n ucolIndex[ucolMax] = colIndex[0];\n\n for (var ii = 1; ii < colIndex.length; ii++) {\n var saved = 0;\n //see if colIndex[ii] is already in the list of unique indexes\n for (var jj = 0; jj <= ucolMax; jj++) {\n if (ucolIndex[jj] === colIndex[ii]) {\n saved = 1;\n }\n }\n //if not saved then, save the index;\n if (saved === 0) {\n ucolMax++;\n ucolIndex[ucolMax] = colIndex[ii];\n }\n }\n\n if (isArray(labelId) && isArray(colIndex) && isArray(operation)) {\n var rows = tf.tbl.rows,\n colvalues = [];\n\n for (var ucol = 0; ucol <= ucolMax; ucol++) {\n //this retrieves col values\n //use ucolIndex 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.getColValues(ucolIndex[ucol], false, true, excludeRow));\n\n //next: calculate all operations for this column\n var result,\n nbvalues = 0,\n temp,\n meanValue = 0,\n sumValue = 0,\n minValue = null,\n maxValue = null,\n q1Value = null,\n medValue = null,\n q3Value = null,\n meanFlag = 0,\n sumFlag = 0,\n minFlag = 0,\n maxFlag = 0,\n q1Flag = 0,\n medFlag = 0,\n q3Flag = 0,\n theList = [],\n opsThisCol = [],\n decThisCol = [],\n labThisCol = [],\n oTypeThisCol = [],\n mThisCol = -1;\n\n for (var k = 0; k < colIndex.length; k++) {\n if (colIndex[k] === ucolIndex[ucol]) {\n mThisCol++;\n opsThisCol[mThisCol] = operation[k].toLowerCase();\n decThisCol[mThisCol] = decimalPrecision[k];\n labThisCol[mThisCol] = labelId[k];\n oTypeThisCol = isArray(outputType) ?\n outputType[k] : null;\n\n switch (opsThisCol[mThisCol]) {\n case 'mean':\n meanFlag = 1;\n break;\n case 'sum':\n sumFlag = 1;\n break;\n case 'min':\n minFlag = 1;\n break;\n case 'max':\n maxFlag = 1;\n break;\n case 'median':\n medFlag = 1;\n break;\n case 'q1':\n q1Flag = 1;\n break;\n case 'q3':\n q3Flag = 1;\n break;\n }\n }\n }\n\n for (var j = 0; j < colvalues[ucol].length; j++) {\n //sort the list for calculation of median and quartiles\n if ((q1Flag === 1) || (q3Flag === 1) || (medFlag === 1)) {\n if (j < colvalues[ucol].length - 1) {\n for (k = j + 1; k < colvalues[ucol].length; k++) {\n /* eslint-disable */\n if (eval(colvalues[ucol][k]) <\n eval(colvalues[ucol][j])) {\n /* eslint-enable */\n temp = colvalues[ucol][j];\n colvalues[ucol][j] = colvalues[ucol][k];\n colvalues[ucol][k] = temp;\n }\n }\n }\n }\n var cvalue = parseFloat(colvalues[ucol][j]);\n theList[j] = parseFloat(cvalue);\n\n if (!isNaN(cvalue)) {\n nbvalues++;\n if (sumFlag === 1 || meanFlag === 1) {\n sumValue += parseFloat(cvalue);\n }\n if (minFlag === 1) {\n if (minValue === null) {\n minValue = parseFloat(cvalue);\n } else {\n minValue = parseFloat(cvalue) < minValue ?\n parseFloat(cvalue) : minValue;\n }\n }\n if (maxFlag === 1) {\n if (maxValue === null) {\n maxValue = parseFloat(cvalue);\n } else {\n maxValue = parseFloat(cvalue) > maxValue ?\n parseFloat(cvalue) : maxValue;\n }\n }\n }\n }//for j\n if (meanFlag === 1) {\n meanValue = sumValue / nbvalues;\n }\n if (medFlag === 1) {\n var aux = 0;\n if (nbvalues % 2 === 1) {\n aux = Math.floor(nbvalues / 2);\n medValue = theList[aux];\n } else {\n medValue = (theList[nbvalues / 2] +\n theList[((nbvalues / 2) - 1)]) / 2;\n }\n }\n var posa;\n if (q1Flag === 1) {\n posa = 0.0;\n posa = Math.floor(nbvalues / 4);\n if (4 * posa === nbvalues) {\n q1Value = (theList[posa - 1] + theList[posa]) / 2;\n } else {\n q1Value = theList[posa];\n }\n }\n if (q3Flag === 1) {\n posa = 0.0;\n var posb = 0.0;\n posa = Math.floor(nbvalues / 4);\n if (4 * posa === nbvalues) {\n posb = 3 * posa;\n q3Value = (theList[posb] + theList[posb - 1]) / 2;\n } else {\n q3Value = theList[nbvalues - posa - 1];\n }\n }\n\n for (var i = 0; i <= mThisCol; i++) {\n switch (opsThisCol[i]) {\n case 'mean':\n result = meanValue;\n break;\n case 'sum':\n result = sumValue;\n break;\n case 'min':\n result = minValue;\n break;\n case 'max':\n result = maxValue;\n break;\n case 'median':\n result = medValue;\n break;\n case 'q1':\n result = q1Value;\n break;\n case 'q3':\n result = q3Value;\n break;\n }\n\n var precision = !isNaN(decThisCol[i]) ? decThisCol[i] : 2;\n\n //if outputType is defined\n if (oTypeThisCol && result) {\n result = result.toFixed(precision);\n\n if (elm(labThisCol[i])) {\n switch (oTypeThisCol.toLowerCase()) {\n case 'innerhtml':\n if (isNaN(result) || !isFinite(result) ||\n nbvalues === 0) {\n elm(labThisCol[i]).innerHTML = '.';\n } else {\n elm(labThisCol[i]).innerHTML = result;\n }\n break;\n case 'setvalue':\n elm(labThisCol[i]).value = result;\n break;\n case 'createtextnode':\n var oldnode =\n elm(labThisCol[i]).firstChild;\n var txtnode = createText(result);\n elm(labThisCol[i])\n .replaceChild(txtnode, oldnode);\n break;\n }//switch\n }\n } else {\n try {\n if (isNaN(result) || !isFinite(result) ||\n nbvalues === 0) {\n elm(labThisCol[i]).innerHTML = '.';\n } else {\n elm(labThisCol[i]).innerHTML =\n result.toFixed(precision);\n }\n } catch (e) { }//catch\n }//else\n }//for i\n\n // row(s) with result are always visible\n var totRow = totRowIndex && totRowIndex[ucol] ?\n rows[totRowIndex[ucol]] : null;\n if (totRow) {\n totRow.style.display = '';\n }\n }//for ucol\n }//if typeof\n\n if (this.onAfterOperation) {\n this.onAfterOperation.call(null, tf);\n }\n }\n\n destroy() {\n if (!this.initialized) {\n return;\n }\n // unsubscribe to events\n this.tf.emitter.off(['after-filtering'], () => this.calc());\n this.initialized = false;\n }\n\n}\n"
},
{
"__docId__": 77,
"kind": "class",
"static": true,
"variation": null,
"name": "ColOps",
"memberof": "src/extensions/colOps/colOps.js",
"longname": "src/extensions/colOps/colOps.js~ColOps",
"access": null,
"export": true,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": "ColOps",
"description": null,
"lineNumber": 5,
"undocument": true,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 78,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"longname": "src/extensions/colOps/colOps.js~ColOps#constructor",
"access": null,
"description": "Column calculations",
"lineNumber": 11,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
],
"generator": false
},
{
"__docId__": 79,
"kind": "member",
"static": false,
"variation": null,
"name": "onBeforeOperation",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"longname": "src/extensions/colOps/colOps.js~ColOps#onBeforeOperation",
"access": null,
"description": null,
"lineNumber": 15,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 80,
"kind": "member",
"static": false,
"variation": null,
"name": "onAfterOperation",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"longname": "src/extensions/colOps/colOps.js~ColOps#onAfterOperation",
"access": null,
"description": null,
"lineNumber": 18,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 81,
"kind": "member",
"static": false,
"variation": null,
"name": "opts",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"longname": "src/extensions/colOps/colOps.js~ColOps#opts",
"access": null,
"description": null,
"lineNumber": 21,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 82,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"longname": "src/extensions/colOps/colOps.js~ColOps#init",
"access": null,
"description": null,
"lineNumber": 25,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 83,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"longname": "src/extensions/colOps/colOps.js~ColOps#initialized",
"access": null,
"description": null,
"lineNumber": 33,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 84,
"kind": "method",
"static": false,
"variation": null,
"name": "calc",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"longname": "src/extensions/colOps/colOps.js~ColOps#calc",
"access": null,
"description": "Calculates columns' values\nConfiguration options are stored in 'opts' property\n- 'id' contains ids of elements showing result (array)\n- 'col' contains the columns' indexes (array)\n- 'operation' contains operation type (array, values: 'sum', 'mean',\n 'min', 'max', 'median', 'q1', 'q3')\n- 'write_method' array defines which method to use for displaying the\n result (innerHTML, setValue, createTextNode) - default: 'innerHTML'\n- 'tot_row_index' defines in which row results are displayed\n (integers array)\n\n- changes made by Nuovella:\n(1) optimized the routine (now it will only process each column once),\n(2) added calculations for the median, lower and upper quartile.",
"lineNumber": 52,
"params": [],
"generator": false
},
{
"__docId__": 85,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"longname": "src/extensions/colOps/colOps.js~ColOps#destroy",
"access": null,
"description": null,
"lineNumber": 320,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 86,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"longname": "src/extensions/colOps/colOps.js~ColOps#initialized",
"access": null,
"description": null,
"lineNumber": 326,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 87,
"kind": "file",
"static": true,
"variation": null,
"name": "src/extensions/colsVisibility/colsVisibility.js",
"memberof": null,
"longname": "src/extensions/colsVisibility/colsVisibility.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../../feature';\nimport {\n addClass, removeClass, createCheckItem, createElm, elm, removeElm,\n getText, tag\n} from '../../dom';\nimport {isFn} from '../../types';\nimport {addEvt, targetEvt} from '../../event';\n\nexport default class ColsVisibility extends Feature {\n\n /**\n * Columns Visibility extension\n * @param {Object} tf TableFilter instance\n * @param {Object} f Extension's configuration\n */\n constructor(tf, f) {\n super(tf, f.name);\n\n // Configuration object\n let cfg = tf.config();\n\n this.initialized = false;\n this.name = f.name;\n this.desc = f.description || 'Columns visibility manager';\n\n //show/hide cols span element\n this.spanEl = null;\n //show/hide cols button element\n this.btnEl = null;\n //show/hide cols container div element\n this.contEl = null;\n\n //tick to hide or show column\n this.tickToHide = f.tick_to_hide === false ? false : true;\n //enables/disables cols manager generation\n this.manager = f.manager === false ? false : true;\n //only if external headers\n this.headersTbl = f.headers_table || false;\n //only if external headers\n this.headersIndex = f.headers_index || 1;\n //id of container element\n this.contElTgtId = f.container_target_id || null;\n //alternative headers text\n this.headersText = f.headers_text || null;\n //id of button container element\n this.btnTgtId = f.btn_target_id || null;\n //defines show/hide cols text\n this.btnText = f.btn_text || 'Columns▼';\n //defines show/hide cols button innerHtml\n this.btnHtml = f.btn_html || null;\n //defines css class for show/hide cols button\n this.btnCssClass = f.btn_css_class || 'colVis';\n //defines close link text\n this.btnCloseText = f.btn_close_text || 'Close';\n //defines close button innerHtml\n this.btnCloseHtml = f.btn_close_html || null;\n //defines css class for close button\n this.btnCloseCssClass = f.btn_close_css_class || this.btnCssClass;\n this.stylesheet = f.stylesheet || 'colsVisibility.css';\n //span containing show/hide cols button\n this.prfx = 'colVis_';\n //defines css class span containing show/hide cols\n this.spanCssClass = f.span_css_class || 'colVisSpan';\n this.prfxCont = this.prfx + 'Cont_';\n //defines css class div containing show/hide cols\n this.contCssClass = f.cont_css_class || 'colVisCont';\n //defines css class for cols list (ul)\n this.listCssClass = cfg.list_css_class || 'cols_checklist';\n //defines css class for list item (li)\n this.listItemCssClass = cfg.checklist_item_css_class ||\n 'cols_checklist_item';\n //defines css class for selected list item (li)\n this.listSlcItemCssClass = cfg.checklist_selected_item_css_class ||\n 'cols_checklist_slc_item';\n //text preceding columns list\n this.text = f.text || (this.tickToHide ? 'Hide: ' : 'Show: ');\n this.atStart = f.at_start || null;\n this.enableHover = Boolean(f.enable_hover);\n //enables select all option\n this.enableTickAll = Boolean(f.enable_tick_all);\n //text preceding columns list\n this.tickAllText = f.tick_all_text || 'Select all:';\n\n //array containing hidden columns indexes\n this.hiddenCols = [];\n this.tblHasColTag = tag(tf.tbl, 'col').length > 0;\n\n //callback invoked just after cols manager is loaded\n this.onLoaded = isFn(f.on_loaded) ? f.on_loaded : null;\n //calls function before cols manager is opened\n this.onBeforeOpen = isFn(f.on_before_open) ? f.on_before_open : null;\n //calls function after cols manager is opened\n this.onAfterOpen = isFn(f.on_after_open) ? f.on_after_open : null;\n //calls function before cols manager is closed\n this.onBeforeClose = isFn(f.on_before_close) ? f.on_before_close : null;\n //calls function after cols manager is closed\n this.onAfterClose = isFn(f.on_after_close) ? f.on_after_close : null;\n\n //callback before col is hidden\n this.onBeforeColHidden = isFn(f.on_before_col_hidden) ?\n f.on_before_col_hidden : null;\n //callback after col is hidden\n this.onAfterColHidden = isFn(f.on_after_col_hidden) ?\n f.on_after_col_hidden : null;\n //callback before col is displayed\n this.onBeforeColDisplayed = isFn(f.on_before_col_displayed) ?\n f.on_before_col_displayed : null;\n //callback after col is displayed\n this.onAfterColDisplayed = isFn(f.on_after_col_displayed) ?\n f.on_after_col_displayed : null;\n\n //Grid layout compatibility\n if (tf.gridLayout) {\n this.headersTbl = tf.feature('gridLayout').headTbl; //headers table\n this.headersIndex = 0; //headers index\n this.onAfterColDisplayed = function () { };\n this.onAfterColHidden = function () { };\n }\n\n //Loads extension stylesheet\n tf.import(f.name + 'Style', tf.stylePath + this.stylesheet, null,\n 'link');\n\n this.enable();\n }\n\n toggle() {\n let contDisplay = this.contEl.style.display;\n let onBeforeOpen = this.onBeforeOpen;\n let onBeforeClose = this.onBeforeClose;\n let onAfterOpen = this.onAfterOpen;\n let onAfterClose = this.onAfterClose;\n\n if (onBeforeOpen && contDisplay !== 'inline') {\n onBeforeOpen.call(null, this);\n }\n if (onBeforeClose && contDisplay === 'inline') {\n onBeforeClose.call(null, this);\n }\n\n this.contEl.style.display = contDisplay === 'inline' ?\n 'none' : 'inline';\n\n if (onAfterOpen && contDisplay !== 'inline') {\n onAfterOpen.call(null, this);\n }\n if (onAfterClose && contDisplay === 'inline') {\n onAfterClose.call(null, this);\n }\n }\n\n checkItem(lbl) {\n 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 init() {\n if (this.initialized || !this.manager) {\n return;\n }\n\n this.emitter.on(['hide-column'],\n (tf, colIndex) => this.hideCol(colIndex));\n\n this.buildBtn();\n this.buildManager();\n\n this.initialized = true;\n this.emitter.emit('columns-visibility-initialized', this.tf, this);\n\n // Hide columns at start at very end of initialization\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', ['id', this.prfx + tf.id]);\n span.className = this.spanCssClass;\n\n //Container element (rdiv or custom element)\n if (!this.btnTgtId) {\n tf.setToolbar();\n }\n let targetEl = !this.btnTgtId ? tf.rDiv : 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 if (this.onLoaded) {\n this.onLoaded.call(null, this);\n }\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', ['id', this.prfxCont + tf.id]) :\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', ['id', 'ul' + this.name + '_' + tf.id]);\n ul.className = this.listCssClass;\n\n let tbl = this.headersTbl ? this.headersTbl : tf.tbl;\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 && this.headersText[i] ?\n 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 {Numner} 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.tbl;\n\n if (this.onBeforeColHidden && hide) {\n this.onBeforeColHidden.call(null, this, colIndex);\n }\n if (this.onBeforeColDisplayed && !hide) {\n this.onBeforeColDisplayed.call(null, this, colIndex);\n }\n\n this._hideCells(tbl, colIndex, hide);\n if (this.headersTbl) {\n this._hideCells(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 let gridLayout;\n let headTbl;\n let gridColElms;\n if (hide) {\n //This event is fired just after a column is displayed for\n //grid_layout support\n //TODO: grid layout module should be responsible for those\n //calculations\n if (tf.gridLayout) {\n gridLayout = tf.feature('gridLayout');\n headTbl = gridLayout.headTbl;\n gridColElms = gridLayout.colElms;\n let hiddenWidth = parseInt(\n gridColElms[colIndex].style.width, 10);\n\n let headTblW = parseInt(headTbl.style.width, 10);\n headTbl.style.width = headTblW - hiddenWidth + 'px';\n tbl.style.width = headTbl.style.width;\n }\n if (this.onAfterColHidden) {\n this.onAfterColHidden.call(null, this, colIndex);\n }\n this.emitter.emit('column-hidden', tf, this, colIndex,\n this.hiddenCols);\n }\n\n if (!hide) {\n //This event is fired just after a column is displayed for\n //grid_layout support\n //TODO: grid layout module should be responsible for those\n //calculations\n if (tf.gridLayout) {\n gridLayout = tf.feature('gridLayout');\n headTbl = gridLayout.headTbl;\n gridColElms = gridLayout.colElms;\n let width = parseInt(gridColElms[colIndex].style.width, 10);\n headTbl.style.width =\n (parseInt(headTbl.style.width, 10) + width) + 'px';\n tf.tbl.style.width = headTbl.style.width;\n }\n if (this.onAfterColDisplayed) {\n this.onAfterColDisplayed.call(null, this, colIndex);\n }\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 (colIndex === undefined || !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 (colIndex === undefined || 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 (colIndex === undefined || 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.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 _hideCells(tbl, colIndex, hide) {\n for (let i = 0; i < tbl.rows.length; i++) {\n let row = tbl.rows[i];\n let cell = row.cells[colIndex];\n if (cell) {\n cell.style.display = hide ? 'none' : '';\n }\n }\n }\n\n _hideAtStart() {\n if (!this.atStart) {\n return;\n }\n this.atStart.forEach((colIdx) => {\n this.hideCol(colIdx);\n });\n }\n}\n"
},
{
"__docId__": 88,
"kind": "class",
"static": true,
"variation": null,
"name": "ColsVisibility",
"memberof": "src/extensions/colsVisibility/colsVisibility.js",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"access": null,
"export": true,
"importPath": "tablefilter/src/extensions/colsVisibility/colsVisibility.js",
"importStyle": "ColsVisibility",
"description": null,
"lineNumber": 9,
"undocument": true,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 89,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#constructor",
"access": null,
"description": "Columns Visibility extension",
"lineNumber": 16,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "f",
"description": "Extension's configuration"
}
],
"generator": false
},
{
"__docId__": 90,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#initialized",
"access": null,
"description": null,
"lineNumber": 22,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 91,
"kind": "member",
"static": false,
"variation": null,
"name": "name",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#name",
"access": null,
"description": null,
"lineNumber": 23,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 92,
"kind": "member",
"static": false,
"variation": null,
"name": "desc",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#desc",
"access": null,
"description": null,
"lineNumber": 24,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 93,
"kind": "member",
"static": false,
"variation": null,
"name": "spanEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#spanEl",
"access": null,
"description": null,
"lineNumber": 27,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 94,
"kind": "member",
"static": false,
"variation": null,
"name": "btnEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnEl",
"access": null,
"description": null,
"lineNumber": 29,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 95,
"kind": "member",
"static": false,
"variation": null,
"name": "contEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contEl",
"access": null,
"description": null,
"lineNumber": 31,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 96,
"kind": "member",
"static": false,
"variation": null,
"name": "tickToHide",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#tickToHide",
"access": null,
"description": null,
"lineNumber": 34,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 97,
"kind": "member",
"static": false,
"variation": null,
"name": "manager",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#manager",
"access": null,
"description": null,
"lineNumber": 36,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 98,
"kind": "member",
"static": false,
"variation": null,
"name": "headersTbl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#headersTbl",
"access": null,
"description": null,
"lineNumber": 38,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 99,
"kind": "member",
"static": false,
"variation": null,
"name": "headersIndex",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#headersIndex",
"access": null,
"description": null,
"lineNumber": 40,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 100,
"kind": "member",
"static": false,
"variation": null,
"name": "contElTgtId",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contElTgtId",
"access": null,
"description": null,
"lineNumber": 42,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 101,
"kind": "member",
"static": false,
"variation": null,
"name": "headersText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#headersText",
"access": null,
"description": null,
"lineNumber": 44,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 102,
"kind": "member",
"static": false,
"variation": null,
"name": "btnTgtId",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnTgtId",
"access": null,
"description": null,
"lineNumber": 46,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 103,
"kind": "member",
"static": false,
"variation": null,
"name": "btnText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnText",
"access": null,
"description": null,
"lineNumber": 48,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 104,
"kind": "member",
"static": false,
"variation": null,
"name": "btnHtml",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnHtml",
"access": null,
"description": null,
"lineNumber": 50,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 105,
"kind": "member",
"static": false,
"variation": null,
"name": "btnCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnCssClass",
"access": null,
"description": null,
"lineNumber": 52,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 106,
"kind": "member",
"static": false,
"variation": null,
"name": "btnCloseText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnCloseText",
"access": null,
"description": null,
"lineNumber": 54,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 107,
"kind": "member",
"static": false,
"variation": null,
"name": "btnCloseHtml",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnCloseHtml",
"access": null,
"description": null,
"lineNumber": 56,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 108,
"kind": "member",
"static": false,
"variation": null,
"name": "btnCloseCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnCloseCssClass",
"access": null,
"description": null,
"lineNumber": 58,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 109,
"kind": "member",
"static": false,
"variation": null,
"name": "stylesheet",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#stylesheet",
"access": null,
"description": null,
"lineNumber": 59,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 110,
"kind": "member",
"static": false,
"variation": null,
"name": "prfx",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#prfx",
"access": null,
"description": null,
"lineNumber": 61,
"undocument": true,
"type": {
"types": [
"string"
]
}
},
{
"__docId__": 111,
"kind": "member",
"static": false,
"variation": null,
"name": "spanCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#spanCssClass",
"access": null,
"description": null,
"lineNumber": 63,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 112,
"kind": "member",
"static": false,
"variation": null,
"name": "prfxCont",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#prfxCont",
"access": null,
"description": null,
"lineNumber": 64,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 113,
"kind": "member",
"static": false,
"variation": null,
"name": "contCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contCssClass",
"access": null,
"description": null,
"lineNumber": 66,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 114,
"kind": "member",
"static": false,
"variation": null,
"name": "listCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#listCssClass",
"access": null,
"description": null,
"lineNumber": 68,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 115,
"kind": "member",
"static": false,
"variation": null,
"name": "listItemCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#listItemCssClass",
"access": null,
"description": null,
"lineNumber": 70,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 116,
"kind": "member",
"static": false,
"variation": null,
"name": "listSlcItemCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#listSlcItemCssClass",
"access": null,
"description": null,
"lineNumber": 73,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 117,
"kind": "member",
"static": false,
"variation": null,
"name": "text",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#text",
"access": null,
"description": null,
"lineNumber": 76,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 118,
"kind": "member",
"static": false,
"variation": null,
"name": "atStart",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#atStart",
"access": null,
"description": null,
"lineNumber": 77,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 119,
"kind": "member",
"static": false,
"variation": null,
"name": "enableHover",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#enableHover",
"access": null,
"description": null,
"lineNumber": 78,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 120,
"kind": "member",
"static": false,
"variation": null,
"name": "enableTickAll",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#enableTickAll",
"access": null,
"description": null,
"lineNumber": 80,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 121,
"kind": "member",
"static": false,
"variation": null,
"name": "tickAllText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#tickAllText",
"access": null,
"description": null,
"lineNumber": 82,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 122,
"kind": "member",
"static": false,
"variation": null,
"name": "hiddenCols",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#hiddenCols",
"access": null,
"description": null,
"lineNumber": 85,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 123,
"kind": "member",
"static": false,
"variation": null,
"name": "tblHasColTag",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#tblHasColTag",
"access": null,
"description": null,
"lineNumber": 86,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 124,
"kind": "member",
"static": false,
"variation": null,
"name": "onLoaded",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onLoaded",
"access": null,
"description": null,
"lineNumber": 89,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 125,
"kind": "member",
"static": false,
"variation": null,
"name": "onBeforeOpen",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onBeforeOpen",
"access": null,
"description": null,
"lineNumber": 91,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 126,
"kind": "member",
"static": false,
"variation": null,
"name": "onAfterOpen",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onAfterOpen",
"access": null,
"description": null,
"lineNumber": 93,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 127,
"kind": "member",
"static": false,
"variation": null,
"name": "onBeforeClose",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onBeforeClose",
"access": null,
"description": null,
"lineNumber": 95,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 128,
"kind": "member",
"static": false,
"variation": null,
"name": "onAfterClose",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onAfterClose",
"access": null,
"description": null,
"lineNumber": 97,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 129,
"kind": "member",
"static": false,
"variation": null,
"name": "onBeforeColHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onBeforeColHidden",
"access": null,
"description": null,
"lineNumber": 100,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 130,
"kind": "member",
"static": false,
"variation": null,
"name": "onAfterColHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onAfterColHidden",
"access": null,
"description": null,
"lineNumber": 103,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 131,
"kind": "member",
"static": false,
"variation": null,
"name": "onBeforeColDisplayed",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onBeforeColDisplayed",
"access": null,
"description": null,
"lineNumber": 106,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 132,
"kind": "member",
"static": false,
"variation": null,
"name": "onAfterColDisplayed",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onAfterColDisplayed",
"access": null,
"description": null,
"lineNumber": 109,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 133,
"kind": "member",
"static": false,
"variation": null,
"name": "headersTbl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#headersTbl",
"access": null,
"description": null,
"lineNumber": 114,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 134,
"kind": "member",
"static": false,
"variation": null,
"name": "headersIndex",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#headersIndex",
"access": null,
"description": null,
"lineNumber": 115,
"undocument": true,
"type": {
"types": [
"number"
]
}
},
{
"__docId__": 135,
"kind": "method",
"static": false,
"variation": null,
"name": "toggle",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#toggle",
"access": null,
"description": null,
"lineNumber": 127,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 136,
"kind": "method",
"static": false,
"variation": null,
"name": "checkItem",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#checkItem",
"access": null,
"description": null,
"lineNumber": 152,
"undocument": true,
"params": [
{
"name": "lbl",
"types": [
"*"
]
}
],
"generator": false
},
{
"__docId__": 137,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#init",
"access": null,
"description": null,
"lineNumber": 174,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 138,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#initialized",
"access": null,
"description": null,
"lineNumber": 185,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 139,
"kind": "method",
"static": false,
"variation": null,
"name": "buildBtn",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#buildBtn",
"access": null,
"description": "Build main button UI",
"lineNumber": 195,
"params": [],
"generator": false
},
{
"__docId__": 140,
"kind": "member",
"static": false,
"variation": null,
"name": "spanEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#spanEl",
"access": null,
"description": null,
"lineNumber": 238,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 141,
"kind": "member",
"static": false,
"variation": null,
"name": "btnEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnEl",
"access": null,
"description": null,
"lineNumber": 239,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 142,
"kind": "method",
"static": false,
"variation": null,
"name": "buildManager",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#buildManager",
"access": null,
"description": "Build columns manager UI",
"lineNumber": 249,
"params": [],
"generator": false
},
{
"__docId__": 143,
"kind": "member",
"static": false,
"variation": null,
"name": "contEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contEl",
"access": null,
"description": null,
"lineNumber": 332,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 144,
"kind": "method",
"static": false,
"variation": null,
"name": "setHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#setHidden",
"access": null,
"description": "Hide or show specified columns",
"lineNumber": 340,
"params": [
{
"nullable": null,
"types": [
"Numner"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "hide",
"description": "Hide column if true or show if false"
}
],
"generator": false
},
{
"__docId__": 145,
"kind": "method",
"static": false,
"variation": null,
"name": "showCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#showCol",
"access": null,
"description": "Show specified column",
"lineNumber": 420,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"generator": false
},
{
"__docId__": 146,
"kind": "method",
"static": false,
"variation": null,
"name": "hideCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#hideCol",
"access": null,
"description": "Hide specified column",
"lineNumber": 438,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"generator": false
},
{
"__docId__": 147,
"kind": "method",
"static": false,
"variation": null,
"name": "isColHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#isColHidden",
"access": null,
"description": "Determine if specified column is hidden",
"lineNumber": 456,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"return": {
"types": [
"boolean"
]
},
"generator": false
},
{
"__docId__": 148,
"kind": "method",
"static": false,
"variation": null,
"name": "toggleCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#toggleCol",
"access": null,
"description": "Toggle visibility of specified column",
"lineNumber": 467,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"generator": false
},
{
"__docId__": 149,
"kind": "method",
"static": false,
"variation": null,
"name": "getHiddenCols",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#getHiddenCols",
"access": null,
"description": "Return the indexes of the columns currently hidden",
"lineNumber": 479,
"params": [],
"return": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": "column indexes"
},
"generator": false
},
{
"__docId__": 150,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#destroy",
"access": null,
"description": "Remove the columns manager",
"lineNumber": 486,
"params": [],
"generator": false
},
{
"__docId__": 151,
"kind": "member",
"static": false,
"variation": null,
"name": "contEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contEl",
"access": null,
"description": null,
"lineNumber": 495,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 152,
"kind": "member",
"static": false,
"variation": null,
"name": "btnEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnEl",
"access": null,
"description": null,
"lineNumber": 499,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 153,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#initialized",
"access": null,
"description": null,
"lineNumber": 504,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 154,
"kind": "method",
"static": false,
"variation": null,
"name": "_getHeaderText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_getHeaderText",
"access": null,
"description": null,
"lineNumber": 507,
"undocument": true,
"params": [
{
"name": "cell",
"types": [
"*"
]
}
],
"return": {
"types": [
"string"
]
},
"generator": false
},
{
"__docId__": 155,
"kind": "method",
"static": false,
"variation": null,
"name": "_hideCells",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideCells",
"access": null,
"description": null,
"lineNumber": 528,
"undocument": true,
"params": [
{
"name": "tbl",
"types": [
"*"
]
},
{
"name": "colIndex",
"types": [
"*"
]
},
{
"name": "hide",
"types": [
"*"
]
}
],
"generator": false
},
{
"__docId__": 156,
"kind": "method",
"static": false,
"variation": null,
"name": "_hideAtStart",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideAtStart",
"access": null,
"description": null,
"lineNumber": 538,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 157,
"kind": "file",
"static": true,
"variation": null,
"name": "src/extensions/filtersVisibility/filtersVisibility.js",
"memberof": null,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../../feature';\nimport {createElm, removeElm, elm} from '../../dom';\nimport {isFn, isUndef} from '../../types';\nimport {addEvt} from '../../event';\n\nexport default class FiltersVisibility extends Feature {\n\n /**\n * Filters Row Visibility extension\n * @param {Object} tf TableFilter instance\n * @param {Object} f Config\n */\n constructor(tf, f) {\n super(tf, f.name);\n\n this.name = f.name;\n this.desc = f.description || 'Filters row visibility manager';\n\n // Path and image filenames\n this.stylesheet = f.stylesheet || 'filtersVisibility.css';\n this.icnExpand = f.expand_icon_name || 'icn_exp.png';\n this.icnCollapse = f.collapse_icon_name || 'icn_clp.png';\n\n //expand/collapse filters span element\n this.contEl = null;\n //expand/collapse filters btn element\n this.btnEl = null;\n\n this.icnExpandHtml = '';\n this.icnCollapseHtml = '
';\n this.defaultText = 'Toggle filters';\n\n //id of container element\n this.targetId = f.target_id || null;\n //enables/disables expand/collapse icon\n this.enableIcon = f.enable_icon === false ? false : true;\n this.btnText = f.btn_text || '';\n\n //defines expand/collapse filters text\n this.collapseBtnHtml = this.enableIcon ?\n this.icnCollapseHtml + this.btnText :\n this.btnText || this.defaultText;\n this.expandBtnHtml = this.enableIcon ?\n this.icnExpandHtml + this.btnText :\n this.btnText || this.defaultText;\n\n //defines expand/collapse filters button innerHtml\n this.btnHtml = f.btn_html || null;\n //defines css class for expand/collapse filters button\n this.btnCssClass = f.btn_css_class || 'btnExpClpFlt';\n //defines css class span containing expand/collapse filters\n this.contCssClass = f.cont_css_class || 'expClpFlt';\n this.filtersRowIndex = !isUndef(f.filters_row_index) ?\n f.filters_row_index : tf.getFiltersRowIndex();\n\n this.visibleAtStart = !isUndef(f.visible_at_start) ?\n Boolean(f.visible_at_start) : true;\n\n // Prefix\n this.prfx = 'fltsVis_';\n\n //callback before filters row is shown\n this.onBeforeShow = isFn(f.on_before_show) ? f.on_before_show : null;\n //callback after filters row is shown\n this.onAfterShow = isFn(f.on_after_show) ? f.on_after_show : null;\n //callback before filters row is hidden\n this.onBeforeHide = isFn(f.on_before_hide) ? f.on_before_hide : null;\n //callback after filters row is hidden\n this.onAfterHide = isFn(f.on_after_hide) ? f.on_after_hide : null;\n\n //Loads extension stylesheet\n tf.import(f.name + 'Style', tf.stylePath + this.stylesheet, null,\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.buildUI();\n this.initialized = true;\n this.emitter.on(['show-filters'], (tf, visible) => this.show(visible));\n this.emitter.emit('filters-visibility-initialized', this.tf, this);\n }\n\n /**\n * Build UI elements\n */\n buildUI() {\n let tf = this.tf;\n let span = createElm('span', ['id', this.prfx + tf.id]);\n span.className = this.contCssClass;\n\n //Container element (rdiv or custom element)\n if (!this.targetId) {\n tf.setToolbar();\n }\n let targetEl = !this.targetId ? tf.rDiv : 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.tbl;\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.tbl;\n let fltRow = tbl.rows[this.filtersRowIndex];\n\n if (this.onBeforeShow && visible) {\n this.onBeforeShow.call(this, this);\n }\n if (this.onBeforeHide && !visible) {\n this.onBeforeHide.call(null, 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 (this.onAfterShow && visible) {\n this.onAfterShow.call(null, this);\n }\n if (this.onAfterHide && !visible) {\n this.onAfterHide.call(null, 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"
},
{
"__docId__": 158,
"kind": "class",
"static": true,
"variation": null,
"name": "FiltersVisibility",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"access": null,
"export": true,
"importPath": "tablefilter/src/extensions/filtersVisibility/filtersVisibility.js",
"importStyle": "FiltersVisibility",
"description": null,
"lineNumber": 6,
"undocument": true,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 159,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#constructor",
"access": null,
"description": "Filters Row Visibility extension",
"lineNumber": 13,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "f",
"description": "Config"
}
],
"generator": false
},
{
"__docId__": 160,
"kind": "member",
"static": false,
"variation": null,
"name": "name",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#name",
"access": null,
"description": null,
"lineNumber": 16,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 161,
"kind": "member",
"static": false,
"variation": null,
"name": "desc",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#desc",
"access": null,
"description": null,
"lineNumber": 17,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 162,
"kind": "member",
"static": false,
"variation": null,
"name": "stylesheet",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#stylesheet",
"access": null,
"description": null,
"lineNumber": 20,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 163,
"kind": "member",
"static": false,
"variation": null,
"name": "icnExpand",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpand",
"access": null,
"description": null,
"lineNumber": 21,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 164,
"kind": "member",
"static": false,
"variation": null,
"name": "icnCollapse",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapse",
"access": null,
"description": null,
"lineNumber": 22,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 165,
"kind": "member",
"static": false,
"variation": null,
"name": "contEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contEl",
"access": null,
"description": null,
"lineNumber": 25,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 166,
"kind": "member",
"static": false,
"variation": null,
"name": "btnEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl",
"access": null,
"description": null,
"lineNumber": 27,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 167,
"kind": "member",
"static": false,
"variation": null,
"name": "icnExpandHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpandHtml",
"access": null,
"description": null,
"lineNumber": 29,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 168,
"kind": "member",
"static": false,
"variation": null,
"name": "icnCollapseHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapseHtml",
"access": null,
"description": null,
"lineNumber": 31,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 169,
"kind": "member",
"static": false,
"variation": null,
"name": "defaultText",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#defaultText",
"access": null,
"description": null,
"lineNumber": 33,
"undocument": true,
"type": {
"types": [
"string"
]
}
},
{
"__docId__": 170,
"kind": "member",
"static": false,
"variation": null,
"name": "targetId",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#targetId",
"access": null,
"description": null,
"lineNumber": 36,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 171,
"kind": "member",
"static": false,
"variation": null,
"name": "enableIcon",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#enableIcon",
"access": null,
"description": null,
"lineNumber": 38,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 172,
"kind": "member",
"static": false,
"variation": null,
"name": "btnText",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnText",
"access": null,
"description": null,
"lineNumber": 39,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 173,
"kind": "member",
"static": false,
"variation": null,
"name": "collapseBtnHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#collapseBtnHtml",
"access": null,
"description": null,
"lineNumber": 42,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 174,
"kind": "member",
"static": false,
"variation": null,
"name": "expandBtnHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#expandBtnHtml",
"access": null,
"description": null,
"lineNumber": 45,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 175,
"kind": "member",
"static": false,
"variation": null,
"name": "btnHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnHtml",
"access": null,
"description": null,
"lineNumber": 50,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 176,
"kind": "member",
"static": false,
"variation": null,
"name": "btnCssClass",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnCssClass",
"access": null,
"description": null,
"lineNumber": 52,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 177,
"kind": "member",
"static": false,
"variation": null,
"name": "contCssClass",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contCssClass",
"access": null,
"description": null,
"lineNumber": 54,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 178,
"kind": "member",
"static": false,
"variation": null,
"name": "filtersRowIndex",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#filtersRowIndex",
"access": null,
"description": null,
"lineNumber": 55,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 179,
"kind": "member",
"static": false,
"variation": null,
"name": "visibleAtStart",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#visibleAtStart",
"access": null,
"description": null,
"lineNumber": 58,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 180,
"kind": "member",
"static": false,
"variation": null,
"name": "prfx",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#prfx",
"access": null,
"description": null,
"lineNumber": 62,
"undocument": true,
"type": {
"types": [
"string"
]
}
},
{
"__docId__": 181,
"kind": "member",
"static": false,
"variation": null,
"name": "onBeforeShow",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onBeforeShow",
"access": null,
"description": null,
"lineNumber": 65,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 182,
"kind": "member",
"static": false,
"variation": null,
"name": "onAfterShow",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onAfterShow",
"access": null,
"description": null,
"lineNumber": 67,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 183,
"kind": "member",
"static": false,
"variation": null,
"name": "onBeforeHide",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onBeforeHide",
"access": null,
"description": null,
"lineNumber": 69,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 184,
"kind": "member",
"static": false,
"variation": null,
"name": "onAfterHide",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onAfterHide",
"access": null,
"description": null,
"lineNumber": 71,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 185,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#init",
"access": null,
"description": "Initialise extension",
"lineNumber": 83,
"params": [],
"generator": false
},
{
"__docId__": 186,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#initialized",
"access": null,
"description": null,
"lineNumber": 89,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 187,
"kind": "method",
"static": false,
"variation": null,
"name": "buildUI",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#buildUI",
"access": null,
"description": "Build UI elements",
"lineNumber": 97,
"params": [],
"generator": false
},
{
"__docId__": 188,
"kind": "member",
"static": false,
"variation": null,
"name": "contEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contEl",
"access": null,
"description": null,
"lineNumber": 129,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 189,
"kind": "member",
"static": false,
"variation": null,
"name": "btnEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl",
"access": null,
"description": null,
"lineNumber": 130,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 190,
"kind": "method",
"static": false,
"variation": null,
"name": "toggle",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#toggle",
"access": null,
"description": "Toggle filters visibility",
"lineNumber": 140,
"params": [],
"generator": false
},
{
"__docId__": 191,
"kind": "method",
"static": false,
"variation": null,
"name": "show",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#show",
"access": null,
"description": "Show or hide filters",
"lineNumber": 154,
"params": [
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": true,
"defaultValue": "true",
"defaultRaw": true,
"name": "visible",
"description": "Visibility flag"
}
],
"generator": false
},
{
"__docId__": 192,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#destroy",
"access": null,
"description": "Destroy the UI",
"lineNumber": 185,
"params": [],
"generator": false
},
{
"__docId__": 193,
"kind": "member",
"static": false,
"variation": null,
"name": "btnEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl",
"access": null,
"description": null,
"lineNumber": 194,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 194,
"kind": "member",
"static": false,
"variation": null,
"name": "contEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contEl",
"access": null,
"description": null,
"lineNumber": 198,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 195,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#initialized",
"access": null,
"description": null,
"lineNumber": 199,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 196,
"kind": "file",
"static": true,
"variation": null,
"name": "src/extensions/sort/adapterSortabletable.js",
"memberof": null,
"longname": "src/extensions/sort/adapterSortabletable.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../../feature';\nimport {isArray, isFn, isUndef} from '../../types';\nimport {createElm, elm, getText, tag} from '../../dom';\nimport {addEvt} from '../../event';\nimport {formatDate} from '../../date';\nimport {removeNbFormat} from '../../helpers';\nimport {NONE, CELL_TAG, HEADER_TAG} from '../../const';\n\nexport default class AdapterSortableTable extends Feature {\n\n /**\n * SortableTable Adapter module\n * @param {Object} tf TableFilter instance\n */\n constructor(tf, opts) {\n super(tf, opts.name);\n\n this.name = opts.name;\n this.desc = opts.description || 'Sortable table';\n\n //indicates if table previously sorted\n this.sorted = false;\n\n this.sortTypes = isArray(opts.types) ? opts.types : [];\n this.sortColAtStart = isArray(opts.sort_col_at_start) ?\n opts.sort_col_at_start : null;\n this.asyncSort = Boolean(opts.async_sort);\n this.triggerIds = isArray(opts.trigger_ids) ? opts.trigger_ids : [];\n\n // edit .sort-arrow.descending / .sort-arrow.ascending in\n // tablefilter.css to reflect any path change\n this.imgPath = opts.images_path || tf.themesPath;\n this.imgBlank = opts.image_blank || 'blank.png';\n this.imgClassName = opts.image_class_name || 'sort-arrow';\n this.imgAscClassName = opts.image_asc_class_name || 'ascending';\n this.imgDescClassName = opts.image_desc_class_name || 'descending';\n //cell attribute storing custom key\n this.customKey = opts.custom_key || 'data-tf-sortKey';\n\n // callback invoked after sort is loaded and instanciated\n this.onSortLoaded = isFn(opts.on_sort_loaded) ?\n opts.on_sort_loaded : null;\n // callback invoked before table is sorted\n this.onBeforeSort = isFn(opts.on_before_sort) ?\n opts.on_before_sort : null;\n // callback invoked after table is sorted\n this.onAfterSort = isFn(opts.on_after_sort) ? opts.on_after_sort : null;\n\n this.enable();\n }\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 this.overrideSortableTable();\n this.setSortTypes();\n\n //Column sort at start\n let sortColAtStart = adpt.sortColAtStart;\n if (sortColAtStart) {\n this.stt.sort(sortColAtStart[0], sortColAtStart[1]);\n }\n\n if (this.onSortLoaded) {\n this.onSortLoaded.call(null, tf, this);\n }\n\n /*** SortableTable callbacks ***/\n this.stt.onbeforesort = function () {\n if (adpt.onBeforeSort) {\n adpt.onBeforeSort.call(null, tf, adpt.stt.sortColumn);\n }\n\n /*** sort behaviour for paging ***/\n if (tf.paging) {\n tf.feature('paging').disable();\n }\n };\n\n this.stt.onsort = function () {\n adpt.sorted = true;\n\n //sort behaviour for paging\n if (tf.paging) {\n let paginator = tf.feature('paging');\n // recalculate valid rows index as sorting may have change it\n tf.getValidRows(true);\n paginator.enable();\n paginator.setPage(paginator.getPage());\n }\n\n if (adpt.onAfterSort) {\n adpt.onAfterSort.call(null, tf, adpt.stt.sortColumn,\n adpt.stt.descending);\n }\n\n adpt.emitter.emit('column-sorted', tf, adpt.stt.sortColumn,\n adpt.stt.descending);\n };\n\n this.emitter.on(['sort'],\n (tf, colIdx, desc) => this.sortByColumnIndex(colIdx, desc));\n\n this.initialized = true;\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 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 addSortType() {\n var args = arguments;\n SortableTable.prototype.addSortType(args[0], args[1], args[2], args[3]);\n }\n\n setSortTypes() {\n let tf = this.tf,\n sortTypes = this.sortTypes,\n _sortTypes = [];\n\n for (let i = 0; i < tf.nbCells; i++) {\n let colType;\n\n if (sortTypes[i]) {\n colType = sortTypes[i].toLowerCase();\n if (colType === NONE) {\n colType = 'None';\n }\n } else { // resolve column types\n if (tf.hasColNbFormat && tf.colNbFormat[i] !== null) {\n colType = tf.colNbFormat[i].toLowerCase();\n } else if (tf.hasColDateType && tf.colDateType[i] !== null) {\n colType = tf.colDateType[i].toLowerCase() + 'date';\n } else {\n colType = 'String';\n }\n }\n _sortTypes.push(colType);\n }\n\n //Public TF method to add sort type\n\n //Custom sort types\n this.addSortType('number', Number);\n this.addSortType('caseinsensitivestring', SortableTable.toUpperCase);\n this.addSortType('date', SortableTable.toDate);\n this.addSortType('string');\n this.addSortType('us', usNumberConverter);\n this.addSortType('eu', euNumberConverter);\n this.addSortType('dmydate', dmyDateConverter);\n this.addSortType('ymddate', ymdDateConverter);\n this.addSortType('mdydate', mdyDateConverter);\n this.addSortType('ddmmmyyyydate', ddmmmyyyyDateConverter);\n this.addSortType('ipaddress', ipAddress, sortIP);\n\n this.stt = new SortableTable(tf.tbl, _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 /**\n * Destroy sort\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.initialized = false;\n this.stt.destroy();\n\n let ids = tf.getFiltersId();\n for (let idx = 0; idx < ids.length; idx++) {\n let header = tf.getHeaderElement(idx);\n let img = 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 usNumberConverter(s) {\n return removeNbFormat(s, 'us');\n}\nfunction euNumberConverter(s) {\n return removeNbFormat(s, 'eu');\n}\nfunction dateConverter(s, format) {\n return formatDate(s, format);\n}\nfunction dmyDateConverter(s) {\n return dateConverter(s, 'DMY');\n}\nfunction mdyDateConverter(s) {\n return dateConverter(s, 'MDY');\n}\nfunction ymdDateConverter(s) {\n return dateConverter(s, 'YMD');\n}\nfunction ddmmmyyyyDateConverter(s) {\n return dateConverter(s, 'DDMMMYYYY');\n}\n\nfunction ipAddress(value) {\n let vals = value.split('.');\n for (let x in vals) {\n let val = vals[x];\n while (3 > val.length) {\n val = '0' + val;\n }\n vals[x] = val;\n }\n return vals.join('.');\n}\n\nfunction sortIP(a, b) {\n let aa = ipAddress(a.value.toLowerCase());\n let bb = ipAddress(b.value.toLowerCase());\n if (aa === bb) {\n return 0;\n } else if (aa < bb) {\n return -1;\n } else {\n return 1;\n }\n}\n"
},
{
"__docId__": 197,
"kind": "class",
"static": true,
"variation": null,
"name": "AdapterSortableTable",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"access": null,
"export": true,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": "AdapterSortableTable",
"description": null,
"lineNumber": 9,
"undocument": true,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 198,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#constructor",
"access": null,
"description": "SortableTable Adapter module",
"lineNumber": 15,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
],
"generator": false
},
{
"__docId__": 199,
"kind": "member",
"static": false,
"variation": null,
"name": "name",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#name",
"access": null,
"description": null,
"lineNumber": 18,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 200,
"kind": "member",
"static": false,
"variation": null,
"name": "desc",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#desc",
"access": null,
"description": null,
"lineNumber": 19,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 201,
"kind": "member",
"static": false,
"variation": null,
"name": "sorted",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sorted",
"access": null,
"description": null,
"lineNumber": 22,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 202,
"kind": "member",
"static": false,
"variation": null,
"name": "sortTypes",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sortTypes",
"access": null,
"description": null,
"lineNumber": 24,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 203,
"kind": "member",
"static": false,
"variation": null,
"name": "sortColAtStart",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sortColAtStart",
"access": null,
"description": null,
"lineNumber": 25,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 204,
"kind": "member",
"static": false,
"variation": null,
"name": "asyncSort",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#asyncSort",
"access": null,
"description": null,
"lineNumber": 27,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 205,
"kind": "member",
"static": false,
"variation": null,
"name": "triggerIds",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#triggerIds",
"access": null,
"description": null,
"lineNumber": 28,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 206,
"kind": "member",
"static": false,
"variation": null,
"name": "imgPath",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgPath",
"access": null,
"description": null,
"lineNumber": 32,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 207,
"kind": "member",
"static": false,
"variation": null,
"name": "imgBlank",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgBlank",
"access": null,
"description": null,
"lineNumber": 33,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 208,
"kind": "member",
"static": false,
"variation": null,
"name": "imgClassName",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgClassName",
"access": null,
"description": null,
"lineNumber": 34,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 209,
"kind": "member",
"static": false,
"variation": null,
"name": "imgAscClassName",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgAscClassName",
"access": null,
"description": null,
"lineNumber": 35,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 210,
"kind": "member",
"static": false,
"variation": null,
"name": "imgDescClassName",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgDescClassName",
"access": null,
"description": null,
"lineNumber": 36,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 211,
"kind": "member",
"static": false,
"variation": null,
"name": "customKey",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#customKey",
"access": null,
"description": null,
"lineNumber": 38,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 212,
"kind": "member",
"static": false,
"variation": null,
"name": "onSortLoaded",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#onSortLoaded",
"access": null,
"description": null,
"lineNumber": 41,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 213,
"kind": "member",
"static": false,
"variation": null,
"name": "onBeforeSort",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#onBeforeSort",
"access": null,
"description": null,
"lineNumber": 44,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 214,
"kind": "member",
"static": false,
"variation": null,
"name": "onAfterSort",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#onAfterSort",
"access": null,
"description": null,
"lineNumber": 47,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 215,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#init",
"access": null,
"description": null,
"lineNumber": 52,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 216,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#initialized",
"access": null,
"description": null,
"lineNumber": 113,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 217,
"kind": "method",
"static": false,
"variation": null,
"name": "sortByColumnIndex",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sortByColumnIndex",
"access": null,
"description": "Sort specified column",
"lineNumber": 122,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIdx",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "desc",
"description": "Optional: descending manner"
}
],
"generator": false
},
{
"__docId__": 218,
"kind": "method",
"static": false,
"variation": null,
"name": "overrideSortableTable",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#overrideSortableTable",
"access": null,
"description": null,
"lineNumber": 126,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 219,
"kind": "method",
"static": false,
"variation": null,
"name": "addSortType",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#addSortType",
"access": null,
"description": null,
"lineNumber": 288,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 220,
"kind": "method",
"static": false,
"variation": null,
"name": "setSortTypes",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#setSortTypes",
"access": null,
"description": null,
"lineNumber": 293,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 221,
"kind": "member",
"static": false,
"variation": null,
"name": "stt",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#stt",
"access": null,
"description": null,
"lineNumber": 333,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 222,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#destroy",
"access": null,
"description": "Destroy sort",
"lineNumber": 362,
"params": [],
"generator": false
},
{
"__docId__": 223,
"kind": "member",
"static": false,
"variation": null,
"name": "sorted",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sorted",
"access": null,
"description": null,
"lineNumber": 369,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 224,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#initialized",
"access": null,
"description": null,
"lineNumber": 370,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 225,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#initialized",
"access": null,
"description": null,
"lineNumber": 382,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 226,
"kind": "function",
"static": true,
"variation": null,
"name": "usNumberConverter",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~usNumberConverter",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 388,
"undocument": true,
"params": [
{
"name": "s",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 227,
"kind": "function",
"static": true,
"variation": null,
"name": "euNumberConverter",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~euNumberConverter",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 391,
"undocument": true,
"params": [
{
"name": "s",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 228,
"kind": "function",
"static": true,
"variation": null,
"name": "dateConverter",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~dateConverter",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 394,
"undocument": true,
"params": [
{
"name": "s",
"types": [
"*"
]
},
{
"name": "format",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 229,
"kind": "function",
"static": true,
"variation": null,
"name": "dmyDateConverter",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~dmyDateConverter",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 397,
"undocument": true,
"params": [
{
"name": "s",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 230,
"kind": "function",
"static": true,
"variation": null,
"name": "mdyDateConverter",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~mdyDateConverter",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 400,
"undocument": true,
"params": [
{
"name": "s",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 231,
"kind": "function",
"static": true,
"variation": null,
"name": "ymdDateConverter",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~ymdDateConverter",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 403,
"undocument": true,
"params": [
{
"name": "s",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 232,
"kind": "function",
"static": true,
"variation": null,
"name": "ddmmmyyyyDateConverter",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~ddmmmyyyyDateConverter",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 406,
"undocument": true,
"params": [
{
"name": "s",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 233,
"kind": "function",
"static": true,
"variation": null,
"name": "ipAddress",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~ipAddress",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 410,
"undocument": true,
"params": [
{
"name": "value",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 234,
"kind": "function",
"static": true,
"variation": null,
"name": "sortIP",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"longname": "src/extensions/sort/adapterSortabletable.js~sortIP",
"access": null,
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 422,
"undocument": true,
"params": [
{
"name": "a",
"types": [
"*"
]
},
{
"name": "b",
"types": [
"*"
]
}
],
"return": {
"types": [
"number"
]
},
"generator": false
},
{
"__docId__": 235,
"kind": "file",
"static": true,
"variation": null,
"name": "src/extensions/sort/sort.js",
"memberof": null,
"longname": "src/extensions/sort/sort.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import AdapterSortableTable from './adapterSortabletable';\nimport {root} from '../../root';\n\nif (!root.SortableTable) {\n require('script!sortabletable');\n}\n\nexport default AdapterSortableTable;\n"
},
{
"__docId__": 236,
"kind": "file",
"static": true,
"variation": null,
"name": "src/feature.js",
"memberof": null,
"longname": "src/feature.js",
"access": null,
"description": null,
"lineNumber": 2,
"content": "\nconst NOTIMPLEMENTED = '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\n /**\n * Initialize the feature\n */\n init() {\n throw new Error(NOTIMPLEMENTED);\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(NOTIMPLEMENTED);\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;\n }\n}\n"
},
{
"__docId__": 237,
"kind": "variable",
"static": true,
"variation": null,
"name": "NOTIMPLEMENTED",
"memberof": "src/feature.js",
"longname": "src/feature.js~NOTIMPLEMENTED",
"access": null,
"export": false,
"importPath": "tablefilter/src/feature.js",
"importStyle": null,
"description": null,
"lineNumber": 2,
"undocument": true,
"type": {
"types": [
"string"
]
}
},
{
"__docId__": 238,
"kind": "class",
"static": true,
"variation": null,
"name": "Feature",
"memberof": "src/feature.js",
"longname": "src/feature.js~Feature",
"access": null,
"export": true,
"importPath": "tablefilter/src/feature.js",
"importStyle": "{Feature}",
"description": "Base class defining the interface of a TableFilter feature",
"lineNumber": 7,
"interface": false
},
{
"__docId__": 239,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#constructor",
"access": null,
"description": "Creates an instance of Feature",
"lineNumber": 13,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "feature",
"description": "Feature name known by TableFilter"
}
],
"generator": false
},
{
"__docId__": 240,
"kind": "member",
"static": false,
"variation": null,
"name": "tf",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#tf",
"access": null,
"description": "TableFilter instance",
"lineNumber": 18,
"type": {
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"description": null
}
},
{
"__docId__": 241,
"kind": "member",
"static": false,
"variation": null,
"name": "feature",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#feature",
"access": null,
"description": "Feature name",
"lineNumber": 24,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 242,
"kind": "member",
"static": false,
"variation": null,
"name": "enabled",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#enabled",
"access": null,
"description": "TableFilter feature setting",
"lineNumber": 30,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 243,
"kind": "member",
"static": false,
"variation": null,
"name": "config",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#config",
"access": null,
"description": "TableFilter configuration",
"lineNumber": 36,
"type": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": null
}
},
{
"__docId__": 244,
"kind": "member",
"static": false,
"variation": null,
"name": "emitter",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#emitter",
"access": null,
"description": "TableFilter emitter instance",
"lineNumber": 42,
"type": {
"nullable": null,
"types": [
"Emitter"
],
"spread": false,
"description": null
}
},
{
"__docId__": 245,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#initialized",
"access": null,
"description": "Field indicating whether Feature is initialized",
"lineNumber": 48,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 246,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#init",
"access": null,
"description": "Initialize the feature",
"lineNumber": 54,
"params": [],
"generator": false
},
{
"__docId__": 247,
"kind": "method",
"static": false,
"variation": null,
"name": "reset",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#reset",
"access": null,
"description": "Reset the feature after being disabled",
"lineNumber": 61,
"params": [],
"generator": false
},
{
"__docId__": 248,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#destroy",
"access": null,
"description": "Destroy the feature",
"lineNumber": 69,
"params": [],
"generator": false
},
{
"__docId__": 249,
"kind": "method",
"static": false,
"variation": null,
"name": "enable",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#enable",
"access": null,
"description": "Enable the feature",
"lineNumber": 76,
"params": [],
"generator": false
},
{
"__docId__": 250,
"kind": "member",
"static": false,
"variation": null,
"name": "enabled",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#enabled",
"access": null,
"description": null,
"lineNumber": 77,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 251,
"kind": "method",
"static": false,
"variation": null,
"name": "disable",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#disable",
"access": null,
"description": "Disable the feature",
"lineNumber": 83,
"params": [],
"generator": false
},
{
"__docId__": 252,
"kind": "member",
"static": false,
"variation": null,
"name": "enabled",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#enabled",
"access": null,
"description": null,
"lineNumber": 84,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 253,
"kind": "method",
"static": false,
"variation": null,
"name": "isEnabled",
"memberof": "src/feature.js~Feature",
"longname": "src/feature.js~Feature#isEnabled",
"access": null,
"description": "Indicate whether the feature is enabled or not",
"lineNumber": 91,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Boolean}"
}
],
"params": [],
"return": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": ""
},
"generator": false
},
{
"__docId__": 254,
"kind": "file",
"static": true,
"variation": null,
"name": "src/helpers.js",
"memberof": null,
"longname": "src/helpers.js",
"access": null,
"description": null,
"lineNumber": 11,
"content": "/**\n * Misc helpers\n */\n\n/**\n * Returns a unformatted number\n * @param {String} Formatted number\n * @param {String} Format type, currently 'us' or 'eu'\n * @return {String} Unformatted number\n */\nexport const removeNbFormat = (data, format = 'us') => {\n if (!data) {\n return;\n }\n\n let n = data;\n if (format.toLowerCase() === 'us') {\n n = + n.replace(/[^\\d\\.-]/g, '');\n } else {\n n = + n.replace(/[^\\d\\,-]/g, '').replace(',', '.');\n }\n return n;\n}\n"
},
{
"__docId__": 255,
"kind": "variable",
"static": true,
"variation": null,
"name": "removeNbFormat",
"memberof": "src/helpers.js",
"longname": "src/helpers.js~removeNbFormat",
"access": null,
"export": true,
"importPath": "tablefilter/src/helpers.js",
"importStyle": "{removeNbFormat}",
"description": "Returns a unformatted number",
"lineNumber": 11,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "Formatted",
"description": "number"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "Format",
"description": "type, currently 'us' or 'eu'"
}
],
"return": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": "Unformatted number"
},
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 256,
"kind": "file",
"static": true,
"variation": null,
"name": "src/modules/alternateRows.js",
"memberof": null,
"longname": "src/modules/alternateRows.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../feature';\nimport {addClass, removeClass} from '../dom';\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 = config.even_row_css_class || 'even';\n\n /**\n * Css class for odd rows (default: 'odd')\n * @type {String}\n */\n this.oddCss = 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'], () => this.processAll());\n\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.tbl.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.tbl.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 let nbRows = this.tf.getRowsNb(true);\n for (let i = 0; i < nbRows; i++) {\n this.removeRowBg(i);\n }\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'], () => this.processAll());\n\n this.initialized = false;\n }\n\n}\n"
},
{
"__docId__": 257,
"kind": "class",
"static": true,
"variation": null,
"name": "AlternateRows",
"memberof": "src/modules/alternateRows.js",
"longname": "src/modules/alternateRows.js~AlternateRows",
"access": null,
"export": true,
"importPath": "tablefilter/src/modules/alternateRows.js",
"importStyle": "{AlternateRows}",
"description": "Rows with alternating background color for improved readability",
"lineNumber": 7,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 258,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#constructor",
"access": null,
"description": "Creates an instance of AlternateRows.",
"lineNumber": 14,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
],
"generator": false
},
{
"__docId__": 259,
"kind": "member",
"static": false,
"variation": null,
"name": "evenCss",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#evenCss",
"access": null,
"description": "Css class for even rows (default: 'even')",
"lineNumber": 22,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 260,
"kind": "member",
"static": false,
"variation": null,
"name": "oddCss",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#oddCss",
"access": null,
"description": "Css class for odd rows (default: 'odd')",
"lineNumber": 28,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 261,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#init",
"access": null,
"description": "Sets alternating rows color",
"lineNumber": 34,
"params": [],
"generator": false
},
{
"__docId__": 262,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#initialized",
"access": null,
"description": null,
"lineNumber": 47,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 263,
"kind": "method",
"static": false,
"variation": null,
"name": "processAll",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#processAll",
"access": null,
"description": "Apply background to all valid rows",
"lineNumber": 53,
"params": [],
"generator": false
},
{
"__docId__": 264,
"kind": "method",
"static": false,
"variation": null,
"name": "processRow",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#processRow",
"access": null,
"description": "Set/remove row background based on row validation",
"lineNumber": 76,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "rowIdx",
"description": "Row index"
},
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "arrIdx",
"description": "Array index"
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "isValid",
"description": "Valid row flag"
}
],
"generator": false
},
{
"__docId__": 265,
"kind": "method",
"static": false,
"variation": null,
"name": "setRowBg",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#setRowBg",
"access": "private",
"description": "Sets row background color",
"lineNumber": 91,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "rowIdx",
"description": "Row index"
},
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "idx",
"description": "Valid rows collection index needed to calculate bg\ncolor"
}
],
"generator": false
},
{
"__docId__": 266,
"kind": "method",
"static": false,
"variation": null,
"name": "removeRowBg",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#removeRowBg",
"access": "private",
"description": "Removes row background color",
"lineNumber": 107,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "idx",
"description": "Row index"
}
],
"generator": false
},
{
"__docId__": 267,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#destroy",
"access": null,
"description": "Removes all alternating backgrounds",
"lineNumber": 119,
"params": [],
"generator": false
},
{
"__docId__": 268,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"longname": "src/modules/alternateRows.js~AlternateRows#initialized",
"access": null,
"description": null,
"lineNumber": 134,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 269,
"kind": "file",
"static": true,
"variation": null,
"name": "src/modules/checkList.js",
"memberof": null,
"longname": "src/modules/checkList.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../feature';\nimport {\n addClass, createCheckItem, createText, createElm, elm, getText,\n removeClass, tag\n} from '../dom';\nimport {has} from '../array';\nimport {matchCase, trim, rgxEsc} from '../string';\nimport {ignoreCase, numSortAsc, numSortDesc} from '../sort';\nimport {addEvt, removeEvt, targetEvt} from '../event';\nimport {isEmpty} from '../types';\nimport {CHECKLIST, NONE} from '../const';\n\nconst SORT_ERROR = 'Filter options for column {0} cannot be sorted in ' +\n '{1} manner.';\n\n/**\n * Checklist filter UI component\n */\nexport class CheckList extends Feature {\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 = f.div_checklist_css_class || 'div_checklist';\n\n /**\n * Css class for the checklist filter element (ul)\n * @type {String}\n */\n this.filterCssClass = f.checklist_css_class || 'flt_checklist';\n\n /**\n * Css class for the item of a checklist (li)\n * @type {String}\n */\n this.itemCssClass = f.checklist_item_css_class || 'flt_checklist_item';\n\n /**\n * Css class for a selected item of a checklist (li)\n * @type {String}\n */\n this.selectedItemCssClass =\n f.checklist_selected_item_css_class || 'flt_checklist_slc_item';\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 =\n f.activate_checklist_text || 'Click to load filter data';\n\n /**\n * Css class for a disabled item of a checklist (li)\n * @type {String}\n */\n this.disabledItemCssClass = f.checklist_item_disabled_css_class ||\n 'flt_checklist_item_disabled';\n\n /**\n * Enable the reset filter option as first item\n * @type {Boolean}\n */\n this.enableResetOption = f.enable_checklist_reset_filter === false ?\n false : true;\n\n /**\n * Prefix for container element ID\n * @type {String}\n * @private\n */\n this.prfx = 'chkdiv_';\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 * Checklist option click event handler\n * @param {Event} evt\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 */\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 * Initialize checklist filter\n * @param {Number} colIndex Column index\n * @param {Boolean} isExternal External filter flag\n * @param {DOMElement} container Dom element containing the filter\n */\n init(colIndex, isExternal, container) {\n let tf = this.tf;\n let externalFltTgtId = isExternal ?\n tf.externalFltTgtIds[colIndex] : null;\n\n let divCont = 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 tf.externalFltEls.push(divCont);\n } else {\n container.appendChild(divCont);\n }\n\n this.containers[colIndex] = divCont;\n tf.fltIds.push(tf.prfxFlt + colIndex + '_' + tf.id);\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) => this.build(colIndex)\n );\n\n this.emitter.on(\n ['select-checklist-options'],\n (tf, colIndex, values) => this.selectOptions(colIndex, values)\n );\n\n this.initialized = true;\n }\n\n /**\n * Build checklist UI\n * @param {Number} colIndex Column index\n */\n build(colIndex) {\n let tf = this.tf;\n colIndex = parseInt(colIndex, 10);\n\n this.emitter.emit('before-populating-filter', tf, colIndex);\n\n this.opts = [];\n this.optsTxt = [];\n\n let flt = this.containers[colIndex];\n let ul = createElm('ul', ['id', tf.fltIds[colIndex]],\n ['colIndex', colIndex]);\n ul.className = this.filterCssClass;\n\n let rows = tf.tbl.rows;\n let nbRows = tf.getRowsNb(true);\n let caseSensitive = tf.caseSensitive;\n this.isCustom = tf.isCustomOptions(colIndex);\n\n let activeIdx;\n let activeFilterId = tf.getActiveFilterId();\n if (tf.linkedFilters && activeFilterId) {\n activeIdx = tf.getColumnIndexFromFilterId(activeFilterId);\n }\n\n let filteredDataCol = [];\n if (tf.linkedFilters && tf.disableExcludedOptions) {\n this.excludedOpts = [];\n }\n\n flt.innerHTML = '';\n\n for (let k = tf.refRow; k < nbRows; k++) {\n // always visible rows don't need to appear on selects as always\n // valid\n if (tf.hasVisibleRows && tf.visibleRows.indexOf(k) !== -1) {\n continue;\n }\n\n let cells = rows[k].cells;\n let ncells = cells.length;\n\n // checks if row has exact cell #\n if (ncells !== tf.nbCells || this.isCustom) {\n continue;\n }\n\n // this loop retrieves cell data\n for (let j = 0; j < ncells; j++) {\n // WTF: cyclomatic complexity hell :)\n if ((colIndex === j && (!tf.linkedFilters ||\n (tf.linkedFilters && tf.disableExcludedOptions))) ||\n (colIndex === j && tf.linkedFilters &&\n ((rows[k].style.display === '' && !tf.paging) ||\n (tf.paging && ((!activeIdx ||\n activeIdx === colIndex) ||\n (activeIdx !== colIndex &&\n tf.validRowsIndex.indexOf(k) !== -1)))))) {\n\n let cellData = tf.getCellData(cells[j]);\n //Vary Peter's patch\n let cellString = matchCase(cellData, caseSensitive);\n // checks if celldata is already in array\n if (!has(this.opts, cellString, caseSensitive)) {\n this.opts.push(cellData);\n }\n let filteredCol = filteredDataCol[j];\n if (tf.linkedFilters && tf.disableExcludedOptions) {\n if (!filteredCol) {\n filteredCol = tf.getFilteredDataCol(j);\n }\n if (!has(filteredCol, cellString, caseSensitive) &&\n !has(this.excludedOpts, cellString,\n caseSensitive)) {\n this.excludedOpts.push(cellData);\n }\n }\n }\n }\n }\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 if (tf.sortSlc && !this.isCustom) {\n if (!caseSensitive) {\n this.opts.sort(ignoreCase);\n if (this.excludedOpts) {\n this.excludedOpts.sort(ignoreCase);\n }\n } else {\n this.opts.sort();\n if (this.excludedOpts) {\n this.excludedOpts.sort();\n }\n }\n }\n //asc sort\n if (tf.sortNumAsc.indexOf(colIndex) !== -1) {\n try {\n this.opts.sort(numSortAsc);\n if (this.excludedOpts) {\n this.excludedOpts.sort(numSortAsc);\n }\n if (this.isCustom) {\n this.optsTxt.sort(numSortAsc);\n }\n } catch (e) {\n throw new Error(SORT_ERROR.replace('{0}', colIndex)\n .replace('{1}', 'ascending'));\n }//in case there are alphanumeric values\n }\n //desc sort\n if (tf.sortNumDesc.indexOf(colIndex) !== -1) {\n try {\n this.opts.sort(numSortDesc);\n if (this.excludedOpts) {\n this.excludedOpts.sort(numSortDesc);\n }\n if (this.isCustom) {\n this.optsTxt.sort(numSortDesc);\n }\n } catch (e) {\n throw new Error(SORT_ERROR.replace('{0}', colIndex)\n .replace('{1}', 'descending'));\n }//in case there are alphanumeric values\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 */\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 li = createCheckItem(tf.fltIds[colIndex] + '_' + (y + chkCt),\n 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 */\n addTChecks(colIndex, ul) {\n let tf = this.tf;\n let chkCt = 1;\n let li0 = createCheckItem(tf.fltIds[colIndex] + '_0', '',\n tf.displayAllText);\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(tf.fltIds[colIndex] + '_1',\n tf.emOperator, 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(tf.fltIds[colIndex] + '_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 */\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 return;\n }\n\n let lisNb = tag(flt, 'li').length;\n\n flt.setAttribute('value', '');\n flt.setAttribute('indexes', '');\n\n for (let k = 0; k < lisNb; k++) {\n let li = tag(flt, 'li')[k];\n let lbl = tag(li, 'label')[0];\n let chk = tag(li, 'input')[0];\n let lblTxt = matchCase(getText(lbl), tf.caseSensitive);\n\n if (lblTxt !== '' && has(values, lblTxt, 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 lblTxt === matchCase(tf.nonEmptyText, tf.caseSensitive)) {\n chk.checked = true;\n }\n else if (values.indexOf(tf.emOperator) !== -1 &&\n lblTxt === 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\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, isExternal) => this.build(colIndex, isExternal)\n );\n this.emitter.off(\n ['select-checklist-options'],\n (tf, colIndex, values) => this.selectOptions(colIndex, values)\n );\n }\n}\n"
},
{
"__docId__": 270,
"kind": "variable",
"static": true,
"variation": null,
"name": "SORT_ERROR",
"memberof": "src/modules/checkList.js",
"longname": "src/modules/checkList.js~SORT_ERROR",
"access": null,
"export": false,
"importPath": "tablefilter/src/modules/checkList.js",
"importStyle": null,
"description": null,
"lineNumber": 13,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 271,
"kind": "class",
"static": true,
"variation": null,
"name": "CheckList",
"memberof": "src/modules/checkList.js",
"longname": "src/modules/checkList.js~CheckList",
"access": null,
"export": true,
"importPath": "tablefilter/src/modules/checkList.js",
"importStyle": "{CheckList}",
"description": "Checklist filter UI component",
"lineNumber": 19,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 272,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#constructor",
"access": null,
"description": "Creates an instance of CheckList",
"lineNumber": 25,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
],
"generator": false
},
{
"__docId__": 273,
"kind": "member",
"static": false,
"variation": null,
"name": "containers",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#containers",
"access": null,
"description": "List of container DOM elements",
"lineNumber": 34,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 274,
"kind": "member",
"static": false,
"variation": null,
"name": "containerCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#containerCssClass",
"access": null,
"description": "Css class for the container of the checklist filter (div)",
"lineNumber": 40,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 275,
"kind": "member",
"static": false,
"variation": null,
"name": "filterCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#filterCssClass",
"access": null,
"description": "Css class for the checklist filter element (ul)",
"lineNumber": 46,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 276,
"kind": "member",
"static": false,
"variation": null,
"name": "itemCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#itemCssClass",
"access": null,
"description": "Css class for the item of a checklist (li)",
"lineNumber": 52,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 277,
"kind": "member",
"static": false,
"variation": null,
"name": "selectedItemCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#selectedItemCssClass",
"access": null,
"description": "Css class for a selected item of a checklist (li)",
"lineNumber": 58,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 278,
"kind": "member",
"static": false,
"variation": null,
"name": "activateText",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#activateText",
"access": null,
"description": "Text placed in the filter's container when load filter on demand\nfeature is enabled",
"lineNumber": 66,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 279,
"kind": "member",
"static": false,
"variation": null,
"name": "disabledItemCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#disabledItemCssClass",
"access": null,
"description": "Css class for a disabled item of a checklist (li)",
"lineNumber": 73,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 280,
"kind": "member",
"static": false,
"variation": null,
"name": "enableResetOption",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#enableResetOption",
"access": null,
"description": "Enable the reset filter option as first item",
"lineNumber": 80,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 281,
"kind": "member",
"static": false,
"variation": null,
"name": "prfx",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#prfx",
"access": "private",
"description": "Prefix for container element ID",
"lineNumber": 88,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 282,
"kind": "member",
"static": false,
"variation": null,
"name": "isCustom",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#isCustom",
"access": "private",
"description": "Has custom options",
"lineNumber": 95,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 283,
"kind": "member",
"static": false,
"variation": null,
"name": "opts",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#opts",
"access": "private",
"description": "List of options values",
"lineNumber": 102,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 284,
"kind": "member",
"static": false,
"variation": null,
"name": "optsTxt",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#optsTxt",
"access": "private",
"description": "List of options texts for custom values",
"lineNumber": 109,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 285,
"kind": "member",
"static": false,
"variation": null,
"name": "excludedOpts",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#excludedOpts",
"access": "private",
"description": "List of options to be excluded from the checklist filter",
"lineNumber": 116,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 286,
"kind": "method",
"static": false,
"variation": null,
"name": "optionClick",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#optionClick",
"access": null,
"description": "Checklist option click event handler",
"lineNumber": 123,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": ""
}
],
"generator": false
},
{
"__docId__": 287,
"kind": "method",
"static": false,
"variation": null,
"name": "onCheckListClick",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#onCheckListClick",
"access": null,
"description": "Checklist container click event handler for load-on-demand feature",
"lineNumber": 136,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": ""
}
],
"generator": false
},
{
"__docId__": 288,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#init",
"access": null,
"description": "Initialize checklist filter",
"lineNumber": 152,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "isExternal",
"description": "External filter flag"
},
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "container",
"description": "Dom element containing the filter"
}
],
"generator": false
},
{
"__docId__": 289,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#initialized",
"access": null,
"description": null,
"lineNumber": 190,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 290,
"kind": "method",
"static": false,
"variation": null,
"name": "build",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#build",
"access": null,
"description": "Build checklist UI",
"lineNumber": 197,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"generator": false
},
{
"__docId__": 291,
"kind": "member",
"static": false,
"variation": null,
"name": "opts",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#opts",
"access": null,
"description": null,
"lineNumber": 203,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 292,
"kind": "member",
"static": false,
"variation": null,
"name": "optsTxt",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#optsTxt",
"access": null,
"description": null,
"lineNumber": 204,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 293,
"kind": "member",
"static": false,
"variation": null,
"name": "isCustom",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#isCustom",
"access": null,
"description": null,
"lineNumber": 214,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 294,
"kind": "member",
"static": false,
"variation": null,
"name": "excludedOpts",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#excludedOpts",
"access": null,
"description": null,
"lineNumber": 224,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 295,
"kind": "member",
"static": false,
"variation": null,
"name": "opts",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#opts",
"access": null,
"description": null,
"lineNumber": 281,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 296,
"kind": "member",
"static": false,
"variation": null,
"name": "optsTxt",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#optsTxt",
"access": null,
"description": null,
"lineNumber": 282,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 297,
"kind": "method",
"static": false,
"variation": null,
"name": "addChecks",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#addChecks",
"access": null,
"description": "Add checklist options",
"lineNumber": 345,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "ul",
"description": "Ul element"
}
],
"generator": false
},
{
"__docId__": 298,
"kind": "method",
"static": false,
"variation": null,
"name": "addTChecks",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#addTChecks",
"access": null,
"description": "Add checklist header option",
"lineNumber": 379,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "ul",
"description": "Ul element"
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 299,
"kind": "method",
"static": false,
"variation": null,
"name": "setCheckListValues",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#setCheckListValues",
"access": null,
"description": "Store checked options in DOM element attribute",
"lineNumber": 417,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "o",
"description": "checklist option DOM element"
}
],
"generator": false
},
{
"__docId__": 300,
"kind": "method",
"static": false,
"variation": null,
"name": "selectOptions",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#selectOptions",
"access": null,
"description": "Select filter options programmatically",
"lineNumber": 496,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "values",
"description": "Array of option values to select"
}
],
"generator": false
},
{
"__docId__": 301,
"kind": "method",
"static": false,
"variation": null,
"name": "getValues",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#getValues",
"access": null,
"description": "Get filter values for a given column index",
"lineNumber": 538,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Array} values Collection of selected values"
}
],
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"return": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": "values Collection of selected values"
},
"generator": false
},
{
"__docId__": 302,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/modules/checkList.js~CheckList",
"longname": "src/modules/checkList.js~CheckList#destroy",
"access": null,
"description": "Destroy CheckList instance",
"lineNumber": 555,
"params": [],
"generator": false
},
{
"__docId__": 303,
"kind": "file",
"static": true,
"variation": null,
"name": "src/modules/clearButton.js",
"memberof": null,
"longname": "src/modules/clearButton.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../feature';\nimport {createElm, createText, elm, removeElm} from '../dom';\nimport {addEvt} from '../event';\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;\n\n /**\n * Container element ID\n * @type {String}\n */\n this.targetId = f.btn_reset_target_id || null;\n\n /**\n * Clear button element\n * @type {DOMElement}\n * @private\n */\n this.element = null;\n\n /**\n * Text for the clear button\n * @type {String}\n */\n this.text = f.btn_reset_text || 'Reset';\n\n /**\n * Tooltip text for the clear button\n * @type {String}\n */\n this.tooltip = f.btn_reset_tooltip || 'Clear filters';\n\n /**\n * Custom Html string for the clear button\n * @type {String}\n */\n this.html = f.btn_reset_html ||\n (!tf.enableIcons ? null :\n '');\n\n /**\n * Prefix fot ID of container element\n * @type {String}\n * @private\n */\n this.prfxCont = 'resetspan_';\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 let resetspan = createElm('span', ['id', this.prfxCont + tf.id]);\n\n // reset button is added to defined element\n if (!this.targetId) {\n tf.setToolbar();\n }\n let targetEl = !this.targetId ? tf.rDiv : elm(this.targetId);\n targetEl.appendChild(resetspan);\n\n if (!this.html) {\n let fltreset = createElm('a', ['href', 'javascript:void(0);']);\n fltreset.className = tf.btnResetCssClass;\n fltreset.appendChild(createText(this.text));\n resetspan.appendChild(fltreset);\n addEvt(fltreset, 'click', () => this.onClick());\n } else {\n resetspan.innerHTML = this.html;\n let resetEl = resetspan.firstChild;\n addEvt(resetEl, 'click', () => this.onClick());\n }\n this.element = resetspan.firstChild;\n\n this.initialized = true;\n }\n\n /**\n * Destroy ClearButton instance\n */\n destroy() {\n let tf = this.tf;\n\n if (!this.initialized) {\n return;\n }\n\n let resetspan = elm(this.prfxCont + tf.id);\n if (resetspan) {\n removeElm(resetspan);\n }\n this.element = null;\n this.initialized = false;\n }\n}\n"
},
{
"__docId__": 304,
"kind": "class",
"static": true,
"variation": null,
"name": "ClearButton",
"memberof": "src/modules/clearButton.js",
"longname": "src/modules/clearButton.js~ClearButton",
"access": null,
"export": true,
"importPath": "tablefilter/src/modules/clearButton.js",
"importStyle": "{ClearButton}",
"description": "Clear button UI component",
"lineNumber": 8,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 305,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#constructor",
"access": null,
"description": "Creates an instance of ClearButton",
"lineNumber": 14,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
],
"generator": false
},
{
"__docId__": 306,
"kind": "member",
"static": false,
"variation": null,
"name": "targetId",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#targetId",
"access": null,
"description": "Container element ID",
"lineNumber": 23,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 307,
"kind": "member",
"static": false,
"variation": null,
"name": "element",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#element",
"access": "private",
"description": "Clear button element",
"lineNumber": 30,
"type": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": null
}
},
{
"__docId__": 308,
"kind": "member",
"static": false,
"variation": null,
"name": "text",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#text",
"access": null,
"description": "Text for the clear button",
"lineNumber": 36,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 309,
"kind": "member",
"static": false,
"variation": null,
"name": "tooltip",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#tooltip",
"access": null,
"description": "Tooltip text for the clear button",
"lineNumber": 42,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 310,
"kind": "member",
"static": false,
"variation": null,
"name": "html",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#html",
"access": null,
"description": "Custom Html string for the clear button",
"lineNumber": 48,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 311,
"kind": "member",
"static": false,
"variation": null,
"name": "prfxCont",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#prfxCont",
"access": "private",
"description": "Prefix fot ID of container element",
"lineNumber": 58,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 312,
"kind": "method",
"static": false,
"variation": null,
"name": "onClick",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#onClick",
"access": "private",
"description": "Click event handler for clear button",
"lineNumber": 65,
"params": [],
"generator": false
},
{
"__docId__": 313,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#init",
"access": null,
"description": "Initialize clear button component",
"lineNumber": 75,
"params": [],
"generator": false
},
{
"__docId__": 314,
"kind": "member",
"static": false,
"variation": null,
"name": "element",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#element",
"access": null,
"description": null,
"lineNumber": 102,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 315,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#initialized",
"access": null,
"description": null,
"lineNumber": 104,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 316,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#destroy",
"access": null,
"description": "Destroy ClearButton instance",
"lineNumber": 110,
"params": [],
"generator": false
},
{
"__docId__": 317,
"kind": "member",
"static": false,
"variation": null,
"name": "element",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#element",
"access": null,
"description": null,
"lineNumber": 121,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 318,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/modules/clearButton.js~ClearButton",
"longname": "src/modules/clearButton.js~ClearButton#initialized",
"access": null,
"description": null,
"lineNumber": 122,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 319,
"kind": "file",
"static": true,
"variation": null,
"name": "src/modules/dropdown.js",
"memberof": null,
"longname": "src/modules/dropdown.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../feature';\nimport {createElm, createOpt, elm} from '../dom';\nimport {has} from '../array';\nimport {matchCase} from '../string';\nimport {ignoreCase, numSortAsc, numSortDesc} from '../sort';\nimport {addEvt, targetEvt} from '../event';\nimport {SELECT, MULTIPLE, NONE} from '../const';\n\nconst SORT_ERROR = 'Filter options for column {0} cannot be sorted in ' +\n '{1} manner.';\n\nexport class Dropdown extends Feature {\n\n /**\n * Dropdown UI component\n * @param {Object} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'dropdown');\n\n // Configuration object\n let f = tf.config();\n\n this.enableSlcResetFilter = f.enable_slc_reset_filter === false ?\n false : true;\n //defines empty option text\n this.nonEmptyText = f.non_empty_text || '(Non empty)';\n //IE only, tooltip text appearing on select before it is populated\n this.activateSlcTooltip = f.activate_slc_tooltip ||\n 'Click to activate';\n //tooltip text appearing on multiple select\n this.multipleSlcTooltip = f.multiple_slc_tooltip ||\n 'Use Ctrl key for multiple selections';\n\n this.isCustom = null;\n this.opts = null;\n this.optsTxt = null;\n this.slcInnerHtml = null;\n }\n\n onSlcFocus(e) {\n let elm = 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 onSlcChange() {\n if (this.tf.onSlcChange) {\n this.tf.filter();\n }\n }\n\n /**\n * Initialize drop-down filter\n * @param {Number} colIndex Column index\n * @param {Boolean} isExternal External filter flag\n * @param {DOMElement} container Dom element containing the filter\n */\n init(colIndex, isExternal, container) {\n let tf = this.tf;\n let col = tf.getFilterType(colIndex);\n let externalFltTgtId = isExternal ?\n tf.externalFltTgtIds[colIndex] : null;\n\n let slc = createElm(SELECT,\n ['id', tf.prfxFlt + colIndex + '_' + tf.id],\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 tf.externalFltEls.push(slc);\n } else {\n container.appendChild(slc);\n }\n\n tf.fltIds.push(slc.id);\n\n if (!tf.loadFltOnDemand) {\n this.build(colIndex);\n } else {\n //1st option is created here since build isn't invoked\n let opt0 = createOpt(tf.displayAllText, '');\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\n this.initialized = true;\n }\n\n /**\n * Build drop-down filter UI\n * @param {Number} colIndex Column index\n * @param {Boolean} isLinked Enable linked refresh behaviour\n */\n build(colIndex, isLinked = false) {\n let tf = this.tf;\n colIndex = parseInt(colIndex, 10);\n\n this.emitter.emit('before-populating-filter', tf, colIndex);\n\n this.opts = [];\n this.optsTxt = [];\n this.slcInnerHtml = '';\n\n let slcId = tf.fltIds[colIndex];\n let slc = elm(slcId);\n let rows = tf.tbl.rows;\n let nbRows = tf.getRowsNb(true);\n\n //custom select test\n this.isCustom = tf.isCustomOptions(colIndex);\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 for (let k = tf.refRow; k < nbRows; k++) {\n // always visible rows don't need to appear on selects as always\n // valid\n if (tf.hasVisibleRows && tf.visibleRows.indexOf(k) !== -1) {\n continue;\n }\n\n let cell = rows[k].cells,\n nchilds = cell.length;\n\n // checks if row has exact cell #\n if (nchilds !== tf.nbCells || this.isCustom) {\n continue;\n }\n\n // this loop retrieves cell data\n for (let j = 0; j < nchilds; j++) {\n // WTF: cyclomatic complexity hell\n // TODO: simplify hell below\n if ((colIndex === j &&\n (!isLinked ||\n (isLinked && tf.disableExcludedOptions))) ||\n (colIndex === j && isLinked &&\n ((rows[k].style.display === '' && !tf.paging) ||\n (tf.paging && (!tf.validRowsIndex ||\n (tf.validRowsIndex &&\n tf.validRowsIndex.indexOf(k) !== -1)) &&\n ((activeIdx === undefined ||\n activeIdx === colIndex) ||\n (activeIdx !== colIndex &&\n tf.validRowsIndex.indexOf(k) !== -1)))))) {\n let cellData = tf.getCellData(cell[j]),\n //Vary Peter's patch\n cellString = matchCase(cellData, tf.caseSensitive);\n\n // checks if celldata is already in array\n if (!has(this.opts, cellString, tf.caseSensitive)) {\n this.opts.push(cellData);\n }\n\n if (isLinked && tf.disableExcludedOptions) {\n let filteredCol = filteredDataCol[j];\n if (!filteredCol) {\n filteredCol = tf.getFilteredDataCol(j);\n }\n if (!has(filteredCol, cellString, tf.caseSensitive) &&\n !has(excludedOpts, cellString, tf.caseSensitive)) {\n excludedOpts.push(cellData);\n }\n }\n }//if colIndex==j\n }//for j\n }//for k\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 if (tf.sortSlc && !this.isCustom) {\n if (!tf.caseSensitive) {\n this.opts.sort(ignoreCase);\n if (excludedOpts) {\n excludedOpts.sort(ignoreCase);\n }\n } else {\n this.opts.sort();\n if (excludedOpts) { excludedOpts.sort(); }\n }\n }\n\n //asc sort\n if (tf.sortNumAsc.indexOf(colIndex) !== -1) {\n try {\n this.opts.sort(numSortAsc);\n if (excludedOpts) {\n excludedOpts.sort(numSortAsc);\n }\n if (this.isCustom) {\n this.optsTxt.sort(numSortAsc);\n }\n } catch (e) {\n throw new Error(SORT_ERROR.replace('{0}', colIndex)\n .replace('{1}', 'ascending'));\n }//in case there are alphanumeric values\n }\n //desc sort\n if (tf.sortNumDesc.indexOf(colIndex) !== -1) {\n try {\n this.opts.sort(numSortDesc);\n if (excludedOpts) {\n excludedOpts.sort(numSortDesc);\n }\n if (this.isCustom) {\n this.optsTxt.sort(numSortDesc);\n }\n } catch (e) {\n throw new Error(SORT_ERROR.replace('{0}', colIndex)\n .replace('{1}', 'ascending'));\n }//in case there are alphanumeric values\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\n let opt0 = createOpt(\n (!this.enableSlcResetFilter ? '' : tf.displayAllText), '');\n if (!this.enableSlcResetFilter) {\n opt0.style.display = NONE;\n }\n slc.appendChild(opt0);\n if (tf.enableEmptyOption) {\n let opt1 = 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 (tf.getFilterType(colIndex) !== MULTIPLE || 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 destroy() {\n this.emitter.off(\n ['build-select-filter'],\n (colIndex, isLinked, isExternal) =>\n this.build(colIndex, isLinked, isExternal)\n );\n this.emitter.off(\n ['select-options'],\n (tf, colIndex, values) => this.selectOptions(colIndex, values)\n );\n }\n}\n"
},
{
"__docId__": 320,
"kind": "variable",
"static": true,
"variation": null,
"name": "SORT_ERROR",
"memberof": "src/modules/dropdown.js",
"longname": "src/modules/dropdown.js~SORT_ERROR",
"access": null,
"export": false,
"importPath": "tablefilter/src/modules/dropdown.js",
"importStyle": null,
"description": null,
"lineNumber": 9,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 321,
"kind": "class",
"static": true,
"variation": null,
"name": "Dropdown",
"memberof": "src/modules/dropdown.js",
"longname": "src/modules/dropdown.js~Dropdown",
"access": null,
"export": true,
"importPath": "tablefilter/src/modules/dropdown.js",
"importStyle": "{Dropdown}",
"description": null,
"lineNumber": 12,
"undocument": true,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 322,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#constructor",
"access": null,
"description": "Dropdown UI component",
"lineNumber": 18,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
],
"generator": false
},
{
"__docId__": 323,
"kind": "member",
"static": false,
"variation": null,
"name": "enableSlcResetFilter",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#enableSlcResetFilter",
"access": null,
"description": null,
"lineNumber": 24,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 324,
"kind": "member",
"static": false,
"variation": null,
"name": "nonEmptyText",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#nonEmptyText",
"access": null,
"description": null,
"lineNumber": 27,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 325,
"kind": "member",
"static": false,
"variation": null,
"name": "activateSlcTooltip",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#activateSlcTooltip",
"access": null,
"description": null,
"lineNumber": 29,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 326,
"kind": "member",
"static": false,
"variation": null,
"name": "multipleSlcTooltip",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#multipleSlcTooltip",
"access": null,
"description": null,
"lineNumber": 32,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 327,
"kind": "member",
"static": false,
"variation": null,
"name": "isCustom",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#isCustom",
"access": null,
"description": null,
"lineNumber": 35,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 328,
"kind": "member",
"static": false,
"variation": null,
"name": "opts",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#opts",
"access": null,
"description": null,
"lineNumber": 36,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 329,
"kind": "member",
"static": false,
"variation": null,
"name": "optsTxt",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#optsTxt",
"access": null,
"description": null,
"lineNumber": 37,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 330,
"kind": "member",
"static": false,
"variation": null,
"name": "slcInnerHtml",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#slcInnerHtml",
"access": null,
"description": null,
"lineNumber": 38,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 331,
"kind": "method",
"static": false,
"variation": null,
"name": "onSlcFocus",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#onSlcFocus",
"access": null,
"description": null,
"lineNumber": 41,
"undocument": true,
"params": [
{
"name": "e",
"types": [
"*"
]
}
],
"generator": false
},
{
"__docId__": 332,
"kind": "method",
"static": false,
"variation": null,
"name": "onSlcChange",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#onSlcChange",
"access": null,
"description": null,
"lineNumber": 52,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 333,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#init",
"access": null,
"description": "Initialize drop-down filter",
"lineNumber": 64,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "isExternal",
"description": "External filter flag"
},
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "container",
"description": "Dom element containing the filter"
}
],
"generator": false
},
{
"__docId__": 334,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#initialized",
"access": null,
"description": null,
"lineNumber": 113,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 335,
"kind": "method",
"static": false,
"variation": null,
"name": "build",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#build",
"access": null,
"description": "Build drop-down filter UI",
"lineNumber": 121,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "isLinked",
"description": "Enable linked refresh behaviour"
}
],
"generator": false
},
{
"__docId__": 336,
"kind": "member",
"static": false,
"variation": null,
"name": "opts",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#opts",
"access": null,
"description": null,
"lineNumber": 127,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 337,
"kind": "member",
"static": false,
"variation": null,
"name": "optsTxt",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#optsTxt",
"access": null,
"description": null,
"lineNumber": 128,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 338,
"kind": "member",
"static": false,
"variation": null,
"name": "slcInnerHtml",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#slcInnerHtml",
"access": null,
"description": null,
"lineNumber": 129,
"undocument": true,
"type": {
"types": [
"string"
]
}
},
{
"__docId__": 339,
"kind": "member",
"static": false,
"variation": null,
"name": "isCustom",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#isCustom",
"access": null,
"description": null,
"lineNumber": 137,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 340,
"kind": "member",
"static": false,
"variation": null,
"name": "opts",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#opts",
"access": null,
"description": null,
"lineNumber": 210,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 341,
"kind": "member",
"static": false,
"variation": null,
"name": "optsTxt",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#optsTxt",
"access": null,
"description": null,
"lineNumber": 211,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 342,
"kind": "method",
"static": false,
"variation": null,
"name": "addOptions",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#addOptions",
"access": null,
"description": "Add drop-down options",
"lineNumber": 270,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "slc",
"description": "Select Dom element"
},
{
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"optional": false,
"name": "isLinked",
"description": "Enable linked refresh behaviour"
},
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "excludedOpts",
"description": "Array of excluded options"
}
],
"generator": false
},
{
"__docId__": 343,
"kind": "method",
"static": false,
"variation": null,
"name": "addFirstOption",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#addFirstOption",
"access": null,
"description": "Add drop-down header option",
"lineNumber": 311,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "slc",
"description": "Select DOM element"
}
],
"return": {
"types": [
"*"
]
},
"generator": false
},
{
"__docId__": 344,
"kind": "method",
"static": false,
"variation": null,
"name": "selectOptions",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#selectOptions",
"access": null,
"description": "Select filter options programmatically",
"lineNumber": 336,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "values",
"description": "Array of option values to select"
}
],
"generator": false
},
{
"__docId__": 345,
"kind": "method",
"static": false,
"variation": null,
"name": "getValues",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#getValues",
"access": null,
"description": "Get filter values for a given column index",
"lineNumber": 360,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Array} values Array of selected values"
}
],
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"return": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": "values Array of selected values"
},
"generator": false
},
{
"__docId__": 346,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/modules/dropdown.js~Dropdown",
"longname": "src/modules/dropdown.js~Dropdown#destroy",
"access": null,
"description": null,
"lineNumber": 380,
"undocument": true,
"params": [],
"generator": false
},
{
"__docId__": 347,
"kind": "file",
"static": true,
"variation": null,
"name": "src/modules/gridLayout.js",
"memberof": null,
"longname": "src/modules/gridLayout.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../feature';\nimport {createElm, removeElm, elm, tag} from '../dom';\nimport {isNull} from '../types';\nimport {addEvt, targetEvt} from '../event';\nimport {contains} from '../string';\nimport {NONE} from '../const';\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 {Object} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'gridLayout');\n\n let f = this.config;\n\n /**\n * Grid-layout container width as CSS string\n * @type {String}\n */\n this.width = f.grid_width || null;\n\n /**\n * Grid-layout container height as CSS string\n * @type {String}\n */\n this.height = f.grid_height || null;\n\n /**\n * Css class for main container element\n * @type {String}\n */\n this.mainContCssClass = f.grid_cont_css_class || 'grd_Cont';\n\n /**\n * Css class for body table container element\n * @type {String}\n */\n this.contCssClass = f.grid_tbl_cont_css_class || 'grd_tblCont';\n\n /**\n * Css class for headers table container element\n * @type {String}\n */\n this.headContCssClass = f.grid_tblHead_cont_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 = f.grid_inf_grid_css_class || 'grd_inf';\n\n /**\n * Index of the headers row, default: 0\n * @type {Number}\n */\n this.headRowIndex = f.grid_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 = f.grid_headers_rows || [0];\n\n /**\n * Enable or disable column filters generation, default: true\n * @type {Boolean}\n */\n this.enableFilters = f.grid_enable_default_filters === false ?\n false : true;\n\n /**\n * Enable or disable column headers, default: false\n * @type {Boolean}\n */\n this.noHeaders = Boolean(f.grid_no_headers);\n\n /**\n * Grid-layout default column widht as CSS string\n * @type {String}\n */\n this.defaultColWidth = f.grid_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 main container ID\n * @type {String}\n * @private\n */\n this.prfxMainTblCont = 'gridCont_';\n\n /**\n * Prefix for grid-layout body table container ID\n * @type {String}\n * @private\n */\n this.prfxTblCont = 'tblCont_';\n\n /**\n * Prefix for grid-layout headers table container ID\n * @type {String}\n * @private\n */\n this.prfxHeadTblCont = 'tblHeadCont_';\n\n /**\n * Prefix for grid-layout headers table ID\n * @type {String}\n * @private\n */\n this.prfxHeadTbl = 'tblHead_';\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.tbl.outerHTML;\n\n // filters flag at TF level\n tf.fltGrid = this.enableFilters;\n }\n\n /**\n * Generates a grid with fixed headers\n *\n * TODO: reduce size of init by extracting single purposed methods\n */\n init() {\n let tf = this.tf;\n let f = this.config;\n let tbl = tf.tbl;\n\n if (this.initialized) {\n return;\n }\n\n // Override reference rows indexes\n tf.refRow = isNull(tf.startRow) ? 0 : tf.startRow;\n tf.headersRow = 0;\n tf.filtersRowIndex = 1;\n\n tf.isExternalFlt = true;\n\n // Assign default column widths\n this.setDefaultColWidths();\n\n let tblW;//initial table width\n if (tbl.width !== '') {\n tblW = tbl.width;\n }\n else if (tbl.style.width !== '') {\n tblW = parseInt(tbl.style.width, 10);\n } else {\n tblW = tbl.clientWidth;\n }\n\n //Main container: it will contain all the elements\n this.tblMainCont = createElm('div',\n ['id', this.prfxMainTblCont + tf.id]);\n this.tblMainCont.className = 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 = createElm('div', ['id', this.prfxTblCont + tf.id]);\n this.tblCont.className = this.contCssClass;\n if (this.width) {\n if (this.width.indexOf('%') !== -1) {\n this.tblCont.style.width = '100%';\n } else {\n this.tblCont.style.width = this.width;\n }\n }\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 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 = createElm(\n 'div', ['id', this.prfxHeadTblCont + tf.id]);\n this.headTblCont.className = this.headContCssClass;\n if (this.width) {\n if (this.width.indexOf('%') !== -1) {\n this.headTblCont.style.width = '100%';\n } else {\n this.headTblCont.style.width = this.width;\n }\n }\n\n //Headers table\n this.headTbl = createElm('table', ['id', this.prfxHeadTbl + tf.id]);\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 = [];\n for (let n = 0; n < tf.nbCells; n++) {\n let c = hRow.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\n //Filters row is created\n let filtersRow = createElm('tr');\n if (this.enableFilters && tf.fltGrid) {\n tf.externalFltTgtIds = [];\n for (let j = 0; j < tf.nbCells; 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.externalFltTgtIds[j] = fltTdId;\n }\n }\n\n //Headers row are moved from content table to headers table\n if (!this.noHeaders) {\n for (let i = 0; i < this.headRows.length; i++) {\n let headRow = tbl.rows[this.headRows[i]];\n tH.appendChild(headRow);\n }\n } else {\n // Handle table with no headers, assuming here headers do not\n // exist\n tH.appendChild(createElm('tr'));\n }\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 //Headers table style\n this.headTbl.style.tableLayout = 'fixed';\n tbl.style.tableLayout = 'fixed';\n this.headTbl.cellPadding = tbl.cellPadding;\n this.headTbl.cellSpacing = tbl.cellSpacing;\n // this.headTbl.style.width = tbl.style.width;\n\n //content table without headers needs col widths to be reset\n tf.setColWidths(this.headTbl);\n\n //Headers container width\n // this.headTblCont.style.width = this.tblCont.clientWidth+'px';\n\n tbl.style.width = '';\n //\n this.headTbl.style.width = tbl.clientWidth + 'px';\n //\n\n //scroll synchronisation\n 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 //Configure sort extension if any\n let sort = (f.extensions || []).filter(function (itm) {\n return itm.name === 'sort';\n });\n if (sort.length === 1) {\n sort[0].async_sort = true;\n sort[0].trigger_ids = sortTriggers;\n }\n\n //Cols generation for all browsers excepted IE<=7\n this.tblHasColTag = tag(tbl, 'col').length > 0 ? true : false;\n\n //Col elements are enough to keep column widths after sorting and\n //filtering\n let createColTags = function () {\n for (let k = (tf.nbCells - 1); k >= 0; k--) {\n let col = createElm('col', ['id', tf.id + '_col_' + k]);\n tbl.insertBefore(col, tbl.firstChild);\n col.style.width = tf.colWidths[k];\n this.colElms[k] = col;\n }\n this.tblHasColTag = true;\n };\n\n if (!this.tblHasColTag) {\n createColTags.call(this);\n } else {\n let cols = tag(tbl, 'col');\n for (let ii = 0; ii < tf.nbCells; ii++) {\n cols[ii].setAttribute('id', tf.id + '_col_' + ii);\n cols[ii].style.width = tf.colWidths[ii];\n this.colElms.push(cols[ii]);\n }\n }\n\n if (tf.popupFilters) {\n filtersRow.style.display = NONE;\n }\n\n if (tbl.clientWidth !== this.headTbl.clientWidth) {\n tbl.style.width = this.headTbl.clientWidth + 'px';\n }\n\n this.initialized = true;\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.hasColWidths) {\n return;\n }\n for (let k = 0, len = tf.getCellsNb(); k < len; k++) {\n let colW;\n let cell = tf.tbl.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 tf.hasColWidths = true;\n tf.setColWidths();\n }\n\n /**\n * Removes the grid layout\n */\n destroy() {\n let tf = this.tf;\n let tbl = tf.tbl;\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"
},
{
"__docId__": 348,
"kind": "class",
"static": true,
"variation": null,
"name": "GridLayout",
"memberof": "src/modules/gridLayout.js",
"longname": "src/modules/gridLayout.js~GridLayout",
"access": null,
"export": true,
"importPath": "tablefilter/src/modules/gridLayout.js",
"importStyle": "{GridLayout}",
"description": "Grid layout, table with fixed headers",
"lineNumber": 11,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 349,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#constructor",
"access": null,
"description": "Creates an instance of GridLayout",
"lineNumber": 17,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
],
"generator": false
},
{
"__docId__": 350,
"kind": "member",
"static": false,
"variation": null,
"name": "width",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#width",
"access": null,
"description": "Grid-layout container width as CSS string",
"lineNumber": 26,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 351,
"kind": "member",
"static": false,
"variation": null,
"name": "height",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#height",
"access": null,
"description": "Grid-layout container height as CSS string",
"lineNumber": 32,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 352,
"kind": "member",
"static": false,
"variation": null,
"name": "mainContCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#mainContCssClass",
"access": null,
"description": "Css class for main container element",
"lineNumber": 38,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 353,
"kind": "member",
"static": false,
"variation": null,
"name": "contCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#contCssClass",
"access": null,
"description": "Css class for body table container element",
"lineNumber": 44,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 354,
"kind": "member",
"static": false,
"variation": null,
"name": "headContCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#headContCssClass",
"access": null,
"description": "Css class for headers table container element",
"lineNumber": 50,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 355,
"kind": "member",
"static": false,
"variation": null,
"name": "infDivCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#infDivCssClass",
"access": null,
"description": "Css class for toolbar container element (rows counter, paging etc.)",
"lineNumber": 57,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 356,
"kind": "member",
"static": false,
"variation": null,
"name": "headRowIndex",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#headRowIndex",
"access": null,
"description": "Index of the headers row, default: 0",
"lineNumber": 63,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 357,
"kind": "member",
"static": false,
"variation": null,
"name": "headRows",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#headRows",
"access": null,
"description": "Collection of the header row indexes to be moved into headers table",
"lineNumber": 69,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 358,
"kind": "member",
"static": false,
"variation": null,
"name": "enableFilters",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#enableFilters",
"access": null,
"description": "Enable or disable column filters generation, default: true",
"lineNumber": 75,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 359,
"kind": "member",
"static": false,
"variation": null,
"name": "noHeaders",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#noHeaders",
"access": null,
"description": "Enable or disable column headers, default: false",
"lineNumber": 82,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 360,
"kind": "member",
"static": false,
"variation": null,
"name": "defaultColWidth",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#defaultColWidth",
"access": null,
"description": "Grid-layout default column widht as CSS string",
"lineNumber": 88,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 361,
"kind": "member",
"static": false,
"variation": null,
"name": "colElms",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#colElms",
"access": "private",
"description": "List of column elements",
"lineNumber": 95,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 362,
"kind": "member",
"static": false,
"variation": null,
"name": "prfxMainTblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#prfxMainTblCont",
"access": "private",
"description": "Prefix for grid-layout main container ID",
"lineNumber": 102,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 363,
"kind": "member",
"static": false,
"variation": null,
"name": "prfxTblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#prfxTblCont",
"access": "private",
"description": "Prefix for grid-layout body table container ID",
"lineNumber": 109,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 364,
"kind": "member",
"static": false,
"variation": null,
"name": "prfxHeadTblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#prfxHeadTblCont",
"access": "private",
"description": "Prefix for grid-layout headers table container ID",
"lineNumber": 116,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 365,
"kind": "member",
"static": false,
"variation": null,
"name": "prfxHeadTbl",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#prfxHeadTbl",
"access": "private",
"description": "Prefix for grid-layout headers table ID",
"lineNumber": 123,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 366,
"kind": "member",
"static": false,
"variation": null,
"name": "prfxGridFltTd",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#prfxGridFltTd",
"access": "private",
"description": "Prefix for grid-layout filter's cell ID",
"lineNumber": 130,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 367,
"kind": "member",
"static": false,
"variation": null,
"name": "prfxGridTh",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#prfxGridTh",
"access": "private",
"description": "Prefix for grid-layout header's cell ID",
"lineNumber": 137,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 368,
"kind": "member",
"static": false,
"variation": null,
"name": "sourceTblHtml",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#sourceTblHtml",
"access": "private",
"description": "Mark-up of original HTML table",
"lineNumber": 144,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 369,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#init",
"access": null,
"description": "Generates a grid with fixed headers\n\nTODO: reduce size of init by extracting single purposed methods",
"lineNumber": 155,
"params": [],
"generator": false
},
{
"__docId__": 370,
"kind": "member",
"static": false,
"variation": null,
"name": "tblMainCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#tblMainCont",
"access": null,
"description": null,
"lineNumber": 185,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 371,
"kind": "member",
"static": false,
"variation": null,
"name": "tblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#tblCont",
"access": null,
"description": null,
"lineNumber": 194,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 372,
"kind": "member",
"static": false,
"variation": null,
"name": "headTblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#headTblCont",
"access": null,
"description": null,
"lineNumber": 220,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 373,
"kind": "member",
"static": false,
"variation": null,
"name": "headTbl",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#headTbl",
"access": null,
"description": null,
"lineNumber": 232,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 374,
"kind": "member",
"static": false,
"variation": null,
"name": "tblHasColTag",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#tblHasColTag",
"access": null,
"description": null,
"lineNumber": 339,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 375,
"kind": "member",
"static": false,
"variation": null,
"name": "tblHasColTag",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#tblHasColTag",
"access": null,
"description": null,
"lineNumber": 350,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 376,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#initialized",
"access": null,
"description": null,
"lineNumber": 372,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 377,
"kind": "method",
"static": false,
"variation": null,
"name": "setDefaultColWidths",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#setDefaultColWidths",
"access": "private",
"description": "Set grid-layout default column widths if column widths are not defined",
"lineNumber": 379,
"params": [],
"generator": false
},
{
"__docId__": 378,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#destroy",
"access": null,
"description": "Removes the grid layout",
"lineNumber": 403,
"params": [],
"generator": false
},
{
"__docId__": 379,
"kind": "member",
"static": false,
"variation": null,
"name": "tblMainCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#tblMainCont",
"access": null,
"description": null,
"lineNumber": 414,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 380,
"kind": "member",
"static": false,
"variation": null,
"name": "headTblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#headTblCont",
"access": null,
"description": null,
"lineNumber": 415,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 381,
"kind": "member",
"static": false,
"variation": null,
"name": "headTbl",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#headTbl",
"access": null,
"description": null,
"lineNumber": 416,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 382,
"kind": "member",
"static": false,
"variation": null,
"name": "tblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#tblCont",
"access": null,
"description": null,
"lineNumber": 417,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 383,
"kind": "member",
"static": false,
"variation": null,
"name": "initialized",
"memberof": "src/modules/gridLayout.js~GridLayout",
"longname": "src/modules/gridLayout.js~GridLayout#initialized",
"access": null,
"description": null,
"lineNumber": 423,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 384,
"kind": "file",
"static": true,
"variation": null,
"name": "src/modules/hash.js",
"memberof": null,
"longname": "src/modules/hash.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {addEvt, removeEvt} from '../event';\nimport {root} from '../root';\n\nconst JSON = root.JSON;\nconst location = root.location;\nconst decodeURIComponent = root.decodeURIComponent;\n\nexport const hasHashChange = () => {\n let docMode = root.documentMode;\n return ('onhashchange' in root) && (docMode === undefined || docMode > 7);\n};\n\n/**\n * Manages the URL hash reflecting the features state to be persisted\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 this.state = state;\n this.lastHash = null;\n this.emitter = state.emitter;\n }\n\n /**\n * Initializes the Hash object\n */\n init() {\n if (!hasHashChange()) {\n return;\n }\n\n this.lastHash = location.hash;\n\n this.emitter.on(['state-changed'], (tf, state) => this.update(state));\n this.emitter.on(['initialized'], () => this.sync());\n addEvt(root, 'hashchange', () => this.sync());\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 = `#${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.sync());\n removeEvt(root, 'hashchange', () => this.sync());\n\n this.state = null;\n this.lastHash = null;\n this.emitter = null;\n }\n}\n"
},
{
"__docId__": 385,
"kind": "variable",
"static": true,
"variation": null,
"name": "JSON",
"memberof": "src/modules/hash.js",
"longname": "src/modules/hash.js~JSON",
"access": null,
"export": false,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": null,
"description": null,
"lineNumber": 4,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 386,
"kind": "variable",
"static": true,
"variation": null,
"name": "location",
"memberof": "src/modules/hash.js",
"longname": "src/modules/hash.js~location",
"access": null,
"export": false,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": null,
"description": null,
"lineNumber": 5,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 387,
"kind": "variable",
"static": true,
"variation": null,
"name": "decodeURIComponent",
"memberof": "src/modules/hash.js",
"longname": "src/modules/hash.js~decodeURIComponent",
"access": null,
"export": false,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": null,
"description": null,
"lineNumber": 6,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 388,
"kind": "variable",
"static": true,
"variation": null,
"name": "hasHashChange",
"memberof": "src/modules/hash.js",
"longname": "src/modules/hash.js~hasHashChange",
"access": null,
"export": true,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": "{hasHashChange}",
"description": null,
"lineNumber": 8,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 389,
"kind": "class",
"static": true,
"variation": null,
"name": "Hash",
"memberof": "src/modules/hash.js",
"longname": "src/modules/hash.js~Hash",
"access": null,
"export": true,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": "{Hash}",
"description": "Manages the URL hash reflecting the features state to be persisted",
"lineNumber": 19,
"unknown": [
{
"tagName": "@export",
"tagValue": ""
},
{
"tagName": "@class",
"tagValue": "Hash"
}
],
"interface": false
},
{
"__docId__": 390,
"kind": "constructor",
"static": false,
"variation": null,
"name": "constructor",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#constructor",
"access": null,
"description": "Creates an instance of Hash",
"lineNumber": 26,
"params": [
{
"nullable": null,
"types": [
"State"
],
"spread": false,
"optional": false,
"name": "state",
"description": "Instance of State"
}
],
"generator": false
},
{
"__docId__": 391,
"kind": "member",
"static": false,
"variation": null,
"name": "state",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#state",
"access": null,
"description": null,
"lineNumber": 27,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 392,
"kind": "member",
"static": false,
"variation": null,
"name": "lastHash",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#lastHash",
"access": null,
"description": null,
"lineNumber": 28,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 393,
"kind": "member",
"static": false,
"variation": null,
"name": "emitter",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#emitter",
"access": null,
"description": null,
"lineNumber": 29,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 394,
"kind": "method",
"static": false,
"variation": null,
"name": "init",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#init",
"access": null,
"description": "Initializes the Hash object",
"lineNumber": 35,
"params": [],
"generator": false
},
{
"__docId__": 395,
"kind": "member",
"static": false,
"variation": null,
"name": "lastHash",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#lastHash",
"access": null,
"description": null,
"lineNumber": 40,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 396,
"kind": "method",
"static": false,
"variation": null,
"name": "update",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#update",
"access": null,
"description": "Updates the URL hash based on a state change",
"lineNumber": 52,
"params": [
{
"nullable": null,
"types": [
"State"
],
"spread": false,
"optional": false,
"name": "state",
"description": "Instance of State"
}
],
"generator": false
},
{
"__docId__": 397,
"kind": "member",
"static": false,
"variation": null,
"name": "lastHash",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#lastHash",
"access": null,
"description": null,
"lineNumber": 59,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 398,
"kind": "method",
"static": false,
"variation": null,
"name": "parse",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#parse",
"access": null,
"description": "Converts a URL hash into a state JSON object",
"lineNumber": 68,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Object} JSON object"
}
],
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "hash",
"description": "URL hash fragment"
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": "JSON object"
},
"generator": false
},
{
"__docId__": 399,
"kind": "method",
"static": false,
"variation": null,
"name": "sync",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#sync",
"access": null,
"description": "Applies current hash state to features",
"lineNumber": 79,
"params": [],
"generator": false
},
{
"__docId__": 400,
"kind": "method",
"static": false,
"variation": null,
"name": "destroy",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#destroy",
"access": null,
"description": "Release Hash event subscriptions and clear fields",
"lineNumber": 91,
"params": [],
"generator": false
},
{
"__docId__": 401,
"kind": "member",
"static": false,
"variation": null,
"name": "state",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#state",
"access": null,
"description": null,
"lineNumber": 96,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 402,
"kind": "member",
"static": false,
"variation": null,
"name": "lastHash",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#lastHash",
"access": null,
"description": null,
"lineNumber": 97,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 403,
"kind": "member",
"static": false,
"variation": null,
"name": "emitter",
"memberof": "src/modules/hash.js~Hash",
"longname": "src/modules/hash.js~Hash#emitter",
"access": null,
"description": null,
"lineNumber": 98,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 404,
"kind": "file",
"static": true,
"variation": null,
"name": "src/modules/help.js",
"memberof": null,
"longname": "src/modules/help.js",
"access": null,
"description": null,
"lineNumber": 1,
"content": "import {Feature} from '../feature';\nimport {createElm, createText, elm, removeElm} from '../dom';\nimport {addEvt} from '../event';\nimport {NONE} from '../const';\n\nconst WIKI_URL = 'https://github.com/koalyptus/TableFilter/wiki/' +\n '4.-Filter-operators';\nconst WEBSITE_URL = 'http://koalyptus.github.io/TableFilter/';\n\nexport class Help extends Feature {\n\n /**\n * Help UI component\n * @param {Object} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'help');\n\n var f = this.config;\n\n //id of custom container element for instructions\n this.tgtId = f.help_instructions_target_id || null;\n //id of custom container element for instructions\n this.contTgtId = f.help_instructions_container_target_id ||\n null;\n //defines help text\n this.instrText = f.help_instructions_text ?\n f.help_instructions_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