[
{
"__docId__": 1,
"kind": "external",
"name": "Infinity",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Infinity",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 2,
"kind": "external",
"name": "NaN",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~NaN",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 3,
"kind": "external",
"name": "undefined",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~undefined",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 4,
"kind": "external",
"name": "null",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~null",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 5,
"kind": "external",
"name": "Object",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Object",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 6,
"kind": "external",
"name": "object",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~object",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 7,
"kind": "external",
"name": "Function",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Function",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 8,
"kind": "external",
"name": "function",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~function",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 9,
"kind": "external",
"name": "Boolean",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Boolean",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 10,
"kind": "external",
"name": "boolean",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~boolean",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 11,
"kind": "external",
"name": "Symbol",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Symbol",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 12,
"kind": "external",
"name": "Error",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Error",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 13,
"kind": "external",
"name": "EvalError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~EvalError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 14,
"kind": "external",
"name": "InternalError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~InternalError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 15,
"kind": "external",
"name": "RangeError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~RangeError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 16,
"kind": "external",
"name": "ReferenceError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~ReferenceError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 17,
"kind": "external",
"name": "SyntaxError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~SyntaxError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 18,
"kind": "external",
"name": "TypeError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~TypeError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 19,
"kind": "external",
"name": "URIError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~URIError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 20,
"kind": "external",
"name": "Number",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Number",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 21,
"kind": "external",
"name": "number",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~number",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 22,
"kind": "external",
"name": "Date",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Date",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 23,
"kind": "external",
"name": "String",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~String",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 24,
"kind": "external",
"name": "string",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~string",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 25,
"kind": "external",
"name": "RegExp",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~RegExp",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 26,
"kind": "external",
"name": "Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 27,
"kind": "external",
"name": "Int8Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Int8Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 28,
"kind": "external",
"name": "Uint8Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint8Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 29,
"kind": "external",
"name": "Uint8ClampedArray",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint8ClampedArray",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 30,
"kind": "external",
"name": "Int16Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Int16Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 31,
"kind": "external",
"name": "Uint16Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint16Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 32,
"kind": "external",
"name": "Int32Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Int32Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 33,
"kind": "external",
"name": "Uint32Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint32Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 34,
"kind": "external",
"name": "Float32Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Float32Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 35,
"kind": "external",
"name": "Float64Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Float64Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 36,
"kind": "external",
"name": "Map",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Map",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 37,
"kind": "external",
"name": "Set",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Set",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 38,
"kind": "external",
"name": "WeakMap",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~WeakMap",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 39,
"kind": "external",
"name": "WeakSet",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~WeakSet",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 40,
"kind": "external",
"name": "ArrayBuffer",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~ArrayBuffer",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 41,
"kind": "external",
"name": "DataView",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~DataView",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 42,
"kind": "external",
"name": "JSON",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~JSON",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 43,
"kind": "external",
"name": "Promise",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Promise",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 44,
"kind": "external",
"name": "Generator",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Generator",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 45,
"kind": "external",
"name": "GeneratorFunction",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~GeneratorFunction",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 46,
"kind": "external",
"name": "Reflect",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Reflect",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 47,
"kind": "external",
"name": "Proxy",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Proxy",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 48,
"kind": "file",
"name": "src/array.js",
"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",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/array.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 49,
"kind": "function",
"name": "has",
"memberof": "src/array.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/array.js~has",
"access": "public",
"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": ""
}
},
{
"__docId__": 50,
"kind": "file",
"name": "src/const.js",
"content": "import {DateType} from './modules/dateType';\nimport {Help} from './modules/help';\nimport {State} from './modules/state';\nimport {GridLayout} from './modules/gridLayout';\nimport {Loader} from './modules/loader';\nimport {HighlightKeyword} from './modules/highlightKeywords';\nimport {PopupFilter} from './modules/popupFilter';\nimport {MarkActiveColumns} from './modules/markActiveColumns';\nimport {RowsCounter} from './modules/rowsCounter';\nimport {StatusBar} from './modules/statusBar';\nimport {ClearButton} from './modules/clearButton';\nimport {AlternateRows} from './modules/alternateRows';\nimport {NoResults} from './modules/noResults';\nimport {Paging} from './modules/paging';\nimport {Toolbar} from './modules/toolbar';\n\n/**\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 * Data types\n */\n\n/**\n * String\n * @type {String}\n */\nexport const STRING = 'string';\n\n/**\n * Number\n * @type {String}\n */\nexport const NUMBER = 'number';\n\n/**\n * Formatted number\n * @type {String}\n */\nexport const FORMATTED_NUMBER = 'formatted-number';\n\n/**\n * Date\n * @type {String}\n */\nexport const DATE = 'date';\n\n/**\n * IP address\n * @type {String}\n */\nexport const IP_ADDRESS = 'ipaddress';\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\n/**\n * TableFilter features definitions\n * @type {Object}\n */\nexport const FEATURES = {\n dateType: {\n class: DateType,\n name: 'dateType'\n },\n help: {\n class: Help,\n name: 'help',\n enforce: true\n },\n state: {\n class: State,\n name: 'state'\n },\n markActiveColumns: {\n class: MarkActiveColumns,\n name: 'markActiveColumns'\n },\n gridLayout: {\n class: GridLayout,\n name: 'gridLayout'\n },\n loader: {\n class: Loader,\n name: 'loader'\n },\n highlightKeyword: {\n class: HighlightKeyword,\n name: 'highlightKeyword',\n property: 'highlightKeywords'\n },\n popupFilter: {\n class: PopupFilter,\n name: 'popupFilter',\n property: 'popupFilters'\n },\n rowsCounter: {\n class: RowsCounter,\n name: 'rowsCounter'\n },\n statusBar: {\n class: StatusBar,\n name: 'statusBar'\n },\n clearButton: {\n class: ClearButton,\n name: 'clearButton',\n property: 'btnReset'\n },\n alternateRows: {\n class: AlternateRows,\n name: 'alternateRows'\n },\n noResults: {\n class: NoResults,\n name: 'noResults'\n },\n paging: {\n class: Paging,\n name: 'paging'\n },\n toolbar: {\n class: Toolbar,\n name: 'toolbar',\n enforce: true\n }\n};\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/const.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 51,
"kind": "variable",
"name": "INPUT",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~INPUT",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{INPUT}",
"description": "Input filter type",
"lineNumber": 25,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 52,
"kind": "variable",
"name": "SELECT",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~SELECT",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{SELECT}",
"description": "Select filter type",
"lineNumber": 30,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 53,
"kind": "variable",
"name": "MULTIPLE",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~MULTIPLE",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{MULTIPLE}",
"description": "Multiple select filter type",
"lineNumber": 35,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 54,
"kind": "variable",
"name": "CHECKLIST",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~CHECKLIST",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{CHECKLIST}",
"description": "Checklist filter type",
"lineNumber": 40,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 55,
"kind": "variable",
"name": "NONE",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~NONE",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{NONE}",
"description": "None filter type",
"lineNumber": 45,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 56,
"kind": "variable",
"name": "ENTER_KEY",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~ENTER_KEY",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{ENTER_KEY}",
"description": "Enter key code",
"lineNumber": 55,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 57,
"kind": "variable",
"name": "TAB_KEY",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~TAB_KEY",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{TAB_KEY}",
"description": "Tab key code",
"lineNumber": 60,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 58,
"kind": "variable",
"name": "ESC_KEY",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~ESC_KEY",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{ESC_KEY}",
"description": "Escape key code",
"lineNumber": 65,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 59,
"kind": "variable",
"name": "UP_ARROW_KEY",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~UP_ARROW_KEY",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{UP_ARROW_KEY}",
"description": "Up arrow key code",
"lineNumber": 70,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 60,
"kind": "variable",
"name": "DOWN_ARROW_KEY",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~DOWN_ARROW_KEY",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{DOWN_ARROW_KEY}",
"description": "Down arrow key code",
"lineNumber": 75,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 61,
"kind": "variable",
"name": "HEADER_TAG",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~HEADER_TAG",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{HEADER_TAG}",
"description": "Header cell tag",
"lineNumber": 85,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 62,
"kind": "variable",
"name": "CELL_TAG",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~CELL_TAG",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{CELL_TAG}",
"description": "Cell tag",
"lineNumber": 90,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 63,
"kind": "variable",
"name": "STRING",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~STRING",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{STRING}",
"description": "String",
"lineNumber": 100,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 64,
"kind": "variable",
"name": "NUMBER",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~NUMBER",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{NUMBER}",
"description": "Number",
"lineNumber": 106,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 65,
"kind": "variable",
"name": "FORMATTED_NUMBER",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~FORMATTED_NUMBER",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{FORMATTED_NUMBER}",
"description": "Formatted number",
"lineNumber": 112,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 66,
"kind": "variable",
"name": "DATE",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~DATE",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{DATE}",
"description": "Date",
"lineNumber": 118,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 67,
"kind": "variable",
"name": "IP_ADDRESS",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~IP_ADDRESS",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{IP_ADDRESS}",
"description": "IP address",
"lineNumber": 124,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 68,
"kind": "variable",
"name": "AUTO_FILTER_DELAY",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~AUTO_FILTER_DELAY",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{AUTO_FILTER_DELAY}",
"description": "Auto filter delay in milliseconds",
"lineNumber": 134,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 69,
"kind": "variable",
"name": "FEATURES",
"memberof": "src/const.js",
"static": true,
"longname": "src/const.js~FEATURES",
"access": "public",
"export": true,
"importPath": "tablefilter/src/const.js",
"importStyle": "{FEATURES}",
"description": "TableFilter features definitions",
"lineNumber": 140,
"type": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": null
}
},
{
"__docId__": 70,
"kind": "file",
"name": "src/cookie.js",
"content": "import {root} from './root';\n\n/**\n * Cookie utilities\n */\n\nconst doc = root.document;\n\nexport default {\n\n /**\n * Write a cookie\n * @param {String} name Name of the cookie\n * @param {String} value Value of the cookie\n * @param {Number} hours Cookie duration in hours\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 /**\n * Read a cookie\n * @param {String} name Name of the cookie\n * @returns {String} Value of the cookie\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 /**\n * Remove a cookie\n * @param {String} name Name of the cookie\n */\n remove(name) {\n this.write(name, '', -1);\n }\n\n};\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/cookie.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 71,
"kind": "variable",
"name": "doc",
"memberof": "src/cookie.js",
"static": true,
"longname": "src/cookie.js~doc",
"access": "public",
"export": false,
"importPath": "tablefilter/src/cookie.js",
"importStyle": null,
"description": "Cookie utilities",
"lineNumber": 7,
"type": {
"types": [
"*"
]
},
"ignore": true
},
{
"__docId__": 72,
"kind": "file",
"name": "src/dom.js",
"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 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 {String} id index of check item\n * @param {String} chkValue check item value\n * @param {String} labelText check item label text\n * @param {Array} extraAttr array containing attribute name and its value\n * @return {Object} li DOM element\n */\nexport const createCheckItem = (id, chkValue, labelText, extraAttr = []) => {\n let li = createElm('li');\n let label = createElm('label', ['for', id]);\n let check = createElm('input',\n ['id', id],\n ['name', id],\n ['type', 'checkbox'],\n ['value', chkValue],\n extraAttr\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",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/dom.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 73,
"kind": "variable",
"name": "doc",
"memberof": "src/dom.js",
"static": true,
"longname": "src/dom.js~doc",
"access": "public",
"export": false,
"importPath": "tablefilter/src/dom.js",
"importStyle": null,
"description": "DOM utilities",
"lineNumber": 9,
"type": {
"types": [
"*"
]
},
"ignore": true
},
{
"__docId__": 74,
"kind": "function",
"name": "getText",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~getText",
"access": "public",
"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": ""
}
},
{
"__docId__": 75,
"kind": "function",
"name": "getFirstTextNode",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~getFirstTextNode",
"access": "public",
"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": ""
}
},
{
"__docId__": 76,
"kind": "function",
"name": "createElm",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~createElm",
"access": "public",
"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"
}
},
{
"__docId__": 77,
"kind": "function",
"name": "removeElm",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~removeElm",
"access": "public",
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{removeElm}",
"description": "Removes passed node from DOM",
"lineNumber": 66,
"params": [
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "node",
"description": ""
}
],
"return": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": "old node reference"
}
},
{
"__docId__": 78,
"kind": "function",
"name": "createText",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~createText",
"access": "public",
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{createText}",
"description": "Returns a text node with given text",
"lineNumber": 73,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "txt",
"description": ""
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 79,
"kind": "function",
"name": "hasClass",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~hasClass",
"access": "public",
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{hasClass}",
"description": "Determine whether the passed elements is assigned the given class",
"lineNumber": 81,
"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": ""
}
},
{
"__docId__": 80,
"kind": "function",
"name": "addClass",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~addClass",
"access": "public",
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{addClass}",
"description": "Adds the specified class to the passed element",
"lineNumber": 97,
"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": null
},
{
"__docId__": 81,
"kind": "function",
"name": "removeClass",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~removeClass",
"access": "public",
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{removeClass}",
"description": "Removes the specified class to the passed element",
"lineNumber": 120,
"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": null
},
{
"__docId__": 82,
"kind": "function",
"name": "createOpt",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~createOpt",
"access": "public",
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{createOpt}",
"description": "Creates and returns an option element",
"lineNumber": 140,
"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"
}
},
{
"__docId__": 83,
"kind": "function",
"name": "createCheckItem",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~createCheckItem",
"access": "public",
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{createCheckItem}",
"description": "Creates and returns a checklist item",
"lineNumber": 157,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "id",
"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"
},
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "extraAttr",
"description": "array containing attribute name and its value"
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": "li DOM element"
}
},
{
"__docId__": 84,
"kind": "function",
"name": "elm",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~elm",
"access": "public",
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{elm}",
"description": "Returns the element matching the supplied Id",
"lineNumber": 180,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "id",
"description": "Element identifier"
}
],
"return": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 85,
"kind": "function",
"name": "tag",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~tag",
"access": "public",
"export": true,
"importPath": "tablefilter/src/dom.js",
"importStyle": "{tag}",
"description": "Returns list of element matching the supplied tag name",
"lineNumber": 187,
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "tagname",
"description": "Tag name"
}
],
"return": {
"nullable": null,
"types": [
"NodeList"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 86,
"kind": "function",
"name": "supportsClassList",
"memberof": "src/dom.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/dom.js~supportsClassList",
"access": "public",
"export": false,
"importPath": "tablefilter/src/dom.js",
"importStyle": null,
"description": null,
"lineNumber": 190,
"undocument": true,
"params": [],
"return": {
"types": [
"*"
]
},
"ignore": true
},
{
"__docId__": 87,
"kind": "file",
"name": "src/emitter.js",
"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",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/emitter.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 88,
"kind": "class",
"name": "Emitter",
"memberof": "src/emitter.js",
"static": true,
"longname": "src/emitter.js~Emitter",
"access": "public",
"export": true,
"importPath": "tablefilter/src/emitter.js",
"importStyle": "{Emitter}",
"description": "Event emitter class",
"lineNumber": 4,
"interface": false
},
{
"__docId__": 89,
"kind": "constructor",
"name": "constructor",
"memberof": "src/emitter.js~Emitter",
"generator": false,
"async": false,
"static": false,
"longname": "src/emitter.js~Emitter#constructor",
"access": "public",
"description": "Creates an instance of Emitter.",
"lineNumber": 8
},
{
"__docId__": 90,
"kind": "member",
"name": "events",
"memberof": "src/emitter.js~Emitter",
"static": false,
"longname": "src/emitter.js~Emitter#events",
"access": "public",
"description": "Events object",
"lineNumber": 13,
"type": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": null
}
},
{
"__docId__": 91,
"kind": "method",
"name": "on",
"memberof": "src/emitter.js~Emitter",
"generator": false,
"async": false,
"static": false,
"longname": "src/emitter.js~Emitter#on",
"access": "public",
"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"
}
],
"return": null
},
{
"__docId__": 92,
"kind": "method",
"name": "off",
"memberof": "src/emitter.js~Emitter",
"generator": false,
"async": false,
"static": false,
"longname": "src/emitter.js~Emitter#off",
"access": "public",
"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"
}
],
"return": null
},
{
"__docId__": 93,
"kind": "method",
"name": "emit",
"memberof": "src/emitter.js~Emitter",
"generator": false,
"async": false,
"static": false,
"longname": "src/emitter.js~Emitter#emit",
"access": "public",
"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"
}
],
"return": null
},
{
"__docId__": 94,
"kind": "file",
"name": "src/event.js",
"content": "import {root} from './root';\n\n/**\n * DOM event utilities\n */\n\n/**\n * Add event handler for specified event on passed element\n *\n * @param {DOMElement} obj Element\n * @param {String} type Event type\n * @param {Function} Handler\n * @param {Boolean} capture Specifiy whether the event should be executed in\n * the capturing or in the bubbling phase\n */\nexport const addEvt = (obj, type, func, capture) => {\n if (obj.addEventListener) {\n obj.addEventListener(type, func, capture);\n }\n else if (obj.attachEvent) {\n obj.attachEvent('on' + type, func);\n } else {\n obj['on' + type] = func;\n }\n};\n\n/**\n * Remove event handler for specified event on passed element\n *\n * @param {DOMElement} obj Element\n * @param {String} type Event type\n * @param {Function} Handler\n * @param {Boolean} capture Specifiy whether the event should be executed in\n * the capturing or in the bubbling phase\n */\nexport const removeEvt = (obj, type, func, capture) => {\n if (obj.removeEventListener) {\n obj.removeEventListener(type, func, capture);\n } else if (obj.detachEvent) {\n obj.detachEvent('on' + type, func);\n } else {\n obj['on' + type] = null;\n }\n};\n\n/**\n * Prevents further propagation of the current event in the bubbling phase\n *\n * @param {Event} evt Event on the DOM\n */\nexport const stopEvt = (evt) => {\n if (!evt) {\n evt = root.event;\n }\n if (evt.stopPropagation) {\n evt.stopPropagation();\n } else {\n evt.cancelBubble = true;\n }\n};\n\n/**\n * Cancels the event if it is cancelable, without stopping further\n * propagation of the event.\n *\n * @param {Event} evt Event on the DOM\n */\nexport const cancelEvt = (evt) => {\n if (!evt) {\n evt = root.event;\n }\n if (evt.preventDefault) {\n evt.preventDefault();\n } else {\n evt.returnValue = false;\n }\n};\n\n/**\n * Reference to the object that dispatched the event\n *\n * @param {Event} evt Event on the DOM\n * @returns {DOMElement}\n */\nexport const targetEvt = (evt) => {\n if (!evt) {\n evt = root.event;\n }\n return evt.target || evt.srcElement;\n};\n\n/**\n * Returns the Unicode value of pressed key\n *\n * @param {Event} evt Event on the DOM\n * @returns {Number}\n */\nexport const keyCode = (evt) => {\n return evt.charCode ? evt.charCode :\n (evt.keyCode ? evt.keyCode : (evt.which ? evt.which : 0));\n};\n\n/**\n * Check code of pressed key is one of the expected key codes\n *\n * @param {Event} evt key event\n * @param {Array} keyCodes list of keycodes to check\n */\nexport const isKeyPressed = (evt, keyCodes = []) => {\n return keyCodes.indexOf(keyCode(evt)) !== -1;\n};\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/event.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 95,
"kind": "function",
"name": "addEvt",
"memberof": "src/event.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/event.js~addEvt",
"access": "public",
"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"
}
],
"return": null
},
{
"__docId__": 96,
"kind": "function",
"name": "removeEvt",
"memberof": "src/event.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/event.js~removeEvt",
"access": "public",
"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"
}
],
"return": null
},
{
"__docId__": 97,
"kind": "function",
"name": "stopEvt",
"memberof": "src/event.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/event.js~stopEvt",
"access": "public",
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{stopEvt}",
"description": "Prevents further propagation of the current event in the bubbling phase",
"lineNumber": 51,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": "Event on the DOM"
}
],
"return": null
},
{
"__docId__": 98,
"kind": "function",
"name": "cancelEvt",
"memberof": "src/event.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/event.js~cancelEvt",
"access": "public",
"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": 68,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": "Event on the DOM"
}
],
"return": null
},
{
"__docId__": 99,
"kind": "function",
"name": "targetEvt",
"memberof": "src/event.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/event.js~targetEvt",
"access": "public",
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{targetEvt}",
"description": "Reference to the object that dispatched the event",
"lineNumber": 85,
"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": ""
}
},
{
"__docId__": 100,
"kind": "function",
"name": "keyCode",
"memberof": "src/event.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/event.js~keyCode",
"access": "public",
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{keyCode}",
"description": "Returns the Unicode value of pressed key",
"lineNumber": 98,
"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": ""
}
},
{
"__docId__": 101,
"kind": "function",
"name": "isKeyPressed",
"memberof": "src/event.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/event.js~isKeyPressed",
"access": "public",
"export": true,
"importPath": "tablefilter/src/event.js",
"importStyle": "{isKeyPressed}",
"description": "Check code of pressed key is one of the expected key codes",
"lineNumber": 109,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": "key event"
},
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "keyCodes",
"description": "list of keycodes to check"
}
],
"return": {
"types": [
"*"
]
}
},
{
"__docId__": 102,
"kind": "file",
"name": "src/extensions/advancedGrid/adapterEzEditTable.js",
"content": "import {Feature} from '../../feature';\nimport {tag} from '../../dom';\nimport {INPUT} from '../../const';\nimport {defaultsStr} from '../../settings';\nimport {root} from '../../root';\n\nconst INSTANTIATION_ERROR = `Failed to instantiate EditTable object.\n \\n\"ezEditTable\" dependency not found.`;\n\n/**\n * Adapter module for ezEditTable, an external library providing advanced\n * grid features (selection and edition):\n * http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus\n */\nexport default class AdapterEzEditTable extends Feature {\n\n /**\n * Creates an instance of AdapterEzEditTable\n *\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} cfg Configuration options for ezEditTable library\n */\n constructor(tf, cfg) {\n super(tf, cfg.name);\n\n /**\n * Module description\n * @type {String}\n */\n this.desc = defaultsStr(cfg.description, 'ezEditTable adapter');\n\n /**\n * Filename of ezEditTable library\n * @type {String}\n */\n this.filename = defaultsStr(cfg.filename, 'ezEditTable.js');\n\n /**\n * Path to ezEditTable library\n * @type {String}\n */\n this.vendorPath = cfg.vendor_path;\n\n /**\n * Load ezEditTable stylesheet\n * @type {Boolean}\n */\n this.loadStylesheet = Boolean(cfg.load_stylesheet);\n\n /**\n * Path to ezEditTable stylesheet\n * @type {String}\n */\n this.stylesheet = defaultsStr(cfg.stylesheet,\n this.vendorPath + 'ezEditTable.css');\n\n /**\n * Name of ezEditTable stylesheet\n * @type {String}\n */\n this.stylesheetName = defaultsStr(cfg.stylesheet_name,\n 'ezEditTableCss');\n\n // Enable the ezEditTable's scroll into view behaviour if grid layout on\n cfg.scroll_into_view = cfg.scroll_into_view === false ?\n false : tf.gridLayout;\n\n /**\n * ezEditTable instance\n * @type {EditTable}\n * @private\n */\n this._ezEditTable = null;\n\n /**\n * ezEditTable configuration\n * @private\n */\n this.cfg = cfg;\n\n this.enable();\n }\n\n /**\n * Conditionally load ezEditTable library and set advanced grid\n */\n init() {\n if (this.initialized) {\n return;\n }\n let tf = this.tf;\n if (root.EditTable) {\n this._setAdvancedGrid();\n } else {\n let path = this.vendorPath + this.filename;\n tf.import(this.filename, path, () => this._setAdvancedGrid());\n }\n if (this.loadStylesheet && !tf.isImported(this.stylesheet, 'link')) {\n tf.import(this.stylesheetName, this.stylesheet, null, 'link');\n }\n\n // TODO: hack to prevent ezEditTable enter key event hijaking.\n // Needs to be fixed in the vendor's library\n this.emitter.on(['filter-focus', 'filter-blur'],\n () => this._toggleForInputFilter());\n\n /**\n * @inherited\n */\n this.initialized = true;\n }\n\n /**\n * Instantiate ezEditTable component for advanced grid features\n * @private\n */\n _setAdvancedGrid() {\n let tf = this.tf;\n\n //start row for EditTable constructor needs to be calculated\n let startRow,\n cfg = this.cfg,\n thead = tag(tf.dom(), 'thead');\n\n //if thead exists and startRow not specified, startRow is calculated\n //automatically by EditTable\n if (thead.length > 0 && !cfg.startRow) {\n startRow = undefined;\n }\n //otherwise startRow config property if any or TableFilter refRow\n else {\n startRow = cfg.startRow || tf.refRow;\n }\n\n cfg.base_path = cfg.base_path || tf.basePath + 'ezEditTable/';\n let editable = cfg.editable;\n let selectable = cfg.selection;\n\n if (selectable) {\n cfg.default_selection = cfg.default_selection || 'row';\n }\n //CSS Styles\n cfg.active_cell_css = cfg.active_cell_css || 'ezETSelectedCell';\n\n let _lastValidRowIndex = 0;\n let _lastRowIndex = 0;\n\n if (selectable) {\n //Row navigation needs to be calculated according to TableFilter's\n //validRowsIndex array\n let onAfterSelection = function (et, selectedElm, e) {\n let slc = et.Selection;\n //Next valid filtered row needs to be selected\n let doSelect = function (nextRowIndex) {\n if (et.defaultSelection === 'row') {\n /* eslint-disable */\n slc.SelectRowByIndex(nextRowIndex);\n /* eslint-enable */\n } else {\n /* eslint-disable */\n et.ClearSelections();\n /* eslint-enable */\n let cellIndex = selectedElm.cellIndex,\n row = tf.dom().rows[nextRowIndex];\n if (et.defaultSelection === 'both') {\n /* eslint-disable */\n slc.SelectRowByIndex(nextRowIndex);\n /* eslint-enable */\n }\n if (row) {\n /* eslint-disable */\n slc.SelectCell(row.cells[cellIndex]);\n /* eslint-enable */\n }\n }\n //Table is filtered\n if (tf.validRowsIndex.length !== tf.getRowsNb()) {\n let r = tf.dom().rows[nextRowIndex];\n if (r) {\n r.scrollIntoView(false);\n }\n if (cell) {\n if (cell.cellIndex === (tf.getCellsNb() - 1) &&\n tf.gridLayout) {\n tf.tblCont.scrollLeft = 100000000;\n }\n else if (cell.cellIndex === 0 && tf.gridLayout) {\n tf.tblCont.scrollLeft = 0;\n } else {\n cell.scrollIntoView(false);\n }\n }\n }\n };\n\n //table is not filtered\n if (!tf.validRowsIndex) {\n return;\n }\n let validIndexes = tf.validRowsIndex,\n validIdxLen = validIndexes.length,\n row = et.defaultSelection !== 'row' ?\n selectedElm.parentNode : selectedElm,\n //cell for default_selection = 'both' or 'cell'\n cell = selectedElm.nodeName === 'TD' ? selectedElm : null,\n /* eslint-disable */\n keyCode = e !== undefined ? et.Event.GetKey(e) : 0,\n /* eslint-enable */\n isRowValid = validIndexes.indexOf(row.rowIndex) !== -1,\n nextRowIndex,\n paging = tf.feature('paging'),\n //pgup/pgdown keys\n d = keyCode === 34 || keyCode === 33 ?\n (paging && paging.pageLength || et.nbRowsPerPage) :\n 1;\n\n //If next row is not valid, next valid filtered row needs to be\n //calculated\n if (!isRowValid) {\n //Selection direction up/down\n if (row.rowIndex > _lastRowIndex) {\n //last row\n if (row.rowIndex >= validIndexes[validIdxLen - 1]) {\n nextRowIndex = validIndexes[validIdxLen - 1];\n } else {\n let calcRowIndex = (_lastValidRowIndex + d);\n if (calcRowIndex > (validIdxLen - 1)) {\n nextRowIndex = validIndexes[validIdxLen - 1];\n } else {\n nextRowIndex = validIndexes[calcRowIndex];\n }\n }\n } else {\n //first row\n if (row.rowIndex <= validIndexes[0]) {\n nextRowIndex = validIndexes[0];\n } else {\n let v = validIndexes[_lastValidRowIndex - d];\n nextRowIndex = v ? v : validIndexes[0];\n }\n }\n _lastRowIndex = row.rowIndex;\n doSelect(nextRowIndex);\n } else {\n //If filtered row is valid, special calculation for\n //pgup/pgdown keys\n if (keyCode !== 34 && keyCode !== 33) {\n _lastValidRowIndex = validIndexes.indexOf(row.rowIndex);\n _lastRowIndex = row.rowIndex;\n } else {\n if (keyCode === 34) { //pgdown\n //last row\n if ((_lastValidRowIndex + d) <= (validIdxLen - 1)) {\n nextRowIndex = validIndexes[\n _lastValidRowIndex + d];\n } else {\n nextRowIndex = [validIdxLen - 1];\n }\n } else { //pgup\n //first row\n if ((_lastValidRowIndex - d) <= validIndexes[0]) {\n nextRowIndex = validIndexes[0];\n } else {\n nextRowIndex = validIndexes[\n _lastValidRowIndex - d];\n }\n }\n _lastRowIndex = nextRowIndex;\n _lastValidRowIndex = validIndexes.indexOf(nextRowIndex);\n doSelect(nextRowIndex);\n }\n }\n };\n\n //Page navigation has to be enforced whenever selected row is out of\n //the current page range\n let onBeforeSelection = function (et, selectedElm) {\n let row = et.defaultSelection !== 'row' ?\n selectedElm.parentNode : selectedElm;\n if (tf.paging) {\n if (tf.feature('paging').nbPages > 1) {\n let paging = tf.feature('paging');\n //page length is re-assigned in case it has changed\n et.nbRowsPerPage = paging.pageLength;\n let validIndexes = tf.validRowsIndex,\n validIdxLen = validIndexes.length,\n pagingEndRow = parseInt(paging.startPagingRow, 10) +\n parseInt(paging.pageLength, 10);\n let rowIndex = row.rowIndex;\n\n if ((rowIndex === validIndexes[validIdxLen - 1]) &&\n paging.currentPageNb !== paging.nbPages) {\n paging.setPage('last');\n }\n else if ((rowIndex === validIndexes[0]) &&\n paging.currentPageNb !== 1) {\n paging.setPage('first');\n }\n else if (rowIndex > validIndexes[pagingEndRow - 1] &&\n rowIndex < validIndexes[validIdxLen - 1]) {\n paging.setPage('next');\n }\n else if (\n rowIndex < validIndexes[paging.startPagingRow] &&\n rowIndex > validIndexes[0]) {\n paging.setPage('previous');\n }\n }\n }\n };\n\n //Selected row needs to be visible when paging is activated\n if (tf.paging) {\n tf.feature('paging').onAfterChangePage = function (paging) {\n let advGrid = paging.tf.extension('advancedGrid');\n let et = advGrid._ezEditTable;\n let slc = et.Selection;\n /* eslint-disable */\n let row = slc.GetActiveRow();\n /* eslint-enable */\n if (row) {\n row.scrollIntoView(false);\n }\n /* eslint-disable */\n let cell = slc.GetActiveCell();\n /* eslint-enable */\n if (cell) {\n cell.scrollIntoView(false);\n }\n };\n }\n\n //Rows navigation when rows are filtered is performed with the\n //EditTable row selection callback events\n if (cfg.default_selection === 'row') {\n let fnB = cfg.on_before_selected_row;\n cfg.on_before_selected_row = function () {\n var args = arguments;\n onBeforeSelection(args[0], args[1], args[2]);\n if (fnB) {\n fnB.call(null, args[0], args[1], args[2]);\n }\n };\n let fnA = cfg.on_after_selected_row;\n cfg.on_after_selected_row = function () {\n var args = arguments;\n onAfterSelection(args[0], args[1], args[2]);\n if (fnA) {\n fnA.call(null, args[0], args[1], args[2]);\n }\n };\n } else {\n let fnD = cfg.on_before_selected_cell;\n cfg.on_before_selected_cell = function () {\n var args = arguments;\n onBeforeSelection(args[0], args[1], args[2]);\n if (fnD) {\n fnD.call(null, args[0], args[1], args[2]);\n }\n };\n let fnC = cfg.on_after_selected_cell;\n cfg.on_after_selected_cell = function () {\n var args = arguments;\n onAfterSelection(args[0], args[1], args[2]);\n if (fnC) {\n fnC.call(null, args[0], args[1], args[2]);\n }\n };\n }\n }\n if (editable) {\n //Added or removed rows, TF rows number needs to be re-calculated\n let fnE = cfg.on_added_dom_row;\n cfg.on_added_dom_row = function () {\n var args = arguments;\n tf.nbFilterableRows++;\n if (!tf.paging) {\n tf.emitter.emit('rows-changed', tf, this);\n } else {\n tf.nbFilterableRows++;\n tf.paging = false;\n tf.feature('paging').destroy();\n tf.feature('paging').reset();\n }\n if (tf.alternateRows) {\n tf.feature('alternateRows').init();\n }\n if (fnE) {\n fnE.call(null, args[0], args[1], args[2]);\n }\n };\n if (cfg.actions && cfg.actions['delete']) {\n let fnF = cfg.actions['delete'].on_after_submit;\n cfg.actions['delete'].on_after_submit = function () {\n var args = arguments;\n tf.nbFilterableRows--;\n if (!tf.paging) {\n tf.emitter.emit('rows-changed', tf, this);\n } else {\n tf.nbFilterableRows--;\n tf.paging = false;\n tf.feature('paging').destroy();\n tf.feature('paging').reset(false);\n }\n if (tf.alternateRows) {\n tf.feature('alternateRows').init();\n }\n if (fnF) {\n fnF.call(null, args[0], args[1]);\n }\n };\n }\n }\n\n try {\n /* eslint-disable */\n this._ezEditTable = new EditTable(tf.id, cfg, startRow);\n this._ezEditTable.Init();\n /* eslint-enable */\n } catch (e) { throw new Error(INSTANTIATION_ERROR); }\n\n this.initialized = true;\n }\n\n /**\n * Reset advanced grid when previously removed\n */\n reset() {\n let ezEditTable = this._ezEditTable;\n if (ezEditTable) {\n if (this.cfg.selection) {\n /* eslint-disable */\n ezEditTable.Selection.Set();\n /* eslint-enable */\n }\n if (this.cfg.editable) {\n /* eslint-disable */\n ezEditTable.Editable.Set();\n /* eslint-enable */\n }\n }\n }\n\n /**\n * Toggle behaviour\n */\n toggle() {\n let ezEditTable = this._ezEditTable;\n if (ezEditTable.editable) {\n /* eslint-disable */\n ezEditTable.Editable.Remove();\n /* eslint-enable */\n } else {\n /* eslint-disable */\n ezEditTable.Editable.Set();\n /* eslint-enable */\n }\n if (ezEditTable.selection) {\n /* eslint-disable */\n ezEditTable.Selection.Remove();\n /* eslint-enable */\n } else {\n /* eslint-disable */\n ezEditTable.Selection.Set();\n /* eslint-enable */\n }\n }\n\n _toggleForInputFilter() {\n let tf = this.tf;\n if (!tf.getActiveFilterId()) {\n return;\n }\n let colIndex = tf.getColumnIndexFromFilterId(tf.getActiveFilterId());\n let filterType = tf.getFilterType(colIndex);\n if (filterType === INPUT) {\n this.toggle();\n }\n }\n\n /**\n * Remove advanced grid\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n let ezEditTable = this._ezEditTable;\n if (ezEditTable) {\n if (this.cfg.selection) {\n /* eslint-disable */\n ezEditTable.Selection.ClearSelections();\n ezEditTable.Selection.Remove();\n /* eslint-enable */\n }\n if (this.cfg.editable) {\n /* eslint-disable */\n ezEditTable.Editable.Remove();\n /* eslint-enable */\n }\n }\n\n this.emitter.off(['filter-focus', 'filter-blur'],\n () => this._toggleForInputFilter());\n this.initialized = false;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/extensions/advancedGrid/adapterEzEditTable.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 103,
"kind": "variable",
"name": "INSTANTIATION_ERROR",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js",
"static": true,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~INSTANTIATION_ERROR",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/advancedGrid/adapterEzEditTable.js",
"importStyle": null,
"description": null,
"lineNumber": 7,
"undocument": true,
"type": {
"types": [
"string"
]
},
"ignore": true
},
{
"__docId__": 104,
"kind": "class",
"name": "AdapterEzEditTable",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js",
"static": true,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"access": "public",
"export": true,
"importPath": "tablefilter/src/extensions/advancedGrid/adapterEzEditTable.js",
"importStyle": "AdapterEzEditTable",
"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": 15,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 105,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#constructor",
"access": "public",
"description": "Creates an instance of AdapterEzEditTable",
"lineNumber": 23,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "cfg",
"description": "Configuration options for ezEditTable library"
}
]
},
{
"__docId__": 106,
"kind": "member",
"name": "desc",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#desc",
"access": "public",
"description": "Module description",
"lineNumber": 30,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 107,
"kind": "member",
"name": "filename",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#filename",
"access": "public",
"description": "Filename of ezEditTable library",
"lineNumber": 36,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 108,
"kind": "member",
"name": "vendorPath",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#vendorPath",
"access": "public",
"description": "Path to ezEditTable library",
"lineNumber": 42,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 109,
"kind": "member",
"name": "loadStylesheet",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#loadStylesheet",
"access": "public",
"description": "Load ezEditTable stylesheet",
"lineNumber": 48,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 110,
"kind": "member",
"name": "stylesheet",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#stylesheet",
"access": "public",
"description": "Path to ezEditTable stylesheet",
"lineNumber": 54,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 111,
"kind": "member",
"name": "stylesheetName",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#stylesheetName",
"access": "public",
"description": "Name of ezEditTable stylesheet",
"lineNumber": 61,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 112,
"kind": "member",
"name": "_ezEditTable",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_ezEditTable",
"access": "private",
"description": "ezEditTable instance",
"lineNumber": 73,
"type": {
"nullable": null,
"types": [
"EditTable"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 113,
"kind": "member",
"name": "cfg",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#cfg",
"access": "private",
"description": "ezEditTable configuration",
"lineNumber": 79,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 114,
"kind": "method",
"name": "init",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#init",
"access": "public",
"description": "Conditionally load ezEditTable library and set advanced grid",
"lineNumber": 87,
"params": [],
"return": null
},
{
"__docId__": 115,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#initialized",
"access": "public",
"description": "",
"lineNumber": 110,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 116,
"kind": "method",
"name": "_setAdvancedGrid",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_setAdvancedGrid",
"access": "private",
"description": "Instantiate ezEditTable component for advanced grid features",
"lineNumber": 117,
"ignore": true,
"params": [],
"return": null
},
{
"__docId__": 119,
"kind": "method",
"name": "reset",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#reset",
"access": "public",
"description": "Reset advanced grid when previously removed",
"lineNumber": 428,
"params": [],
"return": null
},
{
"__docId__": 120,
"kind": "method",
"name": "toggle",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#toggle",
"access": "public",
"description": "Toggle behaviour",
"lineNumber": 447,
"params": [],
"return": null
},
{
"__docId__": 121,
"kind": "method",
"name": "_toggleForInputFilter",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#_toggleForInputFilter",
"access": "private",
"description": null,
"lineNumber": 469,
"undocument": true,
"ignore": true,
"params": [],
"return": null
},
{
"__docId__": 122,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/advancedGrid/adapterEzEditTable.js~AdapterEzEditTable#destroy",
"access": "public",
"description": "Remove advanced grid",
"lineNumber": 484,
"params": [],
"return": null
},
{
"__docId__": 124,
"kind": "file",
"name": "src/extensions/advancedGrid/advancedGrid.js",
"content": "import AdapterEzEditTable from './adapterEzEditTable';\n\nexport default AdapterEzEditTable;",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/extensions/advancedGrid/advancedGrid.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 125,
"kind": "file",
"name": "src/extensions/colOps/colOps.js",
"content": "import {Feature} from '../../feature';\nimport {createText, elm} from '../../dom';\nimport {isArray, isEmpty, EMPTY_FN} from '../../types';\nimport {numSortAsc} from '../../sort';\nimport {FORMATTED_NUMBER} from '../../const';\nimport formatNumber from 'format-number';\nimport {defaultsFn, defaultsArr} from '../../settings';\n\nconst EVENTS = [\n 'after-filtering',\n 'after-page-change',\n 'after-page-length-change'\n];\n\nconst SUM = 'sum';\nconst MEAN = 'mean';\nconst MIN = 'min';\nconst MAX = 'max';\nconst MEDIAN = 'median';\nconst Q1 = 'q1';\nconst Q3 = 'q3';\n\n/**\n * Column calculations extension\n */\nexport default class ColOps extends Feature {\n\n /**\n * Creates an instance of ColOps\n *\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} opts Configuration object\n */\n constructor(tf, opts) {\n super(tf, opts.name);\n\n /**\n * Callback fired before columns operations start\n * @type {Function}\n */\n this.onBeforeOperation = defaultsFn(opts.on_before_operation, EMPTY_FN);\n\n /**\n * Callback fired after columns operations are completed\n * @type {Function}\n */\n this.onAfterOperation = defaultsFn(opts.on_after_operation, EMPTY_FN);\n\n /**\n * Configuration options\n * @type {Object}\n */\n this.opts = opts;\n\n /**\n * List of DOM element IDs containing column's calculation result\n * @type {Array}\n */\n this.labelIds = defaultsArr(opts.id, []);\n\n /**\n * List of columns' indexes for calculations\n * @type {Array}\n */\n this.colIndexes = defaultsArr(opts.col, []);\n\n /**\n * List of operations - possible values: 'sum', 'mean', 'min', 'max',\n * 'median', 'q1', 'q3'\n * @type {Array}\n */\n this.operations = defaultsArr(opts.operation, []);\n\n /**\n * List of write methods used to write the result - possible values:\n * 'innerHTML', 'setValue', 'createTextNode'\n * @type {Array}\n */\n this.outputTypes = defaultsArr(opts.write_method, []);\n\n /**\n * List of format objects used for formatting the result -\n * refer to https://github.com/componitable/format-number to check\n * configuration options\n * @type {Array}\n */\n this.formatResults = defaultsArr(opts.format_result, []);\n\n /**\n * List of row indexes displaying the results\n * @type {Array}\n */\n this.totRowIndexes = defaultsArr(opts.tot_row_index, []);\n\n /**\n * List of row indexes excluded from calculations\n * @type {Array}\n */\n this.excludeRows = defaultsArr(opts.exclude_row, []);\n\n /**\n * List of decimal precision for calculation results\n * @type {Array}\n */\n this.decimalPrecisions = defaultsArr(opts.decimal_precision, 2);\n\n this.enable();\n }\n\n /**\n * Initializes ColOps instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n // subscribe to events\n this.emitter.on(EVENTS, () => this.calcAll());\n\n this.calcAll();\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Calculates columns' values\n * Configuration options are stored in 'opts' property\n * - 'id' contains ids of elements showing result (array)\n * - 'col' contains the columns' indexes (array)\n * - 'operation' contains operation type (array, values: 'sum', 'mean',\n * 'min', 'max', 'median', 'q1', 'q3')\n * - 'write_method' array defines which method to use for displaying the\n * result (innerHTML, setValue, createTextNode) - default: 'innerHTML'\n * - 'tot_row_index' defines in which row results are displayed\n * (integers array)\n *\n * - changes made by Nuovella:\n * (1) optimized the routine (now it will only process each column once),\n * (2) added calculations for the median, lower and upper quartile.\n */\n calcAll() {\n let tf = this.tf;\n if (!tf.isInitialized()) {\n return;\n }\n\n this.onBeforeOperation(tf, this);\n this.emitter.emit('before-column-operation', tf, this);\n\n let { colIndexes, operations: colOperations, outputTypes,\n totRowIndexes, excludeRows, formatResults,\n decimalPrecisions } = this;\n\n //nuovella: determine unique list of columns to operate on\n let uIndexes = [];\n colIndexes.forEach((val) => {\n if (uIndexes.indexOf(val) === -1) {\n uIndexes.push(val);\n }\n });\n\n let nbCols = uIndexes.length,\n rows = tf.dom().rows,\n colValues = [];\n\n for (let u = 0; u < nbCols; u++) {\n //this retrieves col values\n //use uIndexes because we only want to pass through this loop\n //once for each column get the values in this unique column\n colValues.push(\n tf.getVisibleColumnData(uIndexes[u], false, excludeRows)\n );\n\n let curValues = colValues[u];\n\n //next: calculate all operations for this column\n let result = 0,\n operations = [],\n precisions = [],\n labels = [],\n writeType,\n formatResult = [],\n idx = 0;\n\n for (let k = 0; k < colIndexes.length; k++) {\n if (colIndexes[k] !== uIndexes[u]) {\n continue;\n }\n operations[idx] = (colOperations[k] || 'sum').toLowerCase();\n precisions[idx] = decimalPrecisions[k];\n labels[idx] = this.labelIds[k];\n writeType = isArray(outputTypes) ? outputTypes[k] : null;\n formatResult[idx] =\n this.configureFormat(uIndexes[u], formatResults[k]);\n idx++;\n }\n\n for (let i = 0; i < idx; i++) {\n // emit values before column calculation\n this.emitter.emit(\n 'before-column-calc',\n tf,\n this,\n uIndexes[u],\n curValues,\n operations[i],\n precisions[i]\n );\n\n result = Number(this.calc(curValues, operations[i], null));\n\n // emit column calculation result\n this.emitter.emit(\n 'column-calc',\n tf,\n this,\n uIndexes[u],\n result,\n operations[i],\n precisions[i]\n );\n\n // write result in expected DOM element\n this.writeResult(\n result,\n labels[i],\n writeType,\n precisions[i],\n formatResult[i]\n );\n\n }//for i\n\n // row(s) with result are always visible\n let totRow = totRowIndexes && totRowIndexes[u] ?\n rows[totRowIndexes[u]] : null;\n if (totRow) {\n totRow.style.display = '';\n }\n }//for u\n\n this.onAfterOperation(tf, this);\n this.emitter.emit('after-column-operation', tf, this);\n }\n\n /**\n * Make desired calculation on specified column.\n * @param {Number} colIndex Column index\n * @param {String} [operation=SUM] Operation type\n * @param {Number} precision Decimal precision\n * @returns {Number}\n */\n columnCalc(colIndex, operation = SUM, precision) {\n let excludeRows = this.excludeRows || [];\n let colValues = tf.getVisibleColumnData(colIndex, false, excludeRows);\n\n return Number(this.calc(colValues, operation, precision));\n }\n\n /**\n * Make calculation on passed values.\n * @param {Array} values List of values\n * @param {String} [operation=SUM] Optional operation type\n * @param {Number} precision Optional result precision\n * @returns {Number}\n * @private\n */\n calc(colValues, operation = SUM, precision) {\n let result = 0;\n\n if (operation === Q1 || operation === Q3 || operation === MEDIAN) {\n colValues = this.sortColumnValues(colValues, numSortAsc);\n }\n\n switch (operation) {\n case MEAN:\n result = this.calcMean(colValues);\n break;\n case SUM:\n result = this.calcSum(colValues);\n break;\n case MIN:\n result = this.calcMin(colValues);\n break;\n case MAX:\n result = this.calcMax(colValues);\n break;\n case MEDIAN:\n result = this.calcMedian(colValues);\n break;\n case Q1:\n result = this.calcQ1(colValues);\n break;\n case Q3:\n result = this.calcQ3(colValues);\n break;\n }\n\n return isEmpty(precision) ? result : result.toFixed(precision);\n }\n\n /**\n * Calculate the sum of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcSum(values = []) {\n if (isEmpty(values)) {\n return 0;\n }\n let result = values.reduce((x, y) => Number(x) + Number(y));\n return result;\n }\n\n /**\n * Calculate the mean of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcMean(values = []) {\n let result = this.calcSum(values) / values.length;\n return Number(result);\n }\n\n /**\n * Calculate the max value of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcMax(values = []) {\n return Math.max.apply(null, values);\n }\n\n /**\n * Calculate the min value of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcMin(values = []) {\n return Math.min.apply(null, values);\n }\n\n /**\n * Calculate the median of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcMedian(values = []) {\n let nbValues = values.length;\n let aux = 0;\n if (nbValues % 2 === 1) {\n aux = Math.floor(nbValues / 2);\n return Number(values[aux]);\n }\n return (Number(values[nbValues / 2]) +\n Number(values[((nbValues / 2) - 1)])) / 2;\n }\n\n /**\n * Calculate the lower quartile of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcQ1(values = []) {\n let nbValues = values.length;\n let posa = 0.0;\n posa = Math.floor(nbValues / 4);\n if (4 * posa === nbValues) {\n return (Number(values[posa - 1]) +\n Number(values[posa])) / 2;\n }\n return Number(values[posa]);\n }\n\n /**\n * Calculate the upper quartile of passed values.\n * @param {Array} [values=[]] List of values\n * @returns {Number}\n */\n calcQ3(values = []) {\n let nbValues = values.length;\n let posa = 0.0;\n let posb = 0.0;\n posa = Math.floor(nbValues / 4);\n if (4 * posa === nbValues) {\n posb = 3 * posa;\n return (Number(values[posb]) +\n Number(values[posb - 1])) / 2;\n }\n return Number(values[nbValues - posa - 1]);\n }\n\n /**\n * Sort passed values with supplied sorter function.\n * @param {Array} [values=[]] List of values to be sorted\n * @param {Function} sorter Sorter function\n * @returns {Array}\n */\n sortColumnValues(values = [], sorter) {\n return values.sort(sorter);\n }\n\n /**\n * Write calculation result in passed DOM element with supplied write method\n * and decimal precision.\n * @param {Number} [result=0] Calculation result\n * @param {DOMElement} label DOM element\n * @param {String} [writeType='innerhtml'] Write method\n * @param {Number} [precision=2] Applied decimal precision\n * @private\n */\n writeResult(result = 0, label, writeType = 'innerhtml',\n precision = 2, format = {}) {\n let labelElm = elm(label);\n\n if (!labelElm) {\n return;\n }\n\n result = result.toFixed(precision);\n if (isNaN(result) || !isFinite(result)) {\n result = '';\n } else {\n result = formatNumber(format)(result);\n }\n\n switch (writeType.toLowerCase()) {\n case 'innerhtml':\n labelElm.innerHTML = result;\n break;\n case 'setvalue':\n labelElm.value = result;\n break;\n case 'createtextnode':\n let oldNode = labelElm.firstChild;\n let txtNode = createText(result);\n labelElm.replaceChild(txtNode, oldNode);\n break;\n }\n }\n\n /**\n * Configure the format options used to format the operation result based\n * on column type.\n * @param {Number} colIndex Column index\n * @param {Object} [format={}] Format object\n * @returns {Object}\n * @private\n */\n configureFormat(colIndex, format = {}) {\n let tf = this.tf;\n if (tf.hasType(colIndex, [FORMATTED_NUMBER])) {\n let colType = tf.colTypes[colIndex];\n if (colType.decimal && !format.decimal) {\n format.decimal = colType.decimal;\n }\n if (colType.thousands && !format.integerSeparator) {\n format.integerSeparator = colType.thousands;\n }\n } else {\n format.decimal = format.decimal || '';\n format.integerSeparator = format.integerSeparator || '';\n }\n return format;\n }\n\n /** Remove extension */\n destroy() {\n if (!this.initialized) {\n return;\n }\n // unsubscribe to events\n this.emitter.off(EVENTS, () => this.calcAll());\n\n this.initialized = false;\n }\n\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/extensions/colOps/colOps.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 126,
"kind": "variable",
"name": "EVENTS",
"memberof": "src/extensions/colOps/colOps.js",
"static": true,
"longname": "src/extensions/colOps/colOps.js~EVENTS",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": null,
"description": null,
"lineNumber": 9,
"undocument": true,
"type": {
"types": [
"string[]"
]
},
"ignore": true
},
{
"__docId__": 127,
"kind": "variable",
"name": "SUM",
"memberof": "src/extensions/colOps/colOps.js",
"static": true,
"longname": "src/extensions/colOps/colOps.js~SUM",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": null,
"description": null,
"lineNumber": 15,
"undocument": true,
"type": {
"types": [
"string"
]
},
"ignore": true
},
{
"__docId__": 128,
"kind": "variable",
"name": "MEAN",
"memberof": "src/extensions/colOps/colOps.js",
"static": true,
"longname": "src/extensions/colOps/colOps.js~MEAN",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": null,
"description": null,
"lineNumber": 16,
"undocument": true,
"type": {
"types": [
"string"
]
},
"ignore": true
},
{
"__docId__": 129,
"kind": "variable",
"name": "MIN",
"memberof": "src/extensions/colOps/colOps.js",
"static": true,
"longname": "src/extensions/colOps/colOps.js~MIN",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": null,
"description": null,
"lineNumber": 17,
"undocument": true,
"type": {
"types": [
"string"
]
},
"ignore": true
},
{
"__docId__": 130,
"kind": "variable",
"name": "MAX",
"memberof": "src/extensions/colOps/colOps.js",
"static": true,
"longname": "src/extensions/colOps/colOps.js~MAX",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": null,
"description": null,
"lineNumber": 18,
"undocument": true,
"type": {
"types": [
"string"
]
},
"ignore": true
},
{
"__docId__": 131,
"kind": "variable",
"name": "MEDIAN",
"memberof": "src/extensions/colOps/colOps.js",
"static": true,
"longname": "src/extensions/colOps/colOps.js~MEDIAN",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": null,
"description": null,
"lineNumber": 19,
"undocument": true,
"type": {
"types": [
"string"
]
},
"ignore": true
},
{
"__docId__": 132,
"kind": "variable",
"name": "Q1",
"memberof": "src/extensions/colOps/colOps.js",
"static": true,
"longname": "src/extensions/colOps/colOps.js~Q1",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": null,
"description": null,
"lineNumber": 20,
"undocument": true,
"type": {
"types": [
"string"
]
},
"ignore": true
},
{
"__docId__": 133,
"kind": "variable",
"name": "Q3",
"memberof": "src/extensions/colOps/colOps.js",
"static": true,
"longname": "src/extensions/colOps/colOps.js~Q3",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": null,
"description": null,
"lineNumber": 21,
"undocument": true,
"type": {
"types": [
"string"
]
},
"ignore": true
},
{
"__docId__": 134,
"kind": "class",
"name": "ColOps",
"memberof": "src/extensions/colOps/colOps.js",
"static": true,
"longname": "src/extensions/colOps/colOps.js~ColOps",
"access": "public",
"export": true,
"importPath": "tablefilter/src/extensions/colOps/colOps.js",
"importStyle": "ColOps",
"description": "Column calculations extension",
"lineNumber": 26,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 135,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#constructor",
"access": "public",
"description": "Creates an instance of ColOps",
"lineNumber": 34,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "opts",
"description": "Configuration object"
}
]
},
{
"__docId__": 136,
"kind": "member",
"name": "onBeforeOperation",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#onBeforeOperation",
"access": "public",
"description": "Callback fired before columns operations start",
"lineNumber": 41,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 137,
"kind": "member",
"name": "onAfterOperation",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#onAfterOperation",
"access": "public",
"description": "Callback fired after columns operations are completed",
"lineNumber": 47,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 138,
"kind": "member",
"name": "opts",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#opts",
"access": "public",
"description": "Configuration options",
"lineNumber": 53,
"type": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": null
}
},
{
"__docId__": 139,
"kind": "member",
"name": "labelIds",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#labelIds",
"access": "public",
"description": "List of DOM element IDs containing column's calculation result",
"lineNumber": 59,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 140,
"kind": "member",
"name": "colIndexes",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#colIndexes",
"access": "public",
"description": "List of columns' indexes for calculations",
"lineNumber": 65,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 141,
"kind": "member",
"name": "operations",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#operations",
"access": "public",
"description": "List of operations - possible values: 'sum', 'mean', 'min', 'max',\n'median', 'q1', 'q3'",
"lineNumber": 72,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 142,
"kind": "member",
"name": "outputTypes",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#outputTypes",
"access": "public",
"description": "List of write methods used to write the result - possible values:\n'innerHTML', 'setValue', 'createTextNode'",
"lineNumber": 79,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 143,
"kind": "member",
"name": "formatResults",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#formatResults",
"access": "public",
"description": "List of format objects used for formatting the result -\nrefer to https://github.com/componitable/format-number to check\nconfiguration options",
"lineNumber": 87,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 144,
"kind": "member",
"name": "totRowIndexes",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#totRowIndexes",
"access": "public",
"description": "List of row indexes displaying the results",
"lineNumber": 93,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 145,
"kind": "member",
"name": "excludeRows",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#excludeRows",
"access": "public",
"description": "List of row indexes excluded from calculations",
"lineNumber": 99,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 146,
"kind": "member",
"name": "decimalPrecisions",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#decimalPrecisions",
"access": "public",
"description": "List of decimal precision for calculation results",
"lineNumber": 105,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 147,
"kind": "method",
"name": "init",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#init",
"access": "public",
"description": "Initializes ColOps instance",
"lineNumber": 113,
"params": [],
"return": null
},
{
"__docId__": 148,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#initialized",
"access": "public",
"description": null,
"lineNumber": 123,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 149,
"kind": "method",
"name": "calcAll",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#calcAll",
"access": "public",
"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": 142,
"params": [],
"return": null
},
{
"__docId__": 150,
"kind": "method",
"name": "columnCalc",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#columnCalc",
"access": "public",
"description": "Make desired calculation on specified column.",
"lineNumber": 254,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": true,
"defaultValue": "SUM",
"defaultRaw": "SUM",
"name": "operation",
"description": "Operation type"
},
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "precision",
"description": "Decimal precision"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 151,
"kind": "method",
"name": "calc",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#calc",
"access": "private",
"description": "Make calculation on passed values.",
"lineNumber": 269,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "values",
"description": "List of values"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": true,
"defaultValue": "SUM",
"defaultRaw": "SUM",
"name": "operation",
"description": "Optional operation type"
},
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "precision",
"description": "Optional result precision"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
},
"ignore": true
},
{
"__docId__": 152,
"kind": "method",
"name": "calcSum",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#calcSum",
"access": "public",
"description": "Calculate the sum of passed values.",
"lineNumber": 308,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "values",
"description": "List of values"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 153,
"kind": "method",
"name": "calcMean",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#calcMean",
"access": "public",
"description": "Calculate the mean of passed values.",
"lineNumber": 321,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "values",
"description": "List of values"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 154,
"kind": "method",
"name": "calcMax",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#calcMax",
"access": "public",
"description": "Calculate the max value of passed values.",
"lineNumber": 331,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "values",
"description": "List of values"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 155,
"kind": "method",
"name": "calcMin",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#calcMin",
"access": "public",
"description": "Calculate the min value of passed values.",
"lineNumber": 340,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "values",
"description": "List of values"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 156,
"kind": "method",
"name": "calcMedian",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#calcMedian",
"access": "public",
"description": "Calculate the median of passed values.",
"lineNumber": 349,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "values",
"description": "List of values"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 157,
"kind": "method",
"name": "calcQ1",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#calcQ1",
"access": "public",
"description": "Calculate the lower quartile of passed values.",
"lineNumber": 365,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "values",
"description": "List of values"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 158,
"kind": "method",
"name": "calcQ3",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#calcQ3",
"access": "public",
"description": "Calculate the upper quartile of passed values.",
"lineNumber": 381,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "values",
"description": "List of values"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 159,
"kind": "method",
"name": "sortColumnValues",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#sortColumnValues",
"access": "public",
"description": "Sort passed values with supplied sorter function.",
"lineNumber": 400,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Array}"
}
],
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "values",
"description": "List of values to be sorted"
},
{
"nullable": null,
"types": [
"Function"
],
"spread": false,
"optional": false,
"name": "sorter",
"description": "Sorter function"
}
],
"return": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 160,
"kind": "method",
"name": "writeResult",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#writeResult",
"access": "private",
"description": "Write calculation result in passed DOM element with supplied write method\nand decimal precision.",
"lineNumber": 413,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": true,
"defaultValue": "0",
"defaultRaw": 0,
"name": "result",
"description": "Calculation result"
},
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "label",
"description": "DOM element"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": true,
"defaultValue": "'innerhtml'",
"defaultRaw": "'innerhtml'",
"name": "writeType",
"description": "Write method"
},
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": true,
"defaultValue": "2",
"defaultRaw": 2,
"name": "precision",
"description": "Applied decimal precision"
}
],
"ignore": true,
"return": null
},
{
"__docId__": 161,
"kind": "method",
"name": "configureFormat",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#configureFormat",
"access": "private",
"description": "Configure the format options used to format the operation result based\non column type.",
"lineNumber": 451,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Object}"
}
],
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": true,
"defaultValue": "{}",
"defaultRaw": {},
"name": "format",
"description": "Format object"
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": ""
},
"ignore": true
},
{
"__docId__": 162,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/colOps/colOps.js~ColOps",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colOps/colOps.js~ColOps#destroy",
"access": "public",
"description": "Remove extension",
"lineNumber": 469,
"params": [],
"return": null
},
{
"__docId__": 164,
"kind": "file",
"name": "src/extensions/colsVisibility/colsVisibility.js",
"content": "import {Feature} from '../../feature';\nimport {\n addClass, removeClass, createCheckItem, createElm, elm, removeElm,\n getText, tag\n} from '../../dom';\nimport {isUndef, EMPTY_FN, isNull} from '../../types';\nimport {addEvt, targetEvt, removeEvt} from '../../event';\nimport {root} from '../../root';\nimport {NONE} from '../../const';\nimport {\n defaultsBool, defaultsStr, defaultsFn, defaultsNb, defaultsArr\n} from '../../settings';\nimport {RIGHT} from '../../modules/toolbar';\n\n/**\n * Columns Visibility extension\n */\nexport default class ColsVisibility extends Feature {\n\n /**\n * Creates an instance of ColsVisibility\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} Configuration object\n */\n constructor(tf, f) {\n super(tf, f.name);\n\n // Configuration object\n let cfg = this.config;\n\n /**\n * Module name\n * @type {String}\n */\n this.name = f.name;\n\n /**\n * Module description\n * @type {String}\n */\n this.desc = defaultsStr(f.description, 'Columns visibility manager');\n\n /**\n * show/hide columns container element\n * @private\n */\n this.spanEl = null;\n\n /**\n * show/hide columns button element\n * @private\n */\n this.btnEl = null;\n\n /**\n * show/hide columns main container element\n * @private\n */\n this.contEl = null;\n\n /**\n * Enable tick to hide a column, defaults to true\n * @type {Boolean}\n */\n this.tickToHide = defaultsBool(f.tick_to_hide, true);\n\n /**\n * Enable columns manager UI, defaults to true\n * @type {Boolean}\n */\n this.manager = defaultsBool(f.manager, true);\n\n /**\n * Headers HTML table reference only if headers are external\n * @type {DOMElement}\n */\n this.headersTbl = f.headers_table || null;\n\n /**\n * Headers row index only if headers are external\n * @type {Number}\n */\n this.headersIndex = defaultsNb(f.headers_index, 1);\n\n /**\n * ID of main container element\n * @type {String}\n */\n this.contElTgtId = defaultsStr(f.container_target_id, null);\n\n /**\n * Alternative text for column headers in column manager UI\n * @type {Array}\n */\n this.headersText = defaultsArr(f.headers_text, []);\n\n /**\n * ID of button's container element\n * @type {String}\n */\n this.btnTgtId = defaultsStr(f.btn_target_id, null);\n\n /**\n * Button's text, defaults to Columns▼\n * @type {String}\n */\n this.btnText = defaultsStr(f.btn_text, 'Columns▼');\n\n /**\n * Button's inner HTML\n * @type {String}\n */\n this.btnHtml = defaultsStr(f.btn_html, null);\n\n /**\n * Css class for button\n * @type {String}\n */\n this.btnCssClass = defaultsStr(f.btn_css_class, 'colVis');\n\n /**\n * Columns manager UI close link text, defaults to 'Close'\n * @type {String}\n */\n this.btnCloseText = defaultsStr(f.btn_close_text, 'Close');\n\n /**\n * Columns manager UI close link HTML\n * @type {String}\n */\n this.btnCloseHtml = defaultsStr(f.btn_close_html, null);\n\n /**\n * Css for columns manager UI close link\n * @type {String}\n */\n this.btnCloseCssClass = defaultsStr(f.btn_close_css_class,\n this.btnCssClass);\n\n /**\n * Extension's stylesheet filename\n * @type {String}\n */\n this.stylesheet = defaultsStr(f.stylesheet, 'colsVisibility.css');\n\n /**\n * Css for columns manager UI span\n * @type {String}\n */\n this.spanCssClass = defaultsStr(f.span_css_class, 'colVisSpan');\n\n /**\n * Css for columns manager UI main container\n * @type {String}\n */\n this.contCssClass = defaultsStr(f.cont_css_class, 'colVisCont');\n\n /**\n * Css for columns manager UI checklist (ul)\n * @type {String}\n */\n this.listCssClass = defaultsStr(cfg.list_css_class, 'cols_checklist');\n\n /**\n * Css for columns manager UI checklist item (li)\n * @type {String}\n */\n this.listItemCssClass = defaultsStr(cfg.checklist_item_css_class,\n 'cols_checklist_item');\n\n /**\n * Css for columns manager UI checklist item selected state (li)\n * @type {String}\n */\n this.listSlcItemCssClass = defaultsStr(\n cfg.checklist_selected_item_css_class,\n 'cols_checklist_slc_item'\n );\n\n /**\n * Text preceding the columns list, defaults to 'Hide' or 'Show'\n * depending on tick mode (tick_to_hide option)\n * @type {String}\n */\n this.text = defaultsStr(f.text, this.tickToHide ? 'Hide: ' : 'Show: ');\n\n /**\n * List of columns indexes to be hidden at initialization\n * @type {Array}\n */\n this.atStart = defaultsArr(f.at_start, []);\n\n /**\n * Enable hover behaviour on columns manager button/link\n * @type {Boolean}\n */\n this.enableHover = Boolean(f.enable_hover);\n\n /**\n * Enable select all option, disabled by default\n * @type {Boolean}\n */\n this.enableTickAll = Boolean(f.enable_tick_all);\n\n /**\n * Text for select all option, defaults to 'Select all:'\n * @type {String}\n */\n this.tickAllText = defaultsStr(f.tick_all_text, 'Select all:');\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, RIGHT);\n\n /**\n * List of indexes of hidden columns\n * @private\n */\n this.hiddenCols = [];\n\n /**\n * Bound mouseup wrapper\n * @private\n */\n this.boundMouseup = null;\n\n /**\n * Callback fired when the extension is initialized\n * @type {Function}\n */\n this.onLoaded = defaultsFn(f.on_loaded, EMPTY_FN);\n\n /**\n * Callback fired before the columns manager is opened\n * @type {Function}\n */\n this.onBeforeOpen = defaultsFn(f.on_before_open, EMPTY_FN);\n\n /**\n * Callback fired after the columns manager is opened\n * @type {Function}\n */\n this.onAfterOpen = defaultsFn(f.on_after_open, EMPTY_FN);\n\n /**\n * Callback fired before the columns manager is closed\n * @type {Function}\n */\n this.onBeforeClose = defaultsFn(f.on_before_close, EMPTY_FN);\n\n /**\n * Callback fired after the columns manager is closed\n * @type {Function}\n */\n this.onAfterClose = defaultsFn(f.on_after_close, EMPTY_FN);\n\n /**\n * Callback fired before a column is hidden\n * @type {Function}\n */\n this.onBeforeColHidden = defaultsFn(f.on_before_col_hidden, EMPTY_FN);\n\n /**\n * Callback fired after a column is hidden\n * @type {Function}\n */\n this.onAfterColHidden = defaultsFn(f.on_after_col_hidden, EMPTY_FN);\n\n /**\n * Callback fired before a column is displayed\n * @type {Function}\n */\n this.onBeforeColDisplayed = defaultsFn(f.on_before_col_displayed,\n EMPTY_FN);\n\n /**\n * Callback fired after a column is displayed\n * @type {Function}\n */\n this.onAfterColDisplayed = defaultsFn(f.on_after_col_displayed,\n EMPTY_FN);\n\n //Grid layout support\n if (tf.gridLayout) {\n this.headersTbl = tf.feature('gridLayout').headTbl; //headers table\n this.headersIndex = 0; //headers index\n }\n\n //Loads extension stylesheet\n tf.import(f.name + 'Style', tf.getStylePath() + this.stylesheet, null,\n 'link');\n\n this.enable();\n }\n\n /**\n * Mouse-up event handler handling popup auto-close behaviour\n * @private\n */\n onMouseup(evt) {\n let targetElm = targetEvt(evt);\n\n while (targetElm && targetElm !== this.contEl\n && targetElm !== this.btnEl) {\n targetElm = targetElm.parentNode;\n }\n\n if (targetElm !== this.contEl && targetElm !== this.btnEl) {\n this.toggle();\n }\n\n return;\n }\n\n /**\n * Toggle columns manager UI\n */\n toggle() {\n // ensure mouseup event handler is removed\n removeEvt(root, 'mouseup', this.boundMouseup);\n\n let contDisplay = this.contEl.style.display;\n\n if (contDisplay !== 'inline') {\n this.onBeforeOpen(this);\n }\n if (contDisplay === 'inline') {\n this.onBeforeClose(this);\n }\n\n this.contEl.style.display = contDisplay === 'inline' ?\n NONE : 'inline';\n\n if (contDisplay !== 'inline') {\n this.onAfterOpen(this);\n addEvt(root, 'mouseup', this.boundMouseup);\n }\n if (contDisplay === 'inline') {\n this.onAfterClose(this);\n }\n }\n\n /**\n * Check an item in columns manager UI\n * @private\n */\n checkItem(lbl) {\n let li = lbl.parentNode;\n if (!li || !lbl) {\n return;\n }\n let isChecked = lbl.firstChild.checked;\n let colIndex = lbl.firstChild.getAttribute('id').split('_')[1];\n colIndex = parseInt(colIndex, 10);\n if (isChecked) {\n addClass(li, this.listSlcItemCssClass);\n } else {\n removeClass(li, this.listSlcItemCssClass);\n }\n\n let hide = false;\n if ((this.tickToHide && isChecked) ||\n (!this.tickToHide && !isChecked)) {\n hide = true;\n }\n this.setHidden(colIndex, hide);\n }\n\n /**\n * Initializes ColsVisibility instance\n */\n init() {\n if (this.initialized || !this.manager) {\n return;\n }\n\n this.emitter.emit('initializing-extension', this,\n !isNull(this.btnTgtId));\n\n this.emitter.on(['hide-column'],\n (tf, colIndex) => this.hideCol(colIndex));\n\n this.buildBtn();\n this.buildManager();\n\n /** @inherited */\n this.initialized = true;\n\n this.boundMouseup = this.onMouseup.bind(this);\n\n this.emitter.emit('columns-visibility-initialized', this.tf, this);\n this.emitter.emit('extension-initialized', this);\n\n // Hide columns at start at very end of initialization, do not move\n // as order is important\n this._hideAtStart();\n }\n\n /**\n * Build main button UI\n */\n buildBtn() {\n if (this.btnEl) {\n return;\n }\n let tf = this.tf;\n let span = createElm('span');\n span.className = this.spanCssClass;\n\n // Container element (rdiv or custom element)\n let targetEl = !this.btnTgtId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.btnTgtId);\n\n if (!this.btnTgtId) {\n let firstChild = targetEl.firstChild;\n firstChild.parentNode.insertBefore(span, firstChild);\n } else {\n targetEl.appendChild(span);\n }\n\n if (!this.btnHtml) {\n let btn = createElm('a', ['href', 'javascript:;']);\n btn.className = this.btnCssClass;\n btn.title = this.desc;\n\n btn.innerHTML = this.btnText;\n span.appendChild(btn);\n if (!this.enableHover) {\n addEvt(btn, 'click', (evt) => this.toggle(evt));\n } else {\n addEvt(btn, 'mouseover', (evt) => this.toggle(evt));\n }\n } else { // Custom html\n span.innerHTML = this.btnHtml;\n let colVisEl = span.firstChild;\n if (!this.enableHover) {\n addEvt(colVisEl, 'click', (evt) => this.toggle(evt));\n } else {\n addEvt(colVisEl, 'mouseover', (evt) => this.toggle(evt));\n }\n }\n\n this.spanEl = span;\n this.btnEl = this.spanEl.firstChild;\n\n this.onLoaded(this);\n }\n\n /**\n * Build columns manager UI\n */\n buildManager() {\n let tf = this.tf;\n\n let container = !this.contElTgtId ?\n createElm('div') :\n elm(this.contElTgtId);\n container.className = this.contCssClass;\n\n //Extension description\n let extNameLabel = createElm('p');\n extNameLabel.innerHTML = this.text;\n container.appendChild(extNameLabel);\n\n //Headers list\n let ul = createElm('ul');\n ul.className = this.listCssClass;\n\n let tbl = this.headersTbl || tf.dom();\n let headerIndex = this.headersTbl ?\n this.headersIndex : tf.getHeadersRowIndex();\n let headerRow = tbl.rows[headerIndex];\n\n //Tick all option\n if (this.enableTickAll) {\n let li = createCheckItem('col__' + tf.id, this.tickAllText,\n this.tickAllText);\n addClass(li, this.listItemCssClass);\n ul.appendChild(li);\n li.check.checked = !this.tickToHide;\n\n addEvt(li.check, 'click', () => {\n for (let h = 0; h < headerRow.cells.length; h++) {\n let itm = elm('col_' + h + '_' + tf.id);\n if (itm && li.check.checked !== itm.checked) {\n itm.click();\n itm.checked = li.check.checked;\n }\n }\n });\n }\n\n for (let i = 0; i < headerRow.cells.length; i++) {\n let cell = headerRow.cells[i];\n let cellText = this.headersText[i] || this._getHeaderText(cell);\n let liElm = createCheckItem('col_' + i + '_' + tf.id, cellText,\n cellText);\n addClass(liElm, this.listItemCssClass);\n if (!this.tickToHide) {\n addClass(liElm, this.listSlcItemCssClass);\n }\n ul.appendChild(liElm);\n if (!this.tickToHide) {\n liElm.check.checked = true;\n }\n\n addEvt(liElm.check, 'click', (evt) => {\n let elm = targetEvt(evt);\n let lbl = elm.parentNode;\n this.checkItem(lbl);\n });\n }\n\n //separator\n let p = createElm('p', ['align', 'center']);\n let btn;\n //Close link\n if (!this.btnCloseHtml) {\n btn = createElm('a', ['href', 'javascript:;']);\n btn.className = this.btnCloseCssClass;\n btn.innerHTML = this.btnCloseText;\n addEvt(btn, 'click', (evt) => this.toggle(evt));\n p.appendChild(btn);\n } else {\n p.innerHTML = this.btnCloseHtml;\n btn = p.firstChild;\n addEvt(btn, 'click', (evt) => this.toggle(evt));\n }\n\n container.appendChild(ul);\n container.appendChild(p);\n\n this.btnEl.parentNode.insertBefore(container, this.btnEl);\n this.contEl = container;\n }\n\n /**\n * Hide or show specified columns\n * @param {Number} colIndex Column index\n * @param {Boolean} hide Hide column if true or show if false\n */\n setHidden(colIndex, hide) {\n let tf = this.tf;\n let tbl = tf.dom();\n\n if (hide) {\n this.onBeforeColHidden(this, colIndex);\n } else {\n this.onBeforeColDisplayed(this, colIndex);\n }\n\n this._hideElements(tbl, colIndex, hide);\n if (this.headersTbl) {\n this._hideElements(this.headersTbl, colIndex, hide);\n }\n\n let hiddenCols = this.hiddenCols;\n let itemIndex = hiddenCols.indexOf(colIndex);\n if (hide) {\n if (itemIndex === -1) {\n this.hiddenCols.push(colIndex);\n }\n } else {\n if (itemIndex !== -1) {\n this.hiddenCols.splice(itemIndex, 1);\n }\n }\n\n if (hide) {\n this.onAfterColHidden(this, colIndex);\n this.emitter.emit('column-hidden', tf, this, colIndex,\n this.hiddenCols);\n } else {\n this.onAfterColDisplayed(this, colIndex);\n this.emitter.emit('column-shown', tf, this, colIndex,\n this.hiddenCols);\n }\n }\n\n /**\n * Show specified column\n * @param {Number} colIndex Column index\n */\n showCol(colIndex) {\n if (isUndef(colIndex) || !this.isColHidden(colIndex)) {\n return;\n }\n if (this.manager && this.contEl) {\n let itm = elm('col_' + colIndex + '_' + this.tf.id);\n if (itm) {\n itm.click();\n }\n } else {\n this.setHidden(colIndex, false);\n }\n }\n\n /**\n * Hide specified column\n * @param {Number} colIndex Column index\n */\n hideCol(colIndex) {\n if (isUndef(colIndex) || this.isColHidden(colIndex)) {\n return;\n }\n if (this.manager && this.contEl) {\n let itm = elm('col_' + colIndex + '_' + this.tf.id);\n if (itm) {\n itm.click();\n }\n } else {\n this.setHidden(colIndex, true);\n }\n }\n\n /**\n * Determine if specified column is hidden\n * @param {Number} colIndex Column index\n */\n isColHidden(colIndex) {\n if (this.hiddenCols.indexOf(colIndex) !== -1) {\n return true;\n }\n return false;\n }\n\n /**\n * Toggle visibility of specified column\n * @param {Number} colIndex Column index\n */\n toggleCol(colIndex) {\n if (isUndef(colIndex) || this.isColHidden(colIndex)) {\n this.showCol(colIndex);\n } else {\n this.hideCol(colIndex);\n }\n }\n\n /**\n * Return the indexes of the columns currently hidden\n * @return {Array} column indexes\n */\n getHiddenCols() {\n return this.hiddenCols;\n }\n\n /**\n * Remove the columns manager\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n if (elm(this.contElTgtId)) {\n elm(this.contElTgtId).innerHTML = '';\n } else {\n this.contEl.innerHTML = '';\n removeElm(this.contEl);\n this.contEl = null;\n }\n this.btnEl.innerHTML = '';\n removeElm(this.btnEl);\n this.btnEl = null;\n\n this.emitter.off(['hide-column'],\n (tf, colIndex) => this.hideCol(colIndex));\n\n this.boundMouseup = null;\n\n this.initialized = false;\n }\n\n _getHeaderText(cell) {\n if (!cell.hasChildNodes) {\n return '';\n }\n\n for (let i = 0; i < cell.childNodes.length; i++) {\n let n = cell.childNodes[i];\n if (n.nodeType === 3) {\n return n.nodeValue;\n } else if (n.nodeType === 1) {\n if (n.id && n.id.indexOf('popUp') !== -1) {\n continue;\n } else {\n return getText(n);\n }\n }\n continue;\n }\n return '';\n }\n\n _hideElements(tbl, colIdx, hide) {\n this._hideCells(tbl, colIdx, hide);\n this._hideCol(tbl, colIdx, hide);\n }\n\n _hideCells(tbl, colIdx, hide) {\n for (let i = 0; i < tbl.rows.length; i++) {\n let row = tbl.rows[i];\n let cell = row.cells[colIdx];\n if (cell) {\n cell.style.display = hide ? NONE : '';\n }\n }\n }\n\n _hideCol(tbl, colIdx, hide) {\n let colElms = tag(this.tf.dom(), 'col');\n if (colElms.length === 0) {\n return;\n }\n colElms[colIdx].style.display = hide ? NONE : '';\n }\n\n _hideAtStart() {\n this.atStart.forEach((colIdx) => {\n this.hideCol(colIdx);\n });\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/extensions/colsVisibility/colsVisibility.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 165,
"kind": "class",
"name": "ColsVisibility",
"memberof": "src/extensions/colsVisibility/colsVisibility.js",
"static": true,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"access": "public",
"export": true,
"importPath": "tablefilter/src/extensions/colsVisibility/colsVisibility.js",
"importStyle": "ColsVisibility",
"description": "Columns Visibility extension",
"lineNumber": 18,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 166,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#constructor",
"access": "public",
"description": "Creates an instance of ColsVisibility",
"lineNumber": 25,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "Configuration",
"description": "object"
}
]
},
{
"__docId__": 167,
"kind": "member",
"name": "name",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#name",
"access": "public",
"description": "Module name",
"lineNumber": 35,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 168,
"kind": "member",
"name": "desc",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#desc",
"access": "public",
"description": "Module description",
"lineNumber": 41,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 169,
"kind": "member",
"name": "spanEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#spanEl",
"access": "private",
"description": "show/hide columns container element",
"lineNumber": 47,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 170,
"kind": "member",
"name": "btnEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnEl",
"access": "private",
"description": "show/hide columns button element",
"lineNumber": 53,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 171,
"kind": "member",
"name": "contEl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contEl",
"access": "private",
"description": "show/hide columns main container element",
"lineNumber": 59,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 172,
"kind": "member",
"name": "tickToHide",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#tickToHide",
"access": "public",
"description": "Enable tick to hide a column, defaults to true",
"lineNumber": 65,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 173,
"kind": "member",
"name": "manager",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#manager",
"access": "public",
"description": "Enable columns manager UI, defaults to true",
"lineNumber": 71,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 174,
"kind": "member",
"name": "headersTbl",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#headersTbl",
"access": "public",
"description": "Headers HTML table reference only if headers are external",
"lineNumber": 77,
"type": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": null
}
},
{
"__docId__": 175,
"kind": "member",
"name": "headersIndex",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#headersIndex",
"access": "public",
"description": "Headers row index only if headers are external",
"lineNumber": 83,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 176,
"kind": "member",
"name": "contElTgtId",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contElTgtId",
"access": "public",
"description": "ID of main container element",
"lineNumber": 89,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 177,
"kind": "member",
"name": "headersText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#headersText",
"access": "public",
"description": "Alternative text for column headers in column manager UI",
"lineNumber": 95,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 178,
"kind": "member",
"name": "btnTgtId",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnTgtId",
"access": "public",
"description": "ID of button's container element",
"lineNumber": 101,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 179,
"kind": "member",
"name": "btnText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnText",
"access": "public",
"description": "Button's text, defaults to Columns▼",
"lineNumber": 107,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 180,
"kind": "member",
"name": "btnHtml",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnHtml",
"access": "public",
"description": "Button's inner HTML",
"lineNumber": 113,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 181,
"kind": "member",
"name": "btnCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnCssClass",
"access": "public",
"description": "Css class for button",
"lineNumber": 119,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 182,
"kind": "member",
"name": "btnCloseText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnCloseText",
"access": "public",
"description": "Columns manager UI close link text, defaults to 'Close'",
"lineNumber": 125,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 183,
"kind": "member",
"name": "btnCloseHtml",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnCloseHtml",
"access": "public",
"description": "Columns manager UI close link HTML",
"lineNumber": 131,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 184,
"kind": "member",
"name": "btnCloseCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#btnCloseCssClass",
"access": "public",
"description": "Css for columns manager UI close link",
"lineNumber": 137,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 185,
"kind": "member",
"name": "stylesheet",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#stylesheet",
"access": "public",
"description": "Extension's stylesheet filename",
"lineNumber": 144,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 186,
"kind": "member",
"name": "spanCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#spanCssClass",
"access": "public",
"description": "Css for columns manager UI span",
"lineNumber": 150,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 187,
"kind": "member",
"name": "contCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#contCssClass",
"access": "public",
"description": "Css for columns manager UI main container",
"lineNumber": 156,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 188,
"kind": "member",
"name": "listCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#listCssClass",
"access": "public",
"description": "Css for columns manager UI checklist (ul)",
"lineNumber": 162,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 189,
"kind": "member",
"name": "listItemCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#listItemCssClass",
"access": "public",
"description": "Css for columns manager UI checklist item (li)",
"lineNumber": 168,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 190,
"kind": "member",
"name": "listSlcItemCssClass",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#listSlcItemCssClass",
"access": "public",
"description": "Css for columns manager UI checklist item selected state (li)",
"lineNumber": 175,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 191,
"kind": "member",
"name": "text",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#text",
"access": "public",
"description": "Text preceding the columns list, defaults to 'Hide' or 'Show'\ndepending on tick mode (tick_to_hide option)",
"lineNumber": 185,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 192,
"kind": "member",
"name": "atStart",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#atStart",
"access": "public",
"description": "List of columns indexes to be hidden at initialization",
"lineNumber": 191,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 193,
"kind": "member",
"name": "enableHover",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#enableHover",
"access": "public",
"description": "Enable hover behaviour on columns manager button/link",
"lineNumber": 197,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 194,
"kind": "member",
"name": "enableTickAll",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#enableTickAll",
"access": "public",
"description": "Enable select all option, disabled by default",
"lineNumber": 203,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 195,
"kind": "member",
"name": "tickAllText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#tickAllText",
"access": "public",
"description": "Text for select all option, defaults to 'Select all:'",
"lineNumber": 209,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 196,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#toolbarPosition",
"access": "public",
"description": "Default position in toolbar ('left'|'center'|'right')",
"lineNumber": 215,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 197,
"kind": "member",
"name": "hiddenCols",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#hiddenCols",
"access": "private",
"description": "List of indexes of hidden columns",
"lineNumber": 221,
"ignore": true,
"type": {
"types": [
"*[]"
]
}
},
{
"__docId__": 198,
"kind": "member",
"name": "boundMouseup",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#boundMouseup",
"access": "private",
"description": "Bound mouseup wrapper",
"lineNumber": 227,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 199,
"kind": "member",
"name": "onLoaded",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onLoaded",
"access": "public",
"description": "Callback fired when the extension is initialized",
"lineNumber": 233,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 200,
"kind": "member",
"name": "onBeforeOpen",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onBeforeOpen",
"access": "public",
"description": "Callback fired before the columns manager is opened",
"lineNumber": 239,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 201,
"kind": "member",
"name": "onAfterOpen",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onAfterOpen",
"access": "public",
"description": "Callback fired after the columns manager is opened",
"lineNumber": 245,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 202,
"kind": "member",
"name": "onBeforeClose",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onBeforeClose",
"access": "public",
"description": "Callback fired before the columns manager is closed",
"lineNumber": 251,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 203,
"kind": "member",
"name": "onAfterClose",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onAfterClose",
"access": "public",
"description": "Callback fired after the columns manager is closed",
"lineNumber": 257,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 204,
"kind": "member",
"name": "onBeforeColHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onBeforeColHidden",
"access": "public",
"description": "Callback fired before a column is hidden",
"lineNumber": 263,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 205,
"kind": "member",
"name": "onAfterColHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onAfterColHidden",
"access": "public",
"description": "Callback fired after a column is hidden",
"lineNumber": 269,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 206,
"kind": "member",
"name": "onBeforeColDisplayed",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onBeforeColDisplayed",
"access": "public",
"description": "Callback fired before a column is displayed",
"lineNumber": 275,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 207,
"kind": "member",
"name": "onAfterColDisplayed",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onAfterColDisplayed",
"access": "public",
"description": "Callback fired after a column is displayed",
"lineNumber": 282,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 210,
"kind": "method",
"name": "onMouseup",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#onMouseup",
"access": "private",
"description": "Mouse-up event handler handling popup auto-close behaviour",
"lineNumber": 302,
"ignore": true,
"params": [
{
"name": "evt",
"types": [
"*"
]
}
],
"return": null
},
{
"__docId__": 211,
"kind": "method",
"name": "toggle",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#toggle",
"access": "public",
"description": "Toggle columns manager UI",
"lineNumber": 320,
"params": [],
"return": null
},
{
"__docId__": 212,
"kind": "method",
"name": "checkItem",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#checkItem",
"access": "private",
"description": "Check an item in columns manager UI",
"lineNumber": 349,
"ignore": true,
"params": [
{
"name": "lbl",
"types": [
"*"
]
}
],
"return": null
},
{
"__docId__": 213,
"kind": "method",
"name": "init",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#init",
"access": "public",
"description": "Initializes ColsVisibility instance",
"lineNumber": 374,
"params": [],
"return": null
},
{
"__docId__": 214,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#initialized",
"access": "public",
"description": null,
"lineNumber": 389,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 216,
"kind": "method",
"name": "buildBtn",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#buildBtn",
"access": "public",
"description": "Build main button UI",
"lineNumber": 404,
"params": [],
"return": null
},
{
"__docId__": 219,
"kind": "method",
"name": "buildManager",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#buildManager",
"access": "public",
"description": "Build columns manager UI",
"lineNumber": 455,
"params": [],
"return": null
},
{
"__docId__": 221,
"kind": "method",
"name": "setHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#setHidden",
"access": "public",
"description": "Hide or show specified columns",
"lineNumber": 545,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"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"
}
],
"return": null
},
{
"__docId__": 222,
"kind": "method",
"name": "showCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#showCol",
"access": "public",
"description": "Show specified column",
"lineNumber": 587,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"return": null
},
{
"__docId__": 223,
"kind": "method",
"name": "hideCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#hideCol",
"access": "public",
"description": "Hide specified column",
"lineNumber": 605,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"return": null
},
{
"__docId__": 224,
"kind": "method",
"name": "isColHidden",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#isColHidden",
"access": "public",
"description": "Determine if specified column is hidden",
"lineNumber": 623,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"return": {
"types": [
"boolean"
]
}
},
{
"__docId__": 225,
"kind": "method",
"name": "toggleCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#toggleCol",
"access": "public",
"description": "Toggle visibility of specified column",
"lineNumber": 634,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"return": null
},
{
"__docId__": 226,
"kind": "method",
"name": "getHiddenCols",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#getHiddenCols",
"access": "public",
"description": "Return the indexes of the columns currently hidden",
"lineNumber": 646,
"return": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": "column indexes"
},
"params": []
},
{
"__docId__": 227,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#destroy",
"access": "public",
"description": "Remove the columns manager",
"lineNumber": 653,
"params": [],
"return": null
},
{
"__docId__": 232,
"kind": "method",
"name": "_getHeaderText",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_getHeaderText",
"access": "private",
"description": null,
"lineNumber": 676,
"undocument": true,
"ignore": true,
"params": [
{
"name": "cell",
"types": [
"*"
]
}
],
"return": {
"types": [
"string"
]
}
},
{
"__docId__": 233,
"kind": "method",
"name": "_hideElements",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideElements",
"access": "private",
"description": null,
"lineNumber": 697,
"undocument": true,
"ignore": true,
"params": [
{
"name": "tbl",
"types": [
"*"
]
},
{
"name": "colIdx",
"types": [
"*"
]
},
{
"name": "hide",
"types": [
"*"
]
}
],
"return": null
},
{
"__docId__": 234,
"kind": "method",
"name": "_hideCells",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideCells",
"access": "private",
"description": null,
"lineNumber": 702,
"undocument": true,
"ignore": true,
"params": [
{
"name": "tbl",
"types": [
"*"
]
},
{
"name": "colIdx",
"types": [
"*"
]
},
{
"name": "hide",
"types": [
"*"
]
}
],
"return": null
},
{
"__docId__": 235,
"kind": "method",
"name": "_hideCol",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideCol",
"access": "private",
"description": null,
"lineNumber": 712,
"undocument": true,
"ignore": true,
"params": [
{
"name": "tbl",
"types": [
"*"
]
},
{
"name": "colIdx",
"types": [
"*"
]
},
{
"name": "hide",
"types": [
"*"
]
}
],
"return": null
},
{
"__docId__": 236,
"kind": "method",
"name": "_hideAtStart",
"memberof": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/colsVisibility/colsVisibility.js~ColsVisibility#_hideAtStart",
"access": "private",
"description": null,
"lineNumber": 720,
"undocument": true,
"ignore": true,
"params": [],
"return": null
},
{
"__docId__": 237,
"kind": "file",
"name": "src/extensions/filtersVisibility/filtersVisibility.js",
"content": "import {Feature} from '../../feature';\nimport {createElm, removeElm, elm} from '../../dom';\nimport {EMPTY_FN, isNull} from '../../types';\nimport {addEvt} from '../../event';\nimport {\n defaultsBool, defaultsStr, defaultsFn, defaultsNb,\n} from '../../settings';\nimport {RIGHT} from '../../modules/toolbar';\n\n/**\n * Filters Visibility extension\n */\nexport default class FiltersVisibility extends Feature {\n\n /**\n * Creates an instance of FiltersVisibility\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} Configuration object\n */\n constructor(tf, f) {\n super(tf, f.name);\n\n /**\n * Module name\n * @type {String}\n */\n this.name = f.name;\n\n /**\n * Module description\n * @type {String}\n */\n this.desc = defaultsStr(f.description,\n 'Filters row visibility manager');\n\n /**\n * Extension's stylesheet filename\n * @type {String}\n */\n this.stylesheet = defaultsStr(f.stylesheet , 'filtersVisibility.css');\n\n /**\n * Expand icon filename\n * @type {String}\n */\n this.icnExpand = defaultsStr(f.expand_icon_name, 'icn_exp.png');\n\n /**\n * Collapse icon filename\n * @type {String}\n */\n this.icnCollapse = defaultsStr(f.collapse_icon_name, 'icn_clp.png');\n\n /**\n * Main container element\n * @private\n */\n this.contEl = null;\n\n /**\n * Button element\n * @private\n */\n this.btnEl = null;\n\n /**\n * Expand icon HTML\n * @private\n */\n this.icnExpandHtml = '';\n\n /**\n * Collapse icon HTML\n * @private\n */\n this.icnCollapseHtml = '';\n\n /**\n * Default text\n * @private\n */\n this.defaultText = 'Toggle filters';\n\n /**\n * ID of main container element\n * @type {String}\n */\n this.targetId = f.target_id || null;\n\n /**\n * Enable expand/collapse icon, defaults to true\n * @type {Boolean}\n */\n this.enableIcon = defaultsBool(f.enable_icon, true);\n\n /**\n * Custom text for button\n * @type {String}\n */\n this.btnText = defaultsStr(f.btn_text, '');\n\n /**\n * Collapse button HTML\n * @private\n */\n this.collapseBtnHtml = this.enableIcon ?\n this.icnCollapseHtml + this.btnText :\n this.btnText || this.defaultText;\n\n /**\n * Expand button HTML\n * @private\n */\n this.expandBtnHtml = this.enableIcon ?\n this.icnExpandHtml + this.btnText :\n this.btnText || this.defaultText;\n\n /**\n * Button's custom HTML\n * @type {String}\n */\n this.btnHtml = defaultsStr(f.btn_html, null);\n\n /**\n * Css class for expand/collapse filters button\n * @type {String}\n */\n this.btnCssClass = defaultsStr(f.btn_css_class, 'btnExpClpFlt');\n\n /**\n * Css class for main container\n * @type {String}\n */\n this.contCssClass = defaultsStr(f.cont_css_class, 'expClpFlt');\n\n /**\n * Filters row index\n * @type {Number}\n */\n this.filtersRowIndex = defaultsNb(f.filters_row_index,\n tf.getFiltersRowIndex());\n\n /**\n * Make filters visible at initialization, defaults to true\n * @type {Boolean}\n */\n this.visibleAtStart = defaultsNb(f.visible_at_start, true);\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, RIGHT);\n\n /**\n * Callback fired before filters row is shown\n * @type {Function}\n */\n this.onBeforeShow = defaultsFn(f.on_before_show, EMPTY_FN);\n\n /**\n * Callback fired after filters row is shown\n * @type {Function}\n */\n this.onAfterShow = defaultsFn(f.on_after_show, EMPTY_FN);\n\n /**\n * Callback fired before filters row is hidden\n * @type {Function}\n */\n this.onBeforeHide = defaultsFn(f.on_before_hide, EMPTY_FN);\n\n /**\n * Callback fired after filters row is hidden\n * @type {Function}\n */\n this.onAfterHide = defaultsFn(f.on_after_hide, EMPTY_FN);\n\n //Import extension's stylesheet\n tf.import(f.name + 'Style', tf.getStylePath() + this.stylesheet, null,\n 'link');\n\n this.enable();\n }\n\n /**\n * Initialise extension\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n this.emitter.emit('initializing-extension', this,\n !isNull(this.targetId));\n\n this.buildUI();\n\n /** @inherited */\n this.initialized = true;\n\n this.emitter.on(['show-filters'], (tf, visible) => this.show(visible));\n this.emitter.emit('filters-visibility-initialized', this.tf, this);\n this.emitter.emit('extension-initialized', this);\n }\n\n /**\n * Build UI elements\n */\n buildUI() {\n let tf = this.tf;\n let span = createElm('span');\n span.className = this.contCssClass;\n\n // Container element (rdiv or custom element)\n let targetEl = !this.targetId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.targetId);\n\n if (!this.targetId) {\n let firstChild = targetEl.firstChild;\n firstChild.parentNode.insertBefore(span, firstChild);\n } else {\n targetEl.appendChild(span);\n }\n\n let btn;\n if (!this.btnHtml) {\n btn = createElm('a', ['href', 'javascript:void(0);']);\n btn.className = this.btnCssClass;\n btn.title = this.btnText || this.defaultText;\n btn.innerHTML = this.collapseBtnHtml;\n span.appendChild(btn);\n } else { // Custom html\n span.innerHTML = this.btnHtml;\n btn = span.firstChild;\n }\n\n addEvt(btn, 'click', () => this.toggle());\n\n this.contEl = span;\n this.btnEl = btn;\n\n if (!this.visibleAtStart) {\n this.toggle();\n }\n }\n\n /**\n * Toggle filters visibility\n */\n toggle() {\n let tf = this.tf;\n let tbl = tf.gridLayout ? tf.feature('gridLayout').headTbl : tf.dom();\n let fltRow = tbl.rows[this.filtersRowIndex];\n let isDisplayed = fltRow.style.display === '';\n\n this.show(!isDisplayed);\n }\n\n /**\n * Show or hide filters\n *\n * @param {boolean} [visible=true] Visibility flag\n */\n show(visible = true) {\n let tf = this.tf;\n let tbl = tf.gridLayout ? tf.feature('gridLayout').headTbl : tf.dom();\n let fltRow = tbl.rows[this.filtersRowIndex];\n\n if (visible) {\n this.onBeforeShow(this);\n }\n if (!visible) {\n this.onBeforeHide(this);\n }\n\n fltRow.style.display = visible ? '' : 'none';\n if (this.enableIcon && !this.btnHtml) {\n this.btnEl.innerHTML = visible ?\n this.collapseBtnHtml : this.expandBtnHtml;\n }\n\n if (visible) {\n this.onAfterShow(this);\n }\n if (!visible) {\n this.onAfterHide(this);\n }\n\n this.emitter.emit('filters-toggled', tf, this, visible);\n }\n\n /**\n * Destroy the UI\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n this.emitter.off(['show-filters'], (tf, visible) => this.show(visible));\n\n this.btnEl.innerHTML = '';\n removeElm(this.btnEl);\n this.btnEl = null;\n\n this.contEl.innerHTML = '';\n removeElm(this.contEl);\n this.contEl = null;\n this.initialized = false;\n }\n\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/extensions/filtersVisibility/filtersVisibility.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 238,
"kind": "class",
"name": "FiltersVisibility",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js",
"static": true,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"access": "public",
"export": true,
"importPath": "tablefilter/src/extensions/filtersVisibility/filtersVisibility.js",
"importStyle": "FiltersVisibility",
"description": "Filters Visibility extension",
"lineNumber": 13,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 239,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#constructor",
"access": "public",
"description": "Creates an instance of FiltersVisibility",
"lineNumber": 20,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "Configuration",
"description": "object"
}
]
},
{
"__docId__": 240,
"kind": "member",
"name": "name",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#name",
"access": "public",
"description": "Module name",
"lineNumber": 27,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 241,
"kind": "member",
"name": "desc",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#desc",
"access": "public",
"description": "Module description",
"lineNumber": 33,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 242,
"kind": "member",
"name": "stylesheet",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#stylesheet",
"access": "public",
"description": "Extension's stylesheet filename",
"lineNumber": 40,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 243,
"kind": "member",
"name": "icnExpand",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpand",
"access": "public",
"description": "Expand icon filename",
"lineNumber": 46,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 244,
"kind": "member",
"name": "icnCollapse",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapse",
"access": "public",
"description": "Collapse icon filename",
"lineNumber": 52,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 245,
"kind": "member",
"name": "contEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contEl",
"access": "private",
"description": "Main container element",
"lineNumber": 58,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 246,
"kind": "member",
"name": "btnEl",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnEl",
"access": "private",
"description": "Button element",
"lineNumber": 64,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 247,
"kind": "member",
"name": "icnExpandHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnExpandHtml",
"access": "private",
"description": "Expand icon HTML",
"lineNumber": 70,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 248,
"kind": "member",
"name": "icnCollapseHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#icnCollapseHtml",
"access": "private",
"description": "Collapse icon HTML",
"lineNumber": 77,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 249,
"kind": "member",
"name": "defaultText",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#defaultText",
"access": "private",
"description": "Default text",
"lineNumber": 84,
"ignore": true,
"type": {
"types": [
"string"
]
}
},
{
"__docId__": 250,
"kind": "member",
"name": "targetId",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#targetId",
"access": "public",
"description": "ID of main container element",
"lineNumber": 90,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 251,
"kind": "member",
"name": "enableIcon",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#enableIcon",
"access": "public",
"description": "Enable expand/collapse icon, defaults to true",
"lineNumber": 96,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 252,
"kind": "member",
"name": "btnText",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnText",
"access": "public",
"description": "Custom text for button",
"lineNumber": 102,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 253,
"kind": "member",
"name": "collapseBtnHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#collapseBtnHtml",
"access": "private",
"description": "Collapse button HTML",
"lineNumber": 108,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 254,
"kind": "member",
"name": "expandBtnHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#expandBtnHtml",
"access": "private",
"description": "Expand button HTML",
"lineNumber": 116,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 255,
"kind": "member",
"name": "btnHtml",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnHtml",
"access": "public",
"description": "Button's custom HTML",
"lineNumber": 124,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 256,
"kind": "member",
"name": "btnCssClass",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#btnCssClass",
"access": "public",
"description": "Css class for expand/collapse filters button",
"lineNumber": 130,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 257,
"kind": "member",
"name": "contCssClass",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#contCssClass",
"access": "public",
"description": "Css class for main container",
"lineNumber": 136,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 258,
"kind": "member",
"name": "filtersRowIndex",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#filtersRowIndex",
"access": "public",
"description": "Filters row index",
"lineNumber": 142,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 259,
"kind": "member",
"name": "visibleAtStart",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#visibleAtStart",
"access": "public",
"description": "Make filters visible at initialization, defaults to true",
"lineNumber": 149,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 260,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#toolbarPosition",
"access": "public",
"description": "Default position in toolbar ('left'|'center'|'right')",
"lineNumber": 155,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 261,
"kind": "member",
"name": "onBeforeShow",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onBeforeShow",
"access": "public",
"description": "Callback fired before filters row is shown",
"lineNumber": 161,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 262,
"kind": "member",
"name": "onAfterShow",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onAfterShow",
"access": "public",
"description": "Callback fired after filters row is shown",
"lineNumber": 167,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 263,
"kind": "member",
"name": "onBeforeHide",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onBeforeHide",
"access": "public",
"description": "Callback fired before filters row is hidden",
"lineNumber": 173,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 264,
"kind": "member",
"name": "onAfterHide",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#onAfterHide",
"access": "public",
"description": "Callback fired after filters row is hidden",
"lineNumber": 179,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 265,
"kind": "method",
"name": "init",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#init",
"access": "public",
"description": "Initialise extension",
"lineNumber": 191,
"params": [],
"return": null
},
{
"__docId__": 266,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#initialized",
"access": "public",
"description": null,
"lineNumber": 202,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 267,
"kind": "method",
"name": "buildUI",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#buildUI",
"access": "public",
"description": "Build UI elements",
"lineNumber": 212,
"params": [],
"return": null
},
{
"__docId__": 270,
"kind": "method",
"name": "toggle",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#toggle",
"access": "public",
"description": "Toggle filters visibility",
"lineNumber": 254,
"params": [],
"return": null
},
{
"__docId__": 271,
"kind": "method",
"name": "show",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#show",
"access": "public",
"description": "Show or hide filters",
"lineNumber": 268,
"params": [
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": true,
"defaultValue": "true",
"defaultRaw": true,
"name": "visible",
"description": "Visibility flag"
}
],
"return": null
},
{
"__docId__": 272,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/filtersVisibility/filtersVisibility.js~FiltersVisibility#destroy",
"access": "public",
"description": "Destroy the UI",
"lineNumber": 299,
"params": [],
"return": null
},
{
"__docId__": 276,
"kind": "file",
"name": "src/extensions/sort/adapterSortabletable.js",
"content": "import {Feature} from '../../feature';\nimport {isUndef, isObj, EMPTY_FN} from '../../types';\nimport {createElm, elm, getText, tag} from '../../dom';\nimport {addEvt} from '../../event';\nimport {parse as parseNb} from '../../number';\nimport {\n NONE, CELL_TAG, HEADER_TAG, STRING, NUMBER, DATE, FORMATTED_NUMBER,\n IP_ADDRESS\n} from '../../const';\nimport {defaultsStr, defaultsFn, defaultsArr} from '../../settings';\n\n/**\n * SortableTable Adapter module\n */\nexport default class AdapterSortableTable extends Feature {\n\n /**\n * Creates an instance of AdapterSortableTable\n * @param {TableFilter} tf TableFilter instance\n * @param {Object} opts Configuration object\n */\n constructor(tf, opts) {\n super(tf, opts.name);\n\n /**\n * Module name\n * @type {String}\n */\n this.name = opts.name;\n\n /**\n * Module description\n * @type {String}\n */\n this.desc = defaultsStr(opts.description, 'Sortable table');\n\n /**\n * Indicate whether table previously sorted\n * @type {Boolean}\n * @private\n */\n this.sorted = false;\n\n /**\n * List of sort type per column basis\n * @type {Array}\n */\n this.sortTypes = defaultsArr(opts.types, tf.colTypes);\n\n /**\n * Column to be sorted at initialization, ie:\n * sort_col_at_start: [1, true]\n * @type {Array}\n */\n this.sortColAtStart = defaultsArr(opts.sort_col_at_start, null);\n\n /**\n * Enable asynchronous sort, if triggers are external\n * @type {Boolean}\n */\n this.asyncSort = Boolean(opts.async_sort);\n\n /**\n * List of element IDs triggering sort on a per column basis\n * @type {Array}\n */\n this.triggerIds = defaultsArr(opts.trigger_ids, []);\n\n // edit .sort-arrow.descending / .sort-arrow.ascending in\n // tablefilter.css to reflect any path change\n /**\n * Path to images\n * @type {String}\n */\n this.imgPath = defaultsStr(opts.images_path, tf.themesPath);\n\n /**\n * Blank image file name\n * @type {String}\n */\n this.imgBlank = defaultsStr(opts.image_blank, 'blank.png');\n\n /**\n * Css class for sort indicator image\n * @type {String}\n */\n this.imgClassName = defaultsStr(opts.image_class_name, 'sort-arrow');\n\n /**\n * Css class for ascending sort indicator image\n * @type {String}\n */\n this.imgAscClassName = defaultsStr(opts.image_asc_class_name,\n 'ascending');\n\n /**\n * Css class for descending sort indicator image\n * @type {String}\n */\n this.imgDescClassName = defaultsStr(opts.image_desc_class_name,\n 'descending');\n\n /**\n * Cell attribute key storing custom value used for sorting\n * @type {String}\n */\n this.customKey = defaultsStr(opts.custom_key, 'data-tf-sortKey');\n\n /**\n * Callback fired when sort extension is instanciated\n * @type {Function}\n */\n this.onSortLoaded = defaultsFn(opts.on_sort_loaded, EMPTY_FN);\n\n /**\n * Callback fired before a table column is sorted\n * @type {Function}\n */\n this.onBeforeSort = defaultsFn(opts.on_before_sort, EMPTY_FN);\n\n /**\n * Callback fired after a table column is sorted\n * @type {Function}\n */\n this.onAfterSort = defaultsFn(opts.on_after_sort, EMPTY_FN);\n\n /**\n * SortableTable instance\n * @private\n */\n this.stt = null;\n\n this.enable();\n }\n\n /**\n * Initializes AdapterSortableTable instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n let tf = this.tf;\n let adpt = this;\n\n // SortableTable class sanity check (sortabletable.js)\n if (isUndef(SortableTable)) {\n throw new Error('SortableTable class not found.');\n }\n\n // Add any date format if needed\n this.emitter.emit('add-date-type-formats', this.tf, this.sortTypes);\n\n this.overrideSortableTable();\n this.setSortTypes();\n\n this.onSortLoaded(tf, this);\n\n /*** SortableTable callbacks ***/\n this.stt.onbeforesort = function () {\n adpt.onBeforeSort(tf, adpt.stt.sortColumn);\n\n /*** sort behaviour for paging ***/\n if (tf.paging) {\n tf.feature('paging').disable();\n }\n };\n\n this.stt.onsort = function () {\n adpt.sorted = true;\n\n //sort behaviour for paging\n if (tf.paging) {\n let paginator = tf.feature('paging');\n // recalculate valid rows index as sorting may have change it\n tf.getValidRows(true);\n paginator.enable();\n paginator.setPage(paginator.getPage());\n }\n\n adpt.onAfterSort(tf, adpt.stt.sortColumn, adpt.stt.descending);\n adpt.emitter.emit('column-sorted', tf, adpt.stt.sortColumn,\n adpt.stt.descending);\n };\n\n // Column sort at start\n let sortColAtStart = adpt.sortColAtStart;\n if (sortColAtStart) {\n this.stt.sort(sortColAtStart[0], sortColAtStart[1]);\n }\n\n this.emitter.on(['sort'],\n (tf, colIdx, desc) => this.sortByColumnIndex(colIdx, desc));\n\n /** @inherited */\n this.initialized = true;\n\n this.emitter.emit('sort-initialized', tf, this);\n }\n\n /**\n * Sort specified column\n * @param {Number} colIdx Column index\n * @param {Boolean} desc Optional: descending manner\n */\n sortByColumnIndex(colIdx, desc) {\n this.stt.sort(colIdx, desc);\n }\n\n /**\n * Set SortableTable overrides for TableFilter integration\n */\n overrideSortableTable() {\n let adpt = this,\n tf = this.tf;\n\n /**\n * Overrides headerOnclick method in order to handle th event\n * @param {Object} e [description]\n */\n SortableTable.prototype.headerOnclick = function (evt) {\n if (!adpt.initialized) {\n return;\n }\n\n // find Header element\n let el = evt.target || evt.srcElement;\n\n while (el.tagName !== CELL_TAG && el.tagName !== HEADER_TAG) {\n el = el.parentNode;\n }\n\n this.sort(\n SortableTable.msie ?\n SortableTable.getCellIndex(el) : el.cellIndex\n );\n };\n\n /**\n * Overrides getCellIndex IE returns wrong cellIndex when columns are\n * hidden\n * @param {Object} oTd TD element\n * @return {Number} Cell index\n */\n SortableTable.getCellIndex = function (oTd) {\n let cells = oTd.parentNode.cells,\n l = cells.length, i;\n for (i = 0; cells[i] !== oTd && i < l; i++) { }\n return i;\n };\n\n /**\n * Overrides initHeader in order to handle filters row position\n * @param {Array} oSortTypes\n */\n SortableTable.prototype.initHeader = function (oSortTypes) {\n let stt = this;\n if (!stt.tHead) {\n if (tf.gridLayout) {\n stt.tHead = tf.feature('gridLayout').headTbl.tHead;\n } else {\n return;\n }\n }\n\n stt.headersRow = tf.headersRow;\n let cells = stt.tHead.rows[stt.headersRow].cells;\n stt.sortTypes = oSortTypes || [];\n let l = cells.length;\n let img, c;\n\n for (let i = 0; i < l; i++) {\n c = cells[i];\n if (stt.sortTypes[i] !== null && stt.sortTypes[i] !== 'None') {\n c.style.cursor = 'pointer';\n img = createElm('img',\n ['src', adpt.imgPath + adpt.imgBlank]);\n c.appendChild(img);\n if (stt.sortTypes[i] !== null) {\n c.setAttribute('_sortType', stt.sortTypes[i]);\n }\n addEvt(c, 'click', stt._headerOnclick);\n } else {\n c.setAttribute('_sortType', oSortTypes[i]);\n c._sortType = 'None';\n }\n }\n stt.updateHeaderArrows();\n };\n\n /**\n * Overrides updateHeaderArrows in order to handle arrows indicators\n */\n SortableTable.prototype.updateHeaderArrows = function () {\n let stt = this;\n let cells, l, img;\n\n // external headers\n if (adpt.asyncSort && adpt.triggerIds.length > 0) {\n let triggers = adpt.triggerIds;\n cells = [];\n l = triggers.length;\n for (let j = 0; j < l; j++) {\n cells.push(elm(triggers[j]));\n }\n } else {\n if (!this.tHead) {\n return;\n }\n cells = stt.tHead.rows[stt.headersRow].cells;\n l = cells.length;\n }\n for (let i = 0; i < l; i++) {\n let cell = cells[i];\n if (!cell) {\n continue;\n }\n let cellAttr = cell.getAttribute('_sortType');\n if (cellAttr !== null && cellAttr !== 'None') {\n img = cell.lastChild || cell;\n if (img.nodeName.toLowerCase() !== 'img') {\n img = createElm('img',\n ['src', adpt.imgPath + adpt.imgBlank]);\n cell.appendChild(img);\n }\n if (i === stt.sortColumn) {\n img.className = adpt.imgClassName + ' ' +\n (this.descending ?\n adpt.imgDescClassName :\n adpt.imgAscClassName);\n } else {\n img.className = adpt.imgClassName;\n }\n }\n }\n };\n\n /**\n * Overrides getRowValue for custom key value feature\n * @param {Object} oRow Row element\n * @param {String} sType\n * @param {Number} nColumn\n * @return {String}\n */\n SortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\n let stt = this;\n // if we have defined a custom getRowValue use that\n let sortTypeInfo = stt._sortTypeInfo[sType];\n if (sortTypeInfo && sortTypeInfo.getRowValue) {\n return sortTypeInfo.getRowValue(oRow, nColumn);\n }\n let c = oRow.cells[nColumn];\n let s = SortableTable.getInnerText(c);\n return stt.getValueFromString(s, sType);\n };\n\n /**\n * Overrides getInnerText in order to avoid Firefox unexpected sorting\n * behaviour with untrimmed text elements\n * @param {Object} oNode DOM element\n * @return {String} DOM element inner text\n */\n SortableTable.getInnerText = function (oNode) {\n if (!oNode) {\n return;\n }\n if (oNode.getAttribute(adpt.customKey)) {\n return oNode.getAttribute(adpt.customKey);\n } else {\n return getText(oNode);\n }\n };\n }\n\n /**\n * Adds a sort type\n */\n addSortType(...args) {\n // Extract the arguments\n let [id, caster, sorter] = args;\n SortableTable.prototype.addSortType(id, caster, sorter);\n }\n\n /**\n * Sets the sort types on a column basis\n * @private\n */\n setSortTypes() {\n let tf = this.tf,\n sortTypes = this.sortTypes,\n _sortTypes = [];\n\n tf.eachCol((i) => {\n let colType;\n if (sortTypes[i]) {\n colType = sortTypes[i];\n if (isObj(colType)) {\n if (colType.type === DATE) {\n colType = this._addDateType(i, sortTypes);\n }\n else if (colType.type === FORMATTED_NUMBER) {\n let decimal = colType.decimal || tf.decimalSeparator;\n colType = this._addNumberType(i, decimal);\n }\n } else {\n colType = colType.toLowerCase();\n if (colType === DATE) {\n colType = this._addDateType(i, sortTypes);\n }\n else if (colType === FORMATTED_NUMBER ||\n colType === NUMBER) {\n colType = this._addNumberType(i, tf.decimalSeparator);\n }\n else if (colType === NONE) {\n // TODO: normalise 'none' vs 'None'\n colType = 'None';\n }\n }\n } else {\n colType = STRING;\n }\n _sortTypes.push(colType);\n });\n\n //Public TF method to add sort type\n\n //Custom sort types\n this.addSortType('caseinsensitivestring', SortableTable.toUpperCase);\n this.addSortType(STRING);\n this.addSortType(IP_ADDRESS, ipAddress, sortIP);\n\n this.stt = new SortableTable(tf.dom(), _sortTypes);\n\n /*** external table headers adapter ***/\n if (this.asyncSort && this.triggerIds.length > 0) {\n let triggers = this.triggerIds;\n for (let j = 0; j < triggers.length; j++) {\n if (triggers[j] === null) {\n continue;\n }\n let trigger = elm(triggers[j]);\n if (trigger) {\n trigger.style.cursor = 'pointer';\n\n addEvt(trigger, 'click', (evt) => {\n let elm = evt.target;\n if (!this.tf.sort) {\n return;\n }\n this.stt.asyncSort(triggers.indexOf(elm.id));\n });\n trigger.setAttribute('_sortType', _sortTypes[j]);\n }\n }\n }\n }\n\n _addDateType(colIndex, types) {\n let tf = this.tf;\n let dateType = tf.feature('dateType');\n let locale = dateType.getOptions(colIndex, types).locale || tf.locale;\n let colType = `${DATE}-${locale}`;\n\n this.addSortType(colType, (value) => {\n let parsedDate = dateType.parse(value, locale);\n // Invalid date defaults to Wed Feb 04 -768 11:00:00\n return isNaN(+parsedDate) ? new Date(-86400000000000) : parsedDate;\n });\n return colType;\n }\n\n _addNumberType(colIndex, decimal) {\n let colType = `${FORMATTED_NUMBER}${decimal === '.' ? '' : '-custom'}`;\n\n this.addSortType(colType, (value) => {\n return parseNb(value, decimal);\n });\n return colType;\n }\n\n /**\n * Remove extension\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n let tf = this.tf;\n this.emitter.off(['sort'],\n (tf, colIdx, desc) => this.sortByColumnIndex(colIdx, desc));\n this.sorted = false;\n this.stt.destroy();\n\n let ids = tf.getFiltersId();\n for (let idx = 0; idx < ids.length; idx++) {\n let header = tf.getHeaderElement(idx);\n let img = tag(header, 'img');\n\n if (img.length === 1) {\n header.removeChild(img[0]);\n }\n }\n this.initialized = false;\n }\n\n}\n\n//Converters\nfunction ipAddress(value) {\n let vals = value.split('.');\n for (let x in vals) {\n let val = vals[x];\n while (3 > val.length) {\n val = '0' + val;\n }\n vals[x] = val;\n }\n return vals.join('.');\n}\n\nfunction sortIP(a, b) {\n let aa = ipAddress(a.value.toLowerCase());\n let bb = ipAddress(b.value.toLowerCase());\n if (aa === bb) {\n return 0;\n } else if (aa < bb) {\n return -1;\n } else {\n return 1;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/extensions/sort/adapterSortabletable.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 277,
"kind": "class",
"name": "AdapterSortableTable",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"static": true,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"access": "public",
"export": true,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": "AdapterSortableTable",
"description": "SortableTable Adapter module",
"lineNumber": 15,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 278,
"kind": "constructor",
"name": "constructor",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#constructor",
"access": "public",
"description": "Creates an instance of AdapterSortableTable",
"lineNumber": 22,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
},
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "opts",
"description": "Configuration object"
}
]
},
{
"__docId__": 279,
"kind": "member",
"name": "name",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#name",
"access": "public",
"description": "Module name",
"lineNumber": 29,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 280,
"kind": "member",
"name": "desc",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#desc",
"access": "public",
"description": "Module description",
"lineNumber": 35,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 281,
"kind": "member",
"name": "sorted",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sorted",
"access": "private",
"description": "Indicate whether table previously sorted",
"lineNumber": 42,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 282,
"kind": "member",
"name": "sortTypes",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sortTypes",
"access": "public",
"description": "List of sort type per column basis",
"lineNumber": 48,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 283,
"kind": "member",
"name": "sortColAtStart",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sortColAtStart",
"access": "public",
"description": "Column to be sorted at initialization, ie:\nsort_col_at_start: [1, true]",
"lineNumber": 55,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 284,
"kind": "member",
"name": "asyncSort",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#asyncSort",
"access": "public",
"description": "Enable asynchronous sort, if triggers are external",
"lineNumber": 61,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 285,
"kind": "member",
"name": "triggerIds",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#triggerIds",
"access": "public",
"description": "List of element IDs triggering sort on a per column basis",
"lineNumber": 67,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 286,
"kind": "member",
"name": "imgPath",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgPath",
"access": "public",
"description": "Path to images",
"lineNumber": 75,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 287,
"kind": "member",
"name": "imgBlank",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgBlank",
"access": "public",
"description": "Blank image file name",
"lineNumber": 81,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 288,
"kind": "member",
"name": "imgClassName",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgClassName",
"access": "public",
"description": "Css class for sort indicator image",
"lineNumber": 87,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 289,
"kind": "member",
"name": "imgAscClassName",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgAscClassName",
"access": "public",
"description": "Css class for ascending sort indicator image",
"lineNumber": 93,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 290,
"kind": "member",
"name": "imgDescClassName",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#imgDescClassName",
"access": "public",
"description": "Css class for descending sort indicator image",
"lineNumber": 100,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 291,
"kind": "member",
"name": "customKey",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#customKey",
"access": "public",
"description": "Cell attribute key storing custom value used for sorting",
"lineNumber": 107,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 292,
"kind": "member",
"name": "onSortLoaded",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#onSortLoaded",
"access": "public",
"description": "Callback fired when sort extension is instanciated",
"lineNumber": 113,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 293,
"kind": "member",
"name": "onBeforeSort",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#onBeforeSort",
"access": "public",
"description": "Callback fired before a table column is sorted",
"lineNumber": 119,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 294,
"kind": "member",
"name": "onAfterSort",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#onAfterSort",
"access": "public",
"description": "Callback fired after a table column is sorted",
"lineNumber": 125,
"type": {
"nullable": null,
"types": [
"Function"
],
"spread": false,
"description": null
}
},
{
"__docId__": 295,
"kind": "member",
"name": "stt",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#stt",
"access": "private",
"description": "SortableTable instance",
"lineNumber": 131,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 296,
"kind": "method",
"name": "init",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#init",
"access": "public",
"description": "Initializes AdapterSortableTable instance",
"lineNumber": 139,
"params": [],
"return": null
},
{
"__docId__": 297,
"kind": "member",
"name": "initialized",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#initialized",
"access": "public",
"description": null,
"lineNumber": 196,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 298,
"kind": "method",
"name": "sortByColumnIndex",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#sortByColumnIndex",
"access": "public",
"description": "Sort specified column",
"lineNumber": 206,
"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"
}
],
"return": null
},
{
"__docId__": 299,
"kind": "method",
"name": "overrideSortableTable",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#overrideSortableTable",
"access": "public",
"description": "Set SortableTable overrides for TableFilter integration",
"lineNumber": 213,
"params": [],
"return": null
},
{
"__docId__": 300,
"kind": "method",
"name": "addSortType",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#addSortType",
"access": "public",
"description": "Adds a sort type",
"lineNumber": 378,
"params": [
{
"name": "args",
"types": [
"...*"
],
"spread": true
}
],
"return": null
},
{
"__docId__": 301,
"kind": "method",
"name": "setSortTypes",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#setSortTypes",
"access": "private",
"description": "Sets the sort types on a column basis",
"lineNumber": 388,
"ignore": true,
"params": [],
"return": null
},
{
"__docId__": 303,
"kind": "method",
"name": "_addDateType",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#_addDateType",
"access": "private",
"description": null,
"lineNumber": 458,
"undocument": true,
"ignore": true,
"params": [
{
"name": "colIndex",
"types": [
"*"
]
},
{
"name": "types",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
}
},
{
"__docId__": 304,
"kind": "method",
"name": "_addNumberType",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#_addNumberType",
"access": "private",
"description": null,
"lineNumber": 472,
"undocument": true,
"ignore": true,
"params": [
{
"name": "colIndex",
"types": [
"*"
]
},
{
"name": "decimal",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
}
},
{
"__docId__": 305,
"kind": "method",
"name": "destroy",
"memberof": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable",
"generator": false,
"async": false,
"static": false,
"longname": "src/extensions/sort/adapterSortabletable.js~AdapterSortableTable#destroy",
"access": "public",
"description": "Remove extension",
"lineNumber": 484,
"params": [],
"return": null
},
{
"__docId__": 308,
"kind": "function",
"name": "ipAddress",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/extensions/sort/adapterSortabletable.js~ipAddress",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 509,
"undocument": true,
"params": [
{
"name": "value",
"types": [
"*"
]
}
],
"return": {
"types": [
"*"
]
},
"ignore": true
},
{
"__docId__": 309,
"kind": "function",
"name": "sortIP",
"memberof": "src/extensions/sort/adapterSortabletable.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/extensions/sort/adapterSortabletable.js~sortIP",
"access": "public",
"export": false,
"importPath": "tablefilter/src/extensions/sort/adapterSortabletable.js",
"importStyle": null,
"description": null,
"lineNumber": 521,
"undocument": true,
"params": [
{
"name": "a",
"types": [
"*"
]
},
{
"name": "b",
"types": [
"*"
]
}
],
"return": {
"types": [
"number"
]
},
"ignore": true
},
{
"__docId__": 310,
"kind": "file",
"name": "src/extensions/sort/sort.js",
"content": "import AdapterSortableTable from './adapterSortabletable';\nimport {root} from '../../root';\n\nif (!root.SortableTable) {\n require('script-loader!sortabletable');\n}\n\nexport default AdapterSortableTable;\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/extensions/sort/sort.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 311,
"kind": "file",
"name": "src/feature.js",
"content": "\nconst NOT_IMPLEMENTED = 'Not implemented.';\n\n/**\n * Base class defining the interface of a TableFilter feature\n */\nexport class Feature {\n /**\n * Creates an instance of Feature\n * @param {Object} tf TableFilter instance\n * @param {String} feature Feature name known by TableFilter\n */\n constructor(tf, feature) {\n /**\n * TableFilter instance\n * @type {TableFilter}\n */\n this.tf = tf;\n\n /**\n * Feature name\n * @type {String}\n */\n this.feature = feature;\n\n /**\n * TableFilter feature setting\n * @type {Boolean}\n */\n this.enabled = tf[feature];\n\n /**\n * TableFilter configuration\n * @type {Object}\n */\n this.config = tf.config();\n\n /**\n * TableFilter emitter instance\n * @type {Emitter}\n */\n this.emitter = tf.emitter;\n\n /**\n * Field indicating whether Feature is initialized\n * @type {Boolean}\n */\n this.initialized = false;\n\n /** Subscribe to destroy event */\n this.emitter.on(['destroy'], () => this.destroy());\n }\n\n /**\n * Initialize the feature\n */\n init() {\n throw new Error(NOT_IMPLEMENTED);\n }\n\n /**\n * Reset the feature after being disabled\n */\n reset() {\n this.enable();\n this.init();\n }\n\n /**\n * Destroy the feature\n */\n destroy() {\n throw new Error(NOT_IMPLEMENTED);\n }\n\n /**\n * Enable the feature\n */\n enable() {\n this.enabled = true;\n }\n\n /**\n * Disable the feature\n */\n disable() {\n this.enabled = false;\n }\n\n /**\n * Indicate whether the feature is enabled or not\n * @returns {Boolean}\n */\n isEnabled() {\n return this.enabled === true;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/feature.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 312,
"kind": "variable",
"name": "NOT_IMPLEMENTED",
"memberof": "src/feature.js",
"static": true,
"longname": "src/feature.js~NOT_IMPLEMENTED",
"access": "public",
"export": false,
"importPath": "tablefilter/src/feature.js",
"importStyle": null,
"description": null,
"lineNumber": 2,
"undocument": true,
"type": {
"types": [
"string"
]
},
"ignore": true
},
{
"__docId__": 313,
"kind": "class",
"name": "Feature",
"memberof": "src/feature.js",
"static": true,
"longname": "src/feature.js~Feature",
"access": "public",
"export": true,
"importPath": "tablefilter/src/feature.js",
"importStyle": "{Feature}",
"description": "Base class defining the interface of a TableFilter feature",
"lineNumber": 7,
"interface": false
},
{
"__docId__": 314,
"kind": "constructor",
"name": "constructor",
"memberof": "src/feature.js~Feature",
"generator": false,
"async": false,
"static": false,
"longname": "src/feature.js~Feature#constructor",
"access": "public",
"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"
}
]
},
{
"__docId__": 315,
"kind": "member",
"name": "tf",
"memberof": "src/feature.js~Feature",
"static": false,
"longname": "src/feature.js~Feature#tf",
"access": "public",
"description": "TableFilter instance",
"lineNumber": 18,
"type": {
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"description": null
}
},
{
"__docId__": 316,
"kind": "member",
"name": "feature",
"memberof": "src/feature.js~Feature",
"static": false,
"longname": "src/feature.js~Feature#feature",
"access": "public",
"description": "Feature name",
"lineNumber": 24,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 317,
"kind": "member",
"name": "enabled",
"memberof": "src/feature.js~Feature",
"static": false,
"longname": "src/feature.js~Feature#enabled",
"access": "public",
"description": "TableFilter feature setting",
"lineNumber": 30,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 318,
"kind": "member",
"name": "config",
"memberof": "src/feature.js~Feature",
"static": false,
"longname": "src/feature.js~Feature#config",
"access": "public",
"description": "TableFilter configuration",
"lineNumber": 36,
"type": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": null
}
},
{
"__docId__": 319,
"kind": "member",
"name": "emitter",
"memberof": "src/feature.js~Feature",
"static": false,
"longname": "src/feature.js~Feature#emitter",
"access": "public",
"description": "TableFilter emitter instance",
"lineNumber": 42,
"type": {
"nullable": null,
"types": [
"Emitter"
],
"spread": false,
"description": null
}
},
{
"__docId__": 320,
"kind": "member",
"name": "initialized",
"memberof": "src/feature.js~Feature",
"static": false,
"longname": "src/feature.js~Feature#initialized",
"access": "public",
"description": "Field indicating whether Feature is initialized",
"lineNumber": 48,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 321,
"kind": "method",
"name": "init",
"memberof": "src/feature.js~Feature",
"generator": false,
"async": false,
"static": false,
"longname": "src/feature.js~Feature#init",
"access": "public",
"description": "Initialize the feature",
"lineNumber": 57,
"params": [],
"return": null
},
{
"__docId__": 322,
"kind": "method",
"name": "reset",
"memberof": "src/feature.js~Feature",
"generator": false,
"async": false,
"static": false,
"longname": "src/feature.js~Feature#reset",
"access": "public",
"description": "Reset the feature after being disabled",
"lineNumber": 64,
"params": [],
"return": null
},
{
"__docId__": 323,
"kind": "method",
"name": "destroy",
"memberof": "src/feature.js~Feature",
"generator": false,
"async": false,
"static": false,
"longname": "src/feature.js~Feature#destroy",
"access": "public",
"description": "Destroy the feature",
"lineNumber": 72,
"params": [],
"return": null
},
{
"__docId__": 324,
"kind": "method",
"name": "enable",
"memberof": "src/feature.js~Feature",
"generator": false,
"async": false,
"static": false,
"longname": "src/feature.js~Feature#enable",
"access": "public",
"description": "Enable the feature",
"lineNumber": 79,
"params": [],
"return": null
},
{
"__docId__": 326,
"kind": "method",
"name": "disable",
"memberof": "src/feature.js~Feature",
"generator": false,
"async": false,
"static": false,
"longname": "src/feature.js~Feature#disable",
"access": "public",
"description": "Disable the feature",
"lineNumber": 86,
"params": [],
"return": null
},
{
"__docId__": 328,
"kind": "method",
"name": "isEnabled",
"memberof": "src/feature.js~Feature",
"generator": false,
"async": false,
"static": false,
"longname": "src/feature.js~Feature#isEnabled",
"access": "public",
"description": "Indicate whether the feature is enabled or not",
"lineNumber": 94,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Boolean}"
}
],
"return": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": ""
},
"params": []
},
{
"__docId__": 329,
"kind": "file",
"name": "src/modules/alternateRows.js",
"content": "import {Feature} from '../feature';\nimport {addClass, removeClass} from '../dom';\nimport {defaultsStr} from '../settings';\n\n/**\n * Rows with alternating background color for improved readability\n */\nexport class AlternateRows extends Feature {\n\n /**\n * Creates an instance of AlternateRows.\n *\n * @param {Object} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'alternateRows');\n\n let config = this.config;\n /**\n * Css class for even rows (default: 'even')\n * @type {String}\n */\n this.evenCss = defaultsStr(config.even_row_css_class, 'even');\n\n /**\n * Css class for odd rows (default: 'odd')\n * @type {String}\n */\n this.oddCss = defaultsStr(config.odd_row_css_class, 'odd');\n }\n\n /**\n * Sets alternating rows color\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n this.processAll();\n\n // Subscribe to events\n this.emitter.on(['row-processed', 'row-paged'],\n (tf, rowIndex, arrIndex, isValid) =>\n this.processRow(rowIndex, arrIndex, isValid));\n this.emitter.on(['column-sorted', 'rows-changed'],\n () => this.processAll());\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Apply background to all valid rows\n */\n processAll() {\n if (!this.isEnabled()) {\n return;\n }\n let tf = this.tf;\n let validRowsIndex = tf.getValidRows(true);\n let indexLen = validRowsIndex.length;\n let idx = 0;\n\n //alternates bg color\n for (let j = 0; j < indexLen; j++) {\n let rowIdx = validRowsIndex[j];\n this.setRowBg(rowIdx, idx);\n idx++;\n }\n }\n\n /**\n * Set/remove row background based on row validation\n * @param {Number} rowIdx Row index\n * @param {Number} arrIdx Array index\n * @param {Boolean} isValid Valid row flag\n */\n processRow(rowIdx, arrIdx, isValid) {\n if (isValid) {\n this.setRowBg(rowIdx, arrIdx);\n } else {\n this.removeRowBg(rowIdx);\n }\n }\n\n /**\n * Sets row background color\n * @param {Number} rowIdx Row index\n * @param {Number} idx Valid rows collection index needed to calculate bg\n * color\n * @private\n */\n setRowBg(rowIdx, idx) {\n if (!this.isEnabled() || isNaN(rowIdx)) {\n return;\n }\n let rows = this.tf.dom().rows;\n let i = isNaN(idx) ? rowIdx : idx;\n this.removeRowBg(rowIdx);\n\n addClass(rows[rowIdx], (i % 2) ? this.evenCss : this.oddCss);\n }\n\n /**\n * Removes row background color\n * @param {Number} idx Row index\n * @private\n */\n removeRowBg(idx) {\n if (isNaN(idx)) {\n return;\n }\n let rows = this.tf.dom().rows;\n removeClass(rows[idx], this.oddCss);\n removeClass(rows[idx], this.evenCss);\n }\n\n /**\n * Removes all alternating backgrounds\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n let eachRow = this.tf.eachRow(0);\n eachRow((row, i) => this.removeRowBg(i));\n\n // Unsubscribe to events\n this.emitter.off(['row-processed', 'row-paged'],\n (tf, rowIndex, arrIndex, isValid) =>\n this.processRow(rowIndex, arrIndex, isValid));\n this.emitter.off(['column-sorted', 'rows-changed'],\n () => this.processAll());\n\n this.initialized = false;\n }\n\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/modules/alternateRows.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 330,
"kind": "class",
"name": "AlternateRows",
"memberof": "src/modules/alternateRows.js",
"static": true,
"longname": "src/modules/alternateRows.js~AlternateRows",
"access": "public",
"export": true,
"importPath": "tablefilter/src/modules/alternateRows.js",
"importStyle": "{AlternateRows}",
"description": "Rows with alternating background color for improved readability",
"lineNumber": 8,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 331,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#constructor",
"access": "public",
"description": "Creates an instance of AlternateRows.",
"lineNumber": 15,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
]
},
{
"__docId__": 332,
"kind": "member",
"name": "evenCss",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#evenCss",
"access": "public",
"description": "Css class for even rows (default: 'even')",
"lineNumber": 23,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 333,
"kind": "member",
"name": "oddCss",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#oddCss",
"access": "public",
"description": "Css class for odd rows (default: 'odd')",
"lineNumber": 29,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 334,
"kind": "method",
"name": "init",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#init",
"access": "public",
"description": "Sets alternating rows color",
"lineNumber": 35,
"params": [],
"return": null
},
{
"__docId__": 335,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#initialized",
"access": "public",
"description": null,
"lineNumber": 50,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 336,
"kind": "method",
"name": "processAll",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#processAll",
"access": "public",
"description": "Apply background to all valid rows",
"lineNumber": 56,
"params": [],
"return": null
},
{
"__docId__": 337,
"kind": "method",
"name": "processRow",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#processRow",
"access": "public",
"description": "Set/remove row background based on row validation",
"lineNumber": 79,
"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"
}
],
"return": null
},
{
"__docId__": 338,
"kind": "method",
"name": "setRowBg",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#setRowBg",
"access": "private",
"description": "Sets row background color",
"lineNumber": 94,
"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"
}
],
"ignore": true,
"return": null
},
{
"__docId__": 339,
"kind": "method",
"name": "removeRowBg",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#removeRowBg",
"access": "private",
"description": "Removes row background color",
"lineNumber": 110,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "idx",
"description": "Row index"
}
],
"ignore": true,
"return": null
},
{
"__docId__": 340,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/alternateRows.js~AlternateRows",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/alternateRows.js~AlternateRows#destroy",
"access": "public",
"description": "Removes all alternating backgrounds",
"lineNumber": 122,
"params": [],
"return": null
},
{
"__docId__": 342,
"kind": "file",
"name": "src/modules/baseDropdown.js",
"content": "import {Feature} from '../feature';\nimport {\n ignoreCase, numSortAsc, numSortDesc,\n dateSortAsc, sortNumberStr, sortDateStr\n} from '../sort';\nimport {isArray, isObj, isEmpty} from '../types';\nimport {NUMBER, FORMATTED_NUMBER, DATE} from '../const';\n\n/**\n * Base class for Dropdown and CheckList UI components\n * @export\n * @class BaseDropdown\n * @extends {Feature}\n */\nexport class BaseDropdown extends Feature {\n\n /**\n * Creates an instance of BaseDropdown\n * @param {TableFilter} tf\n */\n constructor(tf) {\n super(tf, 'baseDropdown');\n\n let f = this.config;\n\n /**\n * Filter options custom sorter on a column basis\n * @type {Object}\n */\n this.customSorter = isObj(f.filter_options_sorter) &&\n isArray(f.filter_options_sorter.col) &&\n isArray(f.filter_options_sorter.comparer) ?\n f.filter_options_sorter :\n null;\n\n // TODO: move here all properties shared by Dropdown CheckList\n\n /**\n * Has custom options\n * @type {Boolean}\n * @private\n */\n this.isCustom = false;\n\n /**\n * List of options values\n * @type {Array}\n * @private\n */\n this.opts = [];\n\n /**\n * List of options texts for custom values\n * @type {Array}\n * @private\n */\n this.optsTxt = [];\n\n /**\n * List of options to be excluded from the checklist filter\n * @type {Array}\n * @private\n */\n this.excludedOpts = [];\n }\n\n /**\n * Sort passed options based on the type of the specified column\n * @param {Number} colIndex Column index\n * @param {Array} [options=[]] Collection of values\n * @return {Array} Sorted values\n * @private\n */\n sortOptions(colIndex, options = []) {\n let tf = this.tf;\n\n if (tf.isCustomOptions(colIndex) || !tf.sortSlc ||\n (isArray(tf.sortSlc) && tf.sortSlc.indexOf(colIndex) === -1)) {\n return options;\n }\n\n let { caseSensitive, sortNumDesc } = tf;\n let compareFn;\n\n if (this.customSorter &&\n this.customSorter.col.indexOf(colIndex) !== -1) {\n var idx = this.customSorter.col.indexOf(colIndex);\n compareFn = this.customSorter.comparer[idx];\n }\n else if (tf.hasType(colIndex, [NUMBER, FORMATTED_NUMBER])) {\n let decimal = tf.getDecimal(colIndex);\n let comparer = numSortAsc;\n if (sortNumDesc === true || sortNumDesc.indexOf(colIndex) !== -1) {\n comparer = numSortDesc;\n }\n compareFn = sortNumberStr(comparer, decimal);\n }\n else if (tf.hasType(colIndex, [DATE])) {\n let locale = tf.feature('dateType').getLocale(colIndex);\n let comparer = dateSortAsc;\n compareFn = sortDateStr(comparer, locale);\n } else { // string\n compareFn = caseSensitive ? undefined : ignoreCase;\n }\n\n return options.sort(compareFn);\n }\n\n /**\n * Regenerate filters of specified columns and maintain selection if any\n * @param {Array} colIndexes Collection of column indexes\n * @private\n */\n refreshFilters(colIndexes) {\n colIndexes.forEach((colIdx) => {\n let values = this.getValues(colIdx);\n this.build(colIdx, this.tf.linkedFilters);\n this.selectOptions(colIdx, values);\n });\n }\n\n /**\n * Check passed row contains a valid linked value\n * @param {Number} rowIdx Row index\n * @param {Number} activeFilterIdx Current active filter index\n * @returns {Boolean}\n */\n isValidLinkedValue(rowIdx, activeFilterIdx) {\n let tf = this.tf;\n\n if (tf.disableExcludedOptions) {\n return true;\n }\n\n if (tf.paging) {\n if (!isEmpty(activeFilterIdx) && tf.isRowValid(rowIdx)) {\n return true;\n }\n } else {\n if (tf.isRowDisplayed(rowIdx)) {\n return true;\n }\n }\n\n return false;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/modules/baseDropdown.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 343,
"kind": "class",
"name": "BaseDropdown",
"memberof": "src/modules/baseDropdown.js",
"static": true,
"longname": "src/modules/baseDropdown.js~BaseDropdown",
"access": "public",
"export": true,
"importPath": "tablefilter/src/modules/baseDropdown.js",
"importStyle": "{BaseDropdown}",
"description": "Base class for Dropdown and CheckList UI components",
"lineNumber": 15,
"unknown": [
{
"tagName": "@class",
"tagValue": "BaseDropdown"
}
],
"interface": false,
"extends": [
"Feature"
]
},
{
"__docId__": 344,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/baseDropdown.js~BaseDropdown#constructor",
"access": "public",
"description": "Creates an instance of BaseDropdown",
"lineNumber": 21,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": ""
}
]
},
{
"__docId__": 345,
"kind": "member",
"name": "customSorter",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
"static": false,
"longname": "src/modules/baseDropdown.js~BaseDropdown#customSorter",
"access": "public",
"description": "Filter options custom sorter on a column basis",
"lineNumber": 30,
"type": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": null
}
},
{
"__docId__": 346,
"kind": "member",
"name": "isCustom",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
"static": false,
"longname": "src/modules/baseDropdown.js~BaseDropdown#isCustom",
"access": "private",
"description": "Has custom options",
"lineNumber": 43,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 347,
"kind": "member",
"name": "opts",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
"static": false,
"longname": "src/modules/baseDropdown.js~BaseDropdown#opts",
"access": "private",
"description": "List of options values",
"lineNumber": 50,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 348,
"kind": "member",
"name": "optsTxt",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
"static": false,
"longname": "src/modules/baseDropdown.js~BaseDropdown#optsTxt",
"access": "private",
"description": "List of options texts for custom values",
"lineNumber": 57,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 349,
"kind": "member",
"name": "excludedOpts",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
"static": false,
"longname": "src/modules/baseDropdown.js~BaseDropdown#excludedOpts",
"access": "private",
"description": "List of options to be excluded from the checklist filter",
"lineNumber": 64,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 350,
"kind": "method",
"name": "sortOptions",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/baseDropdown.js~BaseDropdown#sortOptions",
"access": "private",
"description": "Sort passed options based on the type of the specified column",
"lineNumber": 74,
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "options",
"description": "Collection of values"
}
],
"return": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": "Sorted values"
},
"ignore": true
},
{
"__docId__": 351,
"kind": "method",
"name": "refreshFilters",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/baseDropdown.js~BaseDropdown#refreshFilters",
"access": "private",
"description": "Regenerate filters of specified columns and maintain selection if any",
"lineNumber": 114,
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "colIndexes",
"description": "Collection of column indexes"
}
],
"ignore": true,
"return": null
},
{
"__docId__": 352,
"kind": "method",
"name": "isValidLinkedValue",
"memberof": "src/modules/baseDropdown.js~BaseDropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/baseDropdown.js~BaseDropdown#isValidLinkedValue",
"access": "public",
"description": "Check passed row contains a valid linked value",
"lineNumber": 128,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Boolean}"
}
],
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "rowIdx",
"description": "Row index"
},
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "activeFilterIdx",
"description": "Current active filter index"
}
],
"return": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 353,
"kind": "file",
"name": "src/modules/checkList.js",
"content": "import {BaseDropdown} from './baseDropdown';\nimport {\n addClass, createCheckItem, createText, createElm, elm, removeClass, tag\n} from '../dom';\nimport {has} from '../array';\nimport {matchCase, trim, rgxEsc} from '../string';\nimport {addEvt, removeEvt, targetEvt} from '../event';\nimport {isEmpty} from '../types';\nimport {CHECKLIST, NONE} from '../const';\nimport {defaultsStr, defaultsBool} from '../settings';\n\n/**\n * Checklist filter UI component\n * @export\n * @class CheckList\n * @extends {BaseDropdown}\n */\nexport class CheckList extends BaseDropdown {\n\n /**\n * Creates an instance of CheckList\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'checkList');\n\n let f = this.config;\n\n /**\n * List of container DOM elements\n * @type {Array}\n */\n this.containers = [];\n\n /**\n * Css class for the container of the checklist filter (div)\n * @type {String}\n */\n this.containerCssClass = defaultsStr(f.div_checklist_css_class,\n 'div_checklist');\n\n /**\n * Css class for the checklist filter element (ul)\n * @type {String}\n */\n this.filterCssClass = defaultsStr(f.checklist_css_class,\n 'flt_checklist');\n\n /**\n * Css class for the item of a checklist (li)\n * @type {String}\n */\n this.itemCssClass = defaultsStr(f.checklist_item_css_class,\n 'flt_checklist_item');\n\n /**\n * Css class for a selected item of a checklist (li)\n * @type {String}\n */\n this.selectedItemCssClass = defaultsStr(\n f.checklist_selected_item_css_class,\n 'flt_checklist_slc_item'\n );\n\n /**\n * Text placed in the filter's container when load filter on demand\n * feature is enabled\n * @type {String}\n */\n this.activateText = defaultsStr(\n f.activate_checklist_text,\n 'Click to load filter data'\n );\n\n /**\n * Css class for a disabled item of a checklist (li)\n * @type {String}\n */\n this.disabledItemCssClass = defaultsStr(\n f.checklist_item_disabled_css_class,\n 'flt_checklist_item_disabled'\n );\n\n /**\n * Enable the reset filter option as first item\n * @type {Boolean}\n */\n this.enableResetOption = defaultsBool(f.enable_checklist_reset_filter,\n true);\n\n /**\n * Prefix for container element ID\n * @type {String}\n * @private\n */\n this.prfx = 'chkdiv_';\n }\n\n /**\n * Checklist option click event handler\n * @param {Event} evt\n * @private\n */\n optionClick(evt) {\n let elm = targetEvt(evt);\n let tf = this.tf;\n\n this.emitter.emit('filter-focus', tf, elm);\n this.setItemOption(elm);\n tf.filter();\n }\n\n /**\n * Checklist container click event handler for load-on-demand feature\n * @param {Event} evt\n * @private\n */\n onCheckListClick(evt) {\n let elm = targetEvt(evt);\n if (this.tf.loadFltOnDemand && elm.getAttribute('filled') === '0') {\n let ct = elm.getAttribute('ct');\n let div = this.containers[ct];\n this.build(ct);\n removeEvt(div, 'click', (evt) => this.onCheckListClick(evt));\n }\n }\n\n /**\n * Refresh all checklist filters\n */\n refreshAll() {\n let colIdxs = this.tf.getFiltersByType(CHECKLIST, true);\n this.refreshFilters(colIdxs);\n }\n\n /**\n * Initialize checklist filter\n * @param {Number} colIndex Column index\n * @param {Boolean} isExternal External filter flag\n * @param {DOMElement} container Dom element containing the filter\n */\n init(colIndex, isExternal, container) {\n let tf = this.tf;\n let externalFltTgtId = isExternal ?\n tf.externalFltIds[colIndex] : null;\n\n let divCont = createElm('div',\n ['id', `${this.prfx}${colIndex}_${tf.id}`],\n ['ct', colIndex], ['filled', '0']);\n divCont.className = this.containerCssClass;\n\n //filter is appended in desired element\n if (externalFltTgtId) {\n elm(externalFltTgtId).appendChild(divCont);\n } else {\n container.appendChild(divCont);\n }\n\n this.containers[colIndex] = divCont;\n tf.fltIds.push(tf.buildFilterId(colIndex));\n\n if (!tf.loadFltOnDemand) {\n this.build(colIndex);\n } else {\n addEvt(divCont, 'click', (evt) => this.onCheckListClick(evt));\n divCont.appendChild(createText(this.activateText));\n }\n\n this.emitter.on(\n ['build-checklist-filter'],\n (tf, colIndex, isLinked) => this.build(colIndex, isLinked)\n );\n\n this.emitter.on(\n ['select-checklist-options'],\n (tf, colIndex, values) => this.selectOptions(colIndex, values)\n );\n\n this.emitter.on(['rows-changed'], () => this.refreshAll());\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Build checklist UI\n * @param {Number} colIndex Column index\n * @param {Boolean} isLinked Enable linked filters behaviour\n */\n build(colIndex, isLinked = false) {\n let tf = this.tf;\n colIndex = Number(colIndex);\n\n this.emitter.emit('before-populating-filter', tf, colIndex);\n\n /** @inherited */\n this.opts = [];\n /** @inherited */\n this.optsTxt = [];\n\n let flt = this.containers[colIndex];\n let ul = createElm('ul',\n ['id', tf.fltIds[colIndex]],\n ['colIndex', colIndex]);\n ul.className = this.filterCssClass;\n\n let caseSensitive = tf.caseSensitive;\n /** @inherited */\n this.isCustom = tf.isCustomOptions(colIndex);\n\n //Retrieves custom values\n if (this.isCustom) {\n let customValues = tf.getCustomOptions(colIndex);\n this.opts = customValues[0];\n this.optsTxt = customValues[1];\n }\n\n let activeIdx;\n let activeFilterId = tf.getActiveFilterId();\n\n if (isLinked && activeFilterId) {\n activeIdx = tf.getColumnIndexFromFilterId(activeFilterId);\n }\n\n let filteredDataCol = [];\n if (isLinked && tf.disableExcludedOptions) {\n /** @inherited */\n this.excludedOpts = [];\n }\n\n flt.innerHTML = '';\n\n let eachRow = tf.eachRow();\n eachRow(\n (row) => {\n let cellValue = tf.getCellValue(row.cells[colIndex]);\n //Vary Peter's patch\n let cellString = matchCase(cellValue, caseSensitive);\n // checks if celldata is already in array\n if (!has(this.opts, cellString, caseSensitive)) {\n this.opts.push(cellValue);\n }\n let filteredCol = filteredDataCol[colIndex];\n if (isLinked && tf.disableExcludedOptions) {\n if (!filteredCol) {\n filteredCol = tf.getVisibleColumnValues(colIndex);\n }\n if (!has(filteredCol, cellString, caseSensitive) &&\n !has(this.excludedOpts, cellString, caseSensitive)) {\n this.excludedOpts.push(cellValue);\n }\n }\n },\n // continue conditions function\n (row, k) => {\n // excluded rows don't need to appear on selects as always valid\n if (tf.excludeRows.indexOf(k) !== -1) {\n return true;\n }\n\n // checks if row has expected number of cells\n if (row.cells.length !== tf.nbCells || this.isCustom) {\n return true;\n }\n\n if (isLinked && !this.isValidLinkedValue(k, activeIdx)) {\n return true;\n }\n }\n );\n\n //sort options\n this.opts = this.sortOptions(colIndex, this.opts);\n if (this.excludedOpts) {\n this.excludedOpts = this.sortOptions(colIndex, this.excludedOpts);\n }\n\n this.addChecks(colIndex, ul);\n\n if (tf.loadFltOnDemand) {\n flt.innerHTML = '';\n }\n flt.appendChild(ul);\n flt.setAttribute('filled', '1');\n\n this.emitter.emit('after-populating-filter', tf, colIndex, flt);\n }\n\n /**\n * Add checklist options\n * @param {Number} colIndex Column index\n * @param {Object} ul Ul element\n * @private\n */\n addChecks(colIndex, ul) {\n let tf = this.tf;\n let chkCt = this.addTChecks(colIndex, ul);\n\n for (let y = 0; y < this.opts.length; y++) {\n let val = this.opts[y]; //item value\n let lbl = this.isCustom ? this.optsTxt[y] : val; //item text\n let fltId = tf.fltIds[colIndex];\n let lblIdx = y + chkCt;\n let li = createCheckItem(`${fltId}_${lblIdx}`, val, lbl,\n ['data-idx', lblIdx]);\n li.className = this.itemCssClass;\n\n if (tf.linkedFilters && tf.disableExcludedOptions &&\n has(this.excludedOpts, matchCase(val, tf.caseSensitive),\n tf.caseSensitive)) {\n addClass(li, this.disabledItemCssClass);\n li.check.disabled = true;\n li.disabled = true;\n } else {\n addEvt(li.check, 'click', evt => this.optionClick(evt));\n }\n ul.appendChild(li);\n\n if (val === '') {\n //item is hidden\n li.style.display = NONE;\n }\n }\n }\n\n /**\n * Add checklist header option\n * @param {Number} colIndex Column index\n * @param {Object} ul Ul element\n * @private\n */\n addTChecks(colIndex, ul) {\n let tf = this.tf;\n let chkCt = 1;\n let fltId = tf.fltIds[colIndex];\n let li0 = createCheckItem(`${fltId}_0`, '',\n tf.getClearFilterText(colIndex), ['data-idx', 0]);\n li0.className = this.itemCssClass;\n ul.appendChild(li0);\n\n addEvt(li0.check, 'click', evt => this.optionClick(evt));\n\n if (!this.enableResetOption) {\n li0.style.display = NONE;\n }\n\n if (tf.enableEmptyOption) {\n let li1 = createCheckItem(`${fltId}_1`, tf.emOperator,\n tf.emptyText, ['data-idx', 1]);\n li1.className = this.itemCssClass;\n ul.appendChild(li1);\n addEvt(li1.check, 'click', evt => this.optionClick(evt));\n chkCt++;\n }\n\n if (tf.enableNonEmptyOption) {\n let li2 = createCheckItem(`${fltId}_2`, tf.nmOperator,\n tf.nonEmptyText, ['data-idx', 2]);\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 * Set/unset value of passed item option in filter's DOM element attribute\n * @param {Object} o checklist option DOM element\n * @private\n */\n setItemOption(o) {\n if (!o) {\n return;\n }\n\n let tf = this.tf;\n let chkValue = o.value; //checked item value\n let chkIndex = o.dataset.idx;\n let colIdx = tf.getColumnIndexFromFilterId(o.id);\n let n = tf.getFilterElement(parseInt(colIdx, 10));\n let items = n.childNodes;\n let li = items[chkIndex];\n //selected values (ul tag)\n let slcValues = n.getAttribute('value') || '';\n //selected items indexes (ul tag)\n let slcIndexes = n.getAttribute('indexes') || '';\n\n if (o.checked) {\n //show all item\n if (chkValue === '') {\n //items indexes\n let indexes = slcIndexes.split(tf.separator);\n indexes.forEach(idx => {\n idx = Number(idx);\n let li = items[idx];\n let chx = tag(li, 'input')[0];\n if (chx && idx > 0) {\n chx.checked = false;\n removeClass(li, this.selectedItemCssClass);\n }\n });\n\n n.setAttribute('value', '');\n n.setAttribute('indexes', '');\n\n } else {\n let indexes = slcIndexes + chkIndex + tf.separator;\n let values =\n trim(slcValues + ' ' + chkValue + ' ' + tf.orOperator);\n\n n.setAttribute('value', values);\n n.setAttribute('indexes', indexes);\n\n //uncheck first option\n let chx0 = tag(items[0], 'input')[0];\n if (chx0) {\n chx0.checked = false;\n }\n }\n\n removeClass(items[0], this.selectedItemCssClass);\n addClass(li, this.selectedItemCssClass);\n } else { //removes values and indexes\n let replaceValue =\n new RegExp(rgxEsc(chkValue + ' ' + tf.orOperator));\n let values = slcValues.replace(replaceValue, '');\n let replaceIndex = new RegExp(rgxEsc(chkIndex + tf.separator));\n let indexes = slcIndexes.replace(replaceIndex, '');\n\n n.setAttribute('value', trim(values));\n n.setAttribute('indexes', indexes);\n\n removeClass(li, this.selectedItemCssClass);\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 (!flt || values.length === 0) {\n return;\n }\n\n let lis = tag(flt, 'li');\n\n flt.setAttribute('value', '');\n flt.setAttribute('indexes', '');\n\n [].forEach.call(lis, (li) => {\n let chk = tag(li, 'input')[0];\n let chkVal = matchCase(chk.value, tf.caseSensitive);\n\n if (chkVal !== '' && has(values, chkVal, tf.caseSensitive)) {\n chk.checked = true;\n } else {\n // Check non-empty-text or empty-text option\n if (values.indexOf(tf.nmOperator) !== -1 &&\n chkVal === matchCase(tf.nonEmptyText, tf.caseSensitive)) {\n chk.checked = true;\n }\n else if (values.indexOf(tf.emOperator) !== -1 &&\n chkVal === matchCase(tf.emptyText, tf.caseSensitive)) {\n chk.checked = true;\n } else {\n chk.checked = false;\n }\n }\n this.setItemOption(chk);\n });\n }\n\n /**\n * Get filter values for a given column index\n * @param {Number} colIndex Column index\n * @returns {Array} values Collection of selected values\n */\n getValues(colIndex) {\n let tf = this.tf;\n let flt = tf.getFilterElement(colIndex);\n let fltAttr = flt.getAttribute('value');\n let values = isEmpty(fltAttr) ? '' : fltAttr;\n //removes last operator ||\n values = values.substr(0, values.length - 3);\n //turn || separated values into array\n values = values.split(' ' + tf.orOperator + ' ');\n\n return values;\n }\n\n /**\n * Destroy CheckList instance\n */\n destroy() {\n this.emitter.off(\n ['build-checklist-filter'],\n (tf, colIndex, isLinked) => this.build(colIndex, isLinked)\n );\n this.emitter.off(\n ['select-checklist-options'],\n (tf, colIndex, values) => this.selectOptions(colIndex, values)\n );\n this.emitter.off(['rows-changed'], () => this.refreshAll());\n\n this.initialized = false;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/modules/checkList.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 354,
"kind": "class",
"name": "CheckList",
"memberof": "src/modules/checkList.js",
"static": true,
"longname": "src/modules/checkList.js~CheckList",
"access": "public",
"export": true,
"importPath": "tablefilter/src/modules/checkList.js",
"importStyle": "{CheckList}",
"description": "Checklist filter UI component",
"lineNumber": 18,
"unknown": [
{
"tagName": "@class",
"tagValue": "CheckList"
}
],
"interface": false,
"extends": [
"BaseDropdown"
]
},
{
"__docId__": 355,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#constructor",
"access": "public",
"description": "Creates an instance of CheckList",
"lineNumber": 24,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
]
},
{
"__docId__": 356,
"kind": "member",
"name": "containers",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#containers",
"access": "public",
"description": "List of container DOM elements",
"lineNumber": 33,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 357,
"kind": "member",
"name": "containerCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#containerCssClass",
"access": "public",
"description": "Css class for the container of the checklist filter (div)",
"lineNumber": 39,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 358,
"kind": "member",
"name": "filterCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#filterCssClass",
"access": "public",
"description": "Css class for the checklist filter element (ul)",
"lineNumber": 46,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 359,
"kind": "member",
"name": "itemCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#itemCssClass",
"access": "public",
"description": "Css class for the item of a checklist (li)",
"lineNumber": 53,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 360,
"kind": "member",
"name": "selectedItemCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#selectedItemCssClass",
"access": "public",
"description": "Css class for a selected item of a checklist (li)",
"lineNumber": 60,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 361,
"kind": "member",
"name": "activateText",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#activateText",
"access": "public",
"description": "Text placed in the filter's container when load filter on demand\nfeature is enabled",
"lineNumber": 70,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 362,
"kind": "member",
"name": "disabledItemCssClass",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#disabledItemCssClass",
"access": "public",
"description": "Css class for a disabled item of a checklist (li)",
"lineNumber": 79,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 363,
"kind": "member",
"name": "enableResetOption",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#enableResetOption",
"access": "public",
"description": "Enable the reset filter option as first item",
"lineNumber": 88,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 364,
"kind": "member",
"name": "prfx",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#prfx",
"access": "private",
"description": "Prefix for container element ID",
"lineNumber": 96,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 365,
"kind": "method",
"name": "optionClick",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#optionClick",
"access": "private",
"description": "Checklist option click event handler",
"lineNumber": 104,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": ""
}
],
"ignore": true,
"return": null
},
{
"__docId__": 366,
"kind": "method",
"name": "onCheckListClick",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#onCheckListClick",
"access": "private",
"description": "Checklist container click event handler for load-on-demand feature",
"lineNumber": 118,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "evt",
"description": ""
}
],
"ignore": true,
"return": null
},
{
"__docId__": 367,
"kind": "method",
"name": "refreshAll",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#refreshAll",
"access": "public",
"description": "Refresh all checklist filters",
"lineNumber": 131,
"params": [],
"return": null
},
{
"__docId__": 368,
"kind": "method",
"name": "init",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#init",
"access": "public",
"description": "Initialize checklist filter",
"lineNumber": 142,
"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"
}
],
"return": null
},
{
"__docId__": 369,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#initialized",
"access": "public",
"description": null,
"lineNumber": 182,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 370,
"kind": "method",
"name": "build",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#build",
"access": "public",
"description": "Build checklist UI",
"lineNumber": 190,
"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 filters behaviour"
}
],
"return": null
},
{
"__docId__": 371,
"kind": "member",
"name": "opts",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#opts",
"access": "public",
"description": null,
"lineNumber": 197,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"*[]"
]
}
},
{
"__docId__": 372,
"kind": "member",
"name": "optsTxt",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#optsTxt",
"access": "public",
"description": null,
"lineNumber": 199,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"*[]"
]
}
},
{
"__docId__": 373,
"kind": "member",
"name": "isCustom",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#isCustom",
"access": "public",
"description": null,
"lineNumber": 209,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 376,
"kind": "member",
"name": "excludedOpts",
"memberof": "src/modules/checkList.js~CheckList",
"static": false,
"longname": "src/modules/checkList.js~CheckList#excludedOpts",
"access": "public",
"description": null,
"lineNumber": 228,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"*[]"
]
}
},
{
"__docId__": 379,
"kind": "method",
"name": "addChecks",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#addChecks",
"access": "private",
"description": "Add checklist options",
"lineNumber": 295,
"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"
}
],
"ignore": true,
"return": null
},
{
"__docId__": 380,
"kind": "method",
"name": "addTChecks",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#addTChecks",
"access": "private",
"description": "Add checklist header option",
"lineNumber": 332,
"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"
}
],
"ignore": true,
"return": {
"types": [
"*"
]
}
},
{
"__docId__": 381,
"kind": "method",
"name": "setItemOption",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#setItemOption",
"access": "private",
"description": "Set/unset value of passed item option in filter's DOM element attribute",
"lineNumber": 372,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "o",
"description": "checklist option DOM element"
}
],
"ignore": true,
"return": null
},
{
"__docId__": 382,
"kind": "method",
"name": "selectOptions",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#selectOptions",
"access": "public",
"description": "Select filter options programmatically",
"lineNumber": 443,
"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"
}
],
"return": null
},
{
"__docId__": 383,
"kind": "method",
"name": "getValues",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#getValues",
"access": "public",
"description": "Get filter values for a given column index",
"lineNumber": 483,
"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"
}
},
{
"__docId__": 384,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/checkList.js~CheckList",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/checkList.js~CheckList#destroy",
"access": "public",
"description": "Destroy CheckList instance",
"lineNumber": 499,
"params": [],
"return": null
},
{
"__docId__": 386,
"kind": "file",
"name": "src/modules/clearButton.js",
"content": "import {Feature} from '../feature';\nimport {createElm, createText, elm, removeElm} from '../dom';\nimport {addEvt} from '../event';\nimport {defaultsStr} from '../settings';\nimport {isNull} from '../types';\nimport {RIGHT} from './toolbar';\n\n/**\n * Clear button UI component\n */\nexport class ClearButton extends Feature {\n\n /**\n * Creates an instance of ClearButton\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'btnReset');\n\n let f = this.config.btn_reset || {};\n\n /**\n * Container element ID\n * @type {String}\n */\n this.targetId = defaultsStr(f.target_id, null);\n\n /**\n * Text for the clear button\n * @type {String}\n */\n this.text = defaultsStr(f.text, null);\n\n /**\n * Css class for reset button\n * @type {String}\n */\n this.cssClass = defaultsStr(f.css_class, 'reset');\n\n /**\n * Tooltip text for the clear button\n * @type {String}\n */\n this.tooltip = f.tooltip || 'Clear filters';\n\n /**\n * Custom Html string for the clear button\n * @type {String}\n */\n this.html = defaultsStr(f.html,\n (!tf.enableIcons || this.text ? null :\n ''));\n\n /**\n * Default position in toolbar ('left'|'center'|'right')\n * @type {String}\n */\n this.toolbarPosition = defaultsStr(f.toolbar_position, RIGHT);\n\n /**\n * Clear button container element\n * @type {DOMElement}\n * @private\n */\n this.container = null;\n\n /**\n * Clear button element\n * @type {DOMElement}\n * @private\n */\n this.element = null;\n }\n\n /**\n * Click event handler for clear button\n * @private\n */\n onClick() {\n if (!this.isEnabled()) {\n return;\n }\n this.tf.clearFilters();\n }\n\n /**\n * Initialize clear button component\n */\n init() {\n let tf = this.tf;\n\n if (this.initialized) {\n return;\n }\n\n this.emitter.emit('initializing-feature', this, !isNull(this.targetId));\n\n let cont = createElm('span');\n\n let targetEl = !this.targetId ?\n tf.feature('toolbar').container(this.toolbarPosition) :\n elm(this.targetId);\n targetEl.appendChild(cont);\n\n if (!this.html) {\n let fltReset = createElm('a', ['href', 'javascript:void(0);']);\n fltReset.className = this.cssClass;\n fltReset.appendChild(createText(this.text));\n cont.appendChild(fltReset);\n addEvt(fltReset, 'click', () => this.onClick());\n } else {\n cont.innerHTML = this.html;\n let resetEl = cont.firstChild;\n addEvt(resetEl, 'click', () => this.onClick());\n }\n this.element = cont.firstChild;\n this.container = cont;\n\n /** @inherited */\n this.initialized = true;\n\n this.emitter.emit('feature-initialized', this);\n }\n\n /**\n * Destroy ClearButton instance\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n removeElm(this.element);\n removeElm(this.container);\n this.element = null;\n this.container = null;\n this.initialized = false;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/modules/clearButton.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 387,
"kind": "class",
"name": "ClearButton",
"memberof": "src/modules/clearButton.js",
"static": true,
"longname": "src/modules/clearButton.js~ClearButton",
"access": "public",
"export": true,
"importPath": "tablefilter/src/modules/clearButton.js",
"importStyle": "{ClearButton}",
"description": "Clear button UI component",
"lineNumber": 11,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 388,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/clearButton.js~ClearButton",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#constructor",
"access": "public",
"description": "Creates an instance of ClearButton",
"lineNumber": 17,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
]
},
{
"__docId__": 389,
"kind": "member",
"name": "targetId",
"memberof": "src/modules/clearButton.js~ClearButton",
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#targetId",
"access": "public",
"description": "Container element ID",
"lineNumber": 26,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 390,
"kind": "member",
"name": "text",
"memberof": "src/modules/clearButton.js~ClearButton",
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#text",
"access": "public",
"description": "Text for the clear button",
"lineNumber": 32,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 391,
"kind": "member",
"name": "cssClass",
"memberof": "src/modules/clearButton.js~ClearButton",
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#cssClass",
"access": "public",
"description": "Css class for reset button",
"lineNumber": 38,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 392,
"kind": "member",
"name": "tooltip",
"memberof": "src/modules/clearButton.js~ClearButton",
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#tooltip",
"access": "public",
"description": "Tooltip text for the clear button",
"lineNumber": 44,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 393,
"kind": "member",
"name": "html",
"memberof": "src/modules/clearButton.js~ClearButton",
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#html",
"access": "public",
"description": "Custom Html string for the clear button",
"lineNumber": 50,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 394,
"kind": "member",
"name": "toolbarPosition",
"memberof": "src/modules/clearButton.js~ClearButton",
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#toolbarPosition",
"access": "public",
"description": "Default position in toolbar ('left'|'center'|'right')",
"lineNumber": 59,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 395,
"kind": "member",
"name": "container",
"memberof": "src/modules/clearButton.js~ClearButton",
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#container",
"access": "private",
"description": "Clear button container element",
"lineNumber": 66,
"type": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 396,
"kind": "member",
"name": "element",
"memberof": "src/modules/clearButton.js~ClearButton",
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#element",
"access": "private",
"description": "Clear button element",
"lineNumber": 73,
"type": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 397,
"kind": "method",
"name": "onClick",
"memberof": "src/modules/clearButton.js~ClearButton",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#onClick",
"access": "private",
"description": "Click event handler for clear button",
"lineNumber": 80,
"ignore": true,
"params": [],
"return": null
},
{
"__docId__": 398,
"kind": "method",
"name": "init",
"memberof": "src/modules/clearButton.js~ClearButton",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#init",
"access": "public",
"description": "Initialize clear button component",
"lineNumber": 90,
"params": [],
"return": null
},
{
"__docId__": 401,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/clearButton.js~ClearButton",
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#initialized",
"access": "public",
"description": null,
"lineNumber": 121,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 402,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/clearButton.js~ClearButton",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/clearButton.js~ClearButton#destroy",
"access": "public",
"description": "Destroy ClearButton instance",
"lineNumber": 129,
"params": [],
"return": null
},
{
"__docId__": 406,
"kind": "file",
"name": "src/modules/dateType.js",
"content": "import {Date as SugarDate} from 'sugar-date';\nimport 'sugar-date/locales';\nimport {Feature} from '../feature';\nimport {isObj, isArray} from '../types';\nimport {DATE} from '../const';\nimport {root} from '../root';\n\n/**\n * Wrapper for Sugar Date module providing datetime helpers and locales\n * @export\n * @class DateType\n */\nexport class DateType extends Feature {\n\n /**\n * Creates an instance of DateType\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'dateType');\n\n /**\n * Global locale\n * @type {String}\n */\n this.locale = tf.locale;\n\n /**\n * Sugar Date instance\n * @type {Object}\n */\n this.datetime = SugarDate;\n\n this.enable();\n }\n\n /**\n * Initialize DateType instance\n */\n init() {\n if (this.initialized) {\n return;\n }\n\n // Set global locale\n this.datetime.setLocale(this.locale);\n\n // Add formats from column types configuration if any\n this.addConfigFormats(this.tf.colTypes);\n\n this.emitter.on(\n ['add-date-type-formats'],\n (tf, types) => this.addConfigFormats(types)\n );\n\n // Broadcast date-type initialization\n this.emitter.emit('date-type-initialized', this.tf, this);\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Parse a string representation of a date for a specified locale and return\n * a date object\n * @param {String} dateStr String representation of a date\n * @param {String} localeCode Locale code (ie 'en-us')\n * @returns {Date}\n */\n parse(dateStr, localeCode) {\n return this.datetime.create(dateStr, localeCode);\n }\n\n /**\n * Check string representation of a date for a specified locale is valid\n * @param {any} dateStr String representation of a date\n * @param {any} localeCode Locale code (ie 'en-us')\n * @returns {Boolean}\n */\n isValid(dateStr, localeCode) {\n return this.datetime.isValid(this.parse(dateStr, localeCode));\n }\n\n /**\n * Return the type object of a specified column as per configuration or\n * passed collection\n * @param {Number} colIndex Column index\n * @param {Array} types Collection of column types, optional\n * @returns {Object}\n */\n getOptions(colIndex, types) {\n types = types || this.tf.colTypes;\n let colType = types[colIndex];\n return isObj(colType) ? colType : {};\n }\n\n /**\n * Return the locale code for supplied column index as per configuration\n * or global setting\n * @param {Number} colIndex Column index\n * @returns {String} Locale code (ie: 'en-us')\n */\n getLocale(colIndex) {\n return this.getOptions(colIndex).locale || this.locale;\n }\n\n /**\n * Add date time format(s) to a locale as specified by the passed\n * collection of column types, ie:\n * [\n * 'string',\n * 'number',\n * { type: 'date', locale: 'en', format: ['{dd}/{MM}/{yyyy}']}\n * ]\n *\n * @param {Array} [types=[]] Collection of column types\n */\n addConfigFormats(types=[]) {\n types.forEach((type, idx) => {\n let options = this.getOptions(idx, types);\n if (options.type === DATE && options.hasOwnProperty('format')) {\n let locale = this.datetime.getLocale(\n options.locale || this.locale\n );\n let formats = isArray(options.format) ?\n options.format : [options.format];\n\n // Sugar date module throws exceptions with locale.addFormat\n try {\n formats.forEach((format) => {\n locale.addFormat(format);\n });\n } catch (ex) {\n root.console.error(ex);\n }\n }\n });\n }\n\n /**\n * Remove DateType instance\n */\n destroy() {\n if (!this.initialized) {\n return;\n }\n\n // TODO: remove added formats\n\n this.emitter.off(\n ['add-date-type-formats'],\n (tf, types) => this.addConfigFormats(types)\n );\n\n this.initialized = false;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/modules/dateType.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 407,
"kind": "class",
"name": "DateType",
"memberof": "src/modules/dateType.js",
"static": true,
"longname": "src/modules/dateType.js~DateType",
"access": "public",
"export": true,
"importPath": "tablefilter/src/modules/dateType.js",
"importStyle": "{DateType}",
"description": "Wrapper for Sugar Date module providing datetime helpers and locales",
"lineNumber": 13,
"unknown": [
{
"tagName": "@class",
"tagValue": "DateType"
}
],
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 408,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/dateType.js~DateType",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dateType.js~DateType#constructor",
"access": "public",
"description": "Creates an instance of DateType",
"lineNumber": 19,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
]
},
{
"__docId__": 409,
"kind": "member",
"name": "locale",
"memberof": "src/modules/dateType.js~DateType",
"static": false,
"longname": "src/modules/dateType.js~DateType#locale",
"access": "public",
"description": "Global locale",
"lineNumber": 26,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 410,
"kind": "member",
"name": "datetime",
"memberof": "src/modules/dateType.js~DateType",
"static": false,
"longname": "src/modules/dateType.js~DateType#datetime",
"access": "public",
"description": "Sugar Date instance",
"lineNumber": 32,
"type": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": null
}
},
{
"__docId__": 411,
"kind": "method",
"name": "init",
"memberof": "src/modules/dateType.js~DateType",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dateType.js~DateType#init",
"access": "public",
"description": "Initialize DateType instance",
"lineNumber": 40,
"params": [],
"return": null
},
{
"__docId__": 412,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/dateType.js~DateType",
"static": false,
"longname": "src/modules/dateType.js~DateType#initialized",
"access": "public",
"description": null,
"lineNumber": 60,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 413,
"kind": "method",
"name": "parse",
"memberof": "src/modules/dateType.js~DateType",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dateType.js~DateType#parse",
"access": "public",
"description": "Parse a string representation of a date for a specified locale and return\na date object",
"lineNumber": 70,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Date}"
}
],
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "dateStr",
"description": "String representation of a date"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "localeCode",
"description": "Locale code (ie 'en-us')"
}
],
"return": {
"nullable": null,
"types": [
"Date"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 414,
"kind": "method",
"name": "isValid",
"memberof": "src/modules/dateType.js~DateType",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dateType.js~DateType#isValid",
"access": "public",
"description": "Check string representation of a date for a specified locale is valid",
"lineNumber": 80,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Boolean}"
}
],
"params": [
{
"nullable": null,
"types": [
"any"
],
"spread": false,
"optional": false,
"name": "dateStr",
"description": "String representation of a date"
},
{
"nullable": null,
"types": [
"any"
],
"spread": false,
"optional": false,
"name": "localeCode",
"description": "Locale code (ie 'en-us')"
}
],
"return": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 415,
"kind": "method",
"name": "getOptions",
"memberof": "src/modules/dateType.js~DateType",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dateType.js~DateType#getOptions",
"access": "public",
"description": "Return the type object of a specified column as per configuration or\npassed collection",
"lineNumber": 91,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Object}"
}
],
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
},
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": false,
"name": "types",
"description": "Collection of column types, optional"
}
],
"return": {
"nullable": null,
"types": [
"Object"
],
"spread": false,
"description": ""
}
},
{
"__docId__": 416,
"kind": "method",
"name": "getLocale",
"memberof": "src/modules/dateType.js~DateType",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dateType.js~DateType#getLocale",
"access": "public",
"description": "Return the locale code for supplied column index as per configuration\nor global setting",
"lineNumber": 103,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{String} Locale code (ie: 'en-us')"
}
],
"params": [
{
"nullable": null,
"types": [
"Number"
],
"spread": false,
"optional": false,
"name": "colIndex",
"description": "Column index"
}
],
"return": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": "Locale code (ie: 'en-us')"
}
},
{
"__docId__": 417,
"kind": "method",
"name": "addConfigFormats",
"memberof": "src/modules/dateType.js~DateType",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dateType.js~DateType#addConfigFormats",
"access": "public",
"description": "Add date time format(s) to a locale as specified by the passed\ncollection of column types, ie:\n [\n 'string',\n 'number',\n { type: 'date', locale: 'en', format: ['{dd}/{MM}/{yyyy}']}\n]",
"lineNumber": 118,
"params": [
{
"nullable": null,
"types": [
"Array"
],
"spread": false,
"optional": true,
"defaultValue": "[]",
"defaultRaw": [],
"name": "types",
"description": "Collection of column types"
}
],
"return": null
},
{
"__docId__": 418,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/dateType.js~DateType",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dateType.js~DateType#destroy",
"access": "public",
"description": "Remove DateType instance",
"lineNumber": 143,
"params": [],
"return": null
},
{
"__docId__": 420,
"kind": "file",
"name": "src/modules/dropdown.js",
"content": "import {BaseDropdown} from './baseDropdown';\nimport {createElm, createOpt, elm} from '../dom';\nimport {has} from '../array';\nimport {matchCase} from '../string';\nimport {addEvt, targetEvt} from '../event';\nimport {SELECT, MULTIPLE, NONE} from '../const';\nimport {defaultsStr, defaultsBool} from '../settings';\n\n/**\n * Dropdown filter UI component\n * @export\n * @class Dropdown\n * @extends {BaseDropdown}\n */\nexport class Dropdown extends BaseDropdown {\n\n /**\n * Creates an instance of Dropdown\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'dropdown');\n\n // Configuration object\n let f = this.config;\n\n /**\n * Enable the reset filter option as first item\n * @type {Boolean}\n */\n this.enableSlcResetFilter =\n defaultsBool(f.enable_slc_reset_filter, true);\n\n /**\n * Non empty option text\n * @type {String}\n */\n this.nonEmptyText = defaultsStr(f.non_empty_text, '(Non empty)');\n\n /**\n * Tooltip text appearing on multiple select\n * @type {String}\n */\n this.multipleSlcTooltip = defaultsStr(f.multiple_slc_tooltip,\n 'Use Ctrl/Cmd key for multiple selections');\n }\n\n\n /**\n * Drop-down filter focus event handler\n * @param {Event} e DOM Event\n * @private\n */\n onSlcFocus(e) {\n let elm = targetEvt(e);\n let tf = this.tf;\n // select is populated when element has focus\n if (tf.loadFltOnDemand && elm.getAttribute('filled') === '0') {\n let ct = elm.getAttribute('ct');\n this.build(ct);\n }\n this.emitter.emit('filter-focus', tf, elm);\n }\n\n /**\n * Drop-down filter change event handler\n * @private\n */\n onSlcChange() {\n if (this.tf.onSlcChange) {\n this.tf.filter();\n }\n }\n\n /**\n * Refresh all drop-down filters\n */\n refreshAll() {\n let selectFlts = this.tf.getFiltersByType(SELECT, true);\n let multipleFlts = this.tf.getFiltersByType(MULTIPLE, true);\n let colIdxs = selectFlts.concat(multipleFlts);\n this.refreshFilters(colIdxs);\n }\n\n /**\n * Initialize drop-down filter\n * @param {Number} colIndex Column index\n * @param {Boolean} isExternal External filter flag\n * @param {DOMElement} container Dom element containing the filter\n */\n init(colIndex, isExternal, container) {\n let tf = this.tf;\n let col = tf.getFilterType(colIndex);\n let externalFltTgtId = isExternal ?\n tf.externalFltIds[colIndex] : null;\n\n let slc = createElm(SELECT,\n ['id', tf.buildFilterId(colIndex)],\n ['ct', colIndex], ['filled', '0']\n );\n\n if (col === MULTIPLE) {\n slc.multiple = MULTIPLE;\n slc.title = this.multipleSlcTooltip;\n }\n slc.className = col.toLowerCase() === SELECT ?\n tf.fltCssClass : tf.fltMultiCssClass;\n\n //filter is appended in container element\n if (externalFltTgtId) {\n elm(externalFltTgtId).appendChild(slc);\n } else {\n container.appendChild(slc);\n }\n\n tf.fltIds.push(slc.id);\n\n if (!tf.loadFltOnDemand) {\n this.build(colIndex);\n } else {\n //1st option is created here since build isn't invoked\n let opt0 = createOpt(tf.getClearFilterText(colIndex), '');\n slc.appendChild(opt0);\n }\n\n addEvt(slc, 'change', () => this.onSlcChange());\n addEvt(slc, 'focus', (e) => this.onSlcFocus(e));\n\n this.emitter.on(\n ['build-select-filter'],\n (tf, colIndex, isLinked, isExternal) =>\n this.build(colIndex, isLinked, isExternal)\n );\n this.emitter.on(\n ['select-options'],\n (tf, colIndex, values) => this.selectOptions(colIndex, values)\n );\n this.emitter.on(['rows-changed'], () => this.refreshAll());\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Build drop-down filter UI\n * @param {Number} colIndex Column index\n * @param {Boolean} isLinked Enable linked filters behaviour\n */\n build(colIndex, isLinked = false) {\n let tf = this.tf;\n colIndex = Number(colIndex);\n\n this.emitter.emit('before-populating-filter', tf, colIndex);\n\n /** @inherited */\n this.opts = [];\n /** @inherited */\n this.optsTxt = [];\n\n let slc = tf.getFilterElement(colIndex);\n\n //custom select test\n /** @inherited */\n this.isCustom = tf.isCustomOptions(colIndex);\n\n //Retrieves custom values\n if (this.isCustom) {\n let customValues = tf.getCustomOptions(colIndex);\n this.opts = customValues[0];\n this.optsTxt = customValues[1];\n }\n\n //custom selects text\n let activeIdx;\n let activeFilterId = tf.getActiveFilterId();\n if (isLinked && activeFilterId) {\n activeIdx = tf.getColumnIndexFromFilterId(activeFilterId);\n }\n\n let excludedOpts = null,\n filteredDataCol = null;\n if (isLinked && tf.disableExcludedOptions) {\n excludedOpts = [];\n filteredDataCol = [];\n }\n\n let eachRow = tf.eachRow();\n eachRow(\n (row) => {\n let cellValue = tf.getCellValue(row.cells[colIndex]);\n //Vary Peter's patch\n let cellString = matchCase(cellValue, tf.caseSensitive);\n\n // checks if celldata is already in array\n if (!has(this.opts, cellString, tf.caseSensitive)) {\n this.opts.push(cellValue);\n }\n\n if (isLinked && tf.disableExcludedOptions) {\n let filteredCol = filteredDataCol[colIndex];\n if (!filteredCol) {\n filteredCol = tf.getVisibleColumnValues(colIndex);\n }\n if (!has(filteredCol, cellString, tf.caseSensitive) &&\n !has(excludedOpts, cellString, tf.caseSensitive)) {\n excludedOpts.push(cellValue);\n }\n }\n },\n // continue conditions function\n (row, k) => {\n // excluded rows don't need to appear on selects as always valid\n if (tf.excludeRows.indexOf(k) !== -1) {\n return true;\n }\n\n // checks if row has expected number of cells\n if (row.cells.length !== tf.nbCells || this.isCustom) {\n return true;\n }\n\n if (isLinked && !this.isValidLinkedValue(k, activeIdx)) {\n return true;\n }\n }\n );\n\n //sort options\n this.opts = this.sortOptions(colIndex, this.opts);\n if (excludedOpts) {\n excludedOpts = this.sortOptions(colIndex, excludedOpts);\n }\n\n //populates drop-down\n this.addOptions(colIndex, slc, isLinked, excludedOpts);\n\n this.emitter.emit('after-populating-filter', tf, colIndex, slc);\n }\n\n /**\n * Add drop-down options\n * @param {Number} colIndex Column index\n * @param {Object} slc Select Dom element\n * @param {Boolean} isLinked Enable linked refresh behaviour\n * @param {Array} excludedOpts Array of excluded options\n */\n addOptions(colIndex, slc, isLinked, excludedOpts) {\n let tf = this.tf,\n slcValue = slc.value;\n\n slc.innerHTML = '';\n slc = this.addFirstOption(slc);\n\n for (let y = 0; y < this.opts.length; y++) {\n if (this.opts[y] === '') {\n continue;\n }\n let val = this.opts[y]; //option value\n let lbl = this.isCustom ? this.optsTxt[y] : val; //option text\n let isDisabled = false;\n if (isLinked && tf.disableExcludedOptions &&\n has(excludedOpts, matchCase(val, tf.caseSensitive),\n tf.caseSensitive)) {\n isDisabled = true;\n }\n\n let opt;\n //fill select on demand\n if (tf.loadFltOnDemand && slcValue === this.opts[y] &&\n tf.getFilterType(colIndex) === SELECT) {\n opt = createOpt(lbl, val, true);\n } else {\n opt = createOpt(lbl, val, false);\n }\n if (isDisabled) {\n opt.disabled = true;\n }\n slc.appendChild(opt);\n }// for y\n\n slc.setAttribute('filled', '1');\n }\n\n /**\n * Add drop-down header option\n * @param {Object} slc Select DOM element\n */\n addFirstOption(slc) {\n let tf = this.tf;\n let colIdx = tf.getColumnIndexFromFilterId(slc.id);\n let opt0 = createOpt((!this.enableSlcResetFilter ?\n '' : tf.getClearFilterText(colIdx)), '');\n if (!this.enableSlcResetFilter) {\n opt0.style.display = NONE;\n }\n slc.appendChild(opt0);\n if (tf.enableEmptyOption) {\n let opt1 = createOpt(tf.emptyText, tf.emOperator);\n slc.appendChild(opt1);\n }\n if (tf.enableNonEmptyOption) {\n let opt2 = createOpt(tf.nonEmptyText, tf.nmOperator);\n slc.appendChild(opt2);\n }\n return slc;\n }\n\n /**\n * Select filter options programmatically\n * @param {Number} colIndex Column index\n * @param {Array} values Array of option values to select\n */\n selectOptions(colIndex, values = []) {\n let tf = this.tf;\n if (values.length === 0) {\n return;\n }\n let slc = tf.getFilterElement(colIndex);\n [].forEach.call(slc.options, (option) => {\n // Empty value means clear all selections and first option is the\n // clear all option\n if (values[0] === '' || option.value === '') {\n option.selected = false;\n }\n\n if (option.value !== '' && has(values, option.value, true)) {\n option.selected = true;\n }//if\n });\n }\n\n /**\n * Get filter values for a given column index\n * @param {Number} colIndex Column index\n * @returns {Array} values Array of selected values\n */\n getValues(colIndex) {\n let tf = this.tf;\n let slc = tf.getFilterElement(colIndex);\n let values = [];\n\n // IE >= 9 does not support the selectedOptions property :(\n if (slc.selectedOptions) {\n [].forEach.call(slc.selectedOptions,\n option => values.push(option.value));\n } else {\n [].forEach.call(slc.options, (option) => {\n if (option.selected) {\n values.push(option.value);\n }\n });\n }\n\n return values;\n }\n\n /**\n * Destroy Dropdown instance\n */\n destroy() {\n this.emitter.off(\n ['build-select-filter'],\n (colIndex, isLinked, isExternal) =>\n this.build(colIndex, isLinked, isExternal)\n );\n this.emitter.off(\n ['select-options'],\n (tf, colIndex, values) => this.selectOptions(colIndex, values)\n );\n this.emitter.off(['rows-changed'], () => this.refreshAll());\n this.initialized = false;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/modules/dropdown.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 421,
"kind": "class",
"name": "Dropdown",
"memberof": "src/modules/dropdown.js",
"static": true,
"longname": "src/modules/dropdown.js~Dropdown",
"access": "public",
"export": true,
"importPath": "tablefilter/src/modules/dropdown.js",
"importStyle": "{Dropdown}",
"description": "Dropdown filter UI component",
"lineNumber": 15,
"unknown": [
{
"tagName": "@class",
"tagValue": "Dropdown"
}
],
"interface": false,
"extends": [
"BaseDropdown"
]
},
{
"__docId__": 422,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#constructor",
"access": "public",
"description": "Creates an instance of Dropdown",
"lineNumber": 21,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
]
},
{
"__docId__": 423,
"kind": "member",
"name": "enableSlcResetFilter",
"memberof": "src/modules/dropdown.js~Dropdown",
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#enableSlcResetFilter",
"access": "public",
"description": "Enable the reset filter option as first item",
"lineNumber": 31,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 424,
"kind": "member",
"name": "nonEmptyText",
"memberof": "src/modules/dropdown.js~Dropdown",
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#nonEmptyText",
"access": "public",
"description": "Non empty option text",
"lineNumber": 38,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 425,
"kind": "member",
"name": "multipleSlcTooltip",
"memberof": "src/modules/dropdown.js~Dropdown",
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#multipleSlcTooltip",
"access": "public",
"description": "Tooltip text appearing on multiple select",
"lineNumber": 44,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 426,
"kind": "method",
"name": "onSlcFocus",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#onSlcFocus",
"access": "private",
"description": "Drop-down filter focus event handler",
"lineNumber": 54,
"params": [
{
"nullable": null,
"types": [
"Event"
],
"spread": false,
"optional": false,
"name": "e",
"description": "DOM Event"
}
],
"ignore": true,
"return": null
},
{
"__docId__": 427,
"kind": "method",
"name": "onSlcChange",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#onSlcChange",
"access": "private",
"description": "Drop-down filter change event handler",
"lineNumber": 69,
"ignore": true,
"params": [],
"return": null
},
{
"__docId__": 428,
"kind": "method",
"name": "refreshAll",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#refreshAll",
"access": "public",
"description": "Refresh all drop-down filters",
"lineNumber": 78,
"params": [],
"return": null
},
{
"__docId__": 429,
"kind": "method",
"name": "init",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#init",
"access": "public",
"description": "Initialize drop-down filter",
"lineNumber": 91,
"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"
}
],
"return": null
},
{
"__docId__": 430,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/dropdown.js~Dropdown",
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#initialized",
"access": "public",
"description": null,
"lineNumber": 141,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 431,
"kind": "method",
"name": "build",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#build",
"access": "public",
"description": "Build drop-down filter UI",
"lineNumber": 149,
"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 filters behaviour"
}
],
"return": null
},
{
"__docId__": 432,
"kind": "member",
"name": "opts",
"memberof": "src/modules/dropdown.js~Dropdown",
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#opts",
"access": "public",
"description": null,
"lineNumber": 156,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"*[]"
]
}
},
{
"__docId__": 433,
"kind": "member",
"name": "optsTxt",
"memberof": "src/modules/dropdown.js~Dropdown",
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#optsTxt",
"access": "public",
"description": null,
"lineNumber": 158,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"*[]"
]
}
},
{
"__docId__": 434,
"kind": "member",
"name": "isCustom",
"memberof": "src/modules/dropdown.js~Dropdown",
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#isCustom",
"access": "public",
"description": null,
"lineNumber": 164,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 438,
"kind": "method",
"name": "addOptions",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#addOptions",
"access": "public",
"description": "Add drop-down options",
"lineNumber": 247,
"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"
}
],
"return": null
},
{
"__docId__": 439,
"kind": "method",
"name": "addFirstOption",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#addFirstOption",
"access": "public",
"description": "Add drop-down header option",
"lineNumber": 288,
"params": [
{
"nullable": null,
"types": [
"Object"
],
"spread": false,
"optional": false,
"name": "slc",
"description": "Select DOM element"
}
],
"return": {
"types": [
"*"
]
}
},
{
"__docId__": 440,
"kind": "method",
"name": "selectOptions",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#selectOptions",
"access": "public",
"description": "Select filter options programmatically",
"lineNumber": 313,
"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"
}
],
"return": null
},
{
"__docId__": 441,
"kind": "method",
"name": "getValues",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#getValues",
"access": "public",
"description": "Get filter values for a given column index",
"lineNumber": 337,
"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"
}
},
{
"__docId__": 442,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/dropdown.js~Dropdown",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/dropdown.js~Dropdown#destroy",
"access": "public",
"description": "Destroy Dropdown instance",
"lineNumber": 360,
"params": [],
"return": null
},
{
"__docId__": 444,
"kind": "file",
"name": "src/modules/gridLayout.js",
"content": "import {Feature} from '../feature';\nimport {createElm, removeElm, elm, tag} from '../dom';\nimport {addEvt, targetEvt} from '../event';\nimport {contains} from '../string';\nimport {NONE} from '../const';\nimport {\n defaultsBool, defaultsStr, defaultsNb, defaultsArr\n} from '../settings';\n\n/**\n * Grid layout, table with fixed headers\n */\nexport class GridLayout extends Feature {\n\n /**\n * Creates an instance of GridLayout\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'gridLayout');\n\n let f = this.config.grid_layout || {};\n\n /**\n * Grid-layout container width as CSS string\n * @type {String}\n */\n this.width = defaultsStr(f.width, null);\n\n /**\n * Grid-layout container height as CSS string\n * @type {String}\n */\n this.height = defaultsStr(f.height, null);\n\n /**\n * Css class for main container element\n * @type {String}\n */\n this.mainContCssClass = defaultsStr(f.cont_css_class, 'grd_Cont');\n\n /**\n * Css class for body table container element\n * @type {String}\n */\n this.contCssClass = defaultsStr(f.tbl_cont_css_class, 'grd_tblCont');\n\n /**\n * Css class for headers table container element\n * @type {String}\n */\n this.headContCssClass = defaultsStr(f.tbl_head_css_class,\n 'grd_headTblCont');\n\n /**\n * Css class for toolbar container element (rows counter, paging etc.)\n * @type {String}\n */\n this.infDivCssClass = defaultsStr(f.inf_grid_css_class, 'grd_inf');\n\n /**\n * Index of the headers row, default: 0\n * @type {Number}\n */\n this.headRowIndex = defaultsNb(f.headers_row_index, 0);\n\n /**\n * Collection of the header row indexes to be moved into headers table\n * @type {Array}\n */\n this.headRows = defaultsArr(f.headers_rows, [0]);\n\n /**\n * Enable or disable column filters generation, default: true\n * @type {Boolean}\n */\n this.filters = defaultsBool(f.filters, true);\n\n /**\n * Enable or disable column headers, default: false\n * @type {Boolean}\n */\n this.noHeaders = Boolean(f.no_headers);\n\n /**\n * Grid-layout default column widht as CSS string\n * @type {String}\n */\n this.defaultColWidth = defaultsStr(f.default_col_width, '100px');\n\n /**\n * List of column elements\n * @type {Array}\n * @private\n */\n this.colElms = [];\n\n /**\n * Prefix for grid-layout filter's cell ID\n * @type {String}\n * @private\n */\n this.prfxGridFltTd = '_td_';\n\n /**\n * Prefix for grid-layout header's cell ID\n * @type {String}\n * @private\n */\n this.prfxGridTh = 'tblHeadTh_';\n\n /**\n * Mark-up of original HTML table\n * @type {String}\n * @private\n */\n this.sourceTblHtml = tf.dom().outerHTML;\n\n /**\n * Indicates if working table has column elements\n * @type {Boolean}\n * @private\n */\n this.tblHasColTag = tag(tf.dom(), 'col').length > 0 ? true : false;\n\n /**\n * Main container element\n * @private\n */\n this.tblMainCont = null;\n\n /**\n * Table container element\n * @private\n */\n this.tblCont = null;\n\n /**\n * Headers' table container element\n * @private\n */\n this.headTblCont = null;\n\n /**\n * Headers' table element\n * @private\n */\n this.headTbl = null;\n\n // filters flag at TF level\n tf.fltGrid = this.filters;\n }\n\n /**\n * Generates a grid with fixed headers\n * TODO: reduce size of init by extracting single purposed methods\n */\n init() {\n let tf = this.tf;\n let tbl = tf.dom();\n\n if (this.initialized) {\n return;\n }\n\n // Override relevant TableFilter properties\n this.setOverrides();\n\n // Assign default column widths\n this.setDefaultColWidths();\n\n //Main container: it will contain all the elements\n this.tblMainCont = this.createContainer(\n 'div', this.mainContCssClass);\n if (this.width) {\n this.tblMainCont.style.width = this.width;\n }\n tbl.parentNode.insertBefore(this.tblMainCont, tbl);\n\n //Table container: div wrapping content table\n this.tblCont = this.createContainer('div', this.contCssClass);\n this.setConfigWidth(this.tblCont);\n if (this.height) {\n this.tblCont.style.height = this.height;\n }\n tbl.parentNode.insertBefore(this.tblCont, tbl);\n let t = removeElm(tbl);\n this.tblCont.appendChild(t);\n\n //In case table width is expressed in %\n if (tbl.style.width === '') {\n let tblW = this.initialTableWidth();\n tbl.style.width = (contains('%', tblW) ?\n tbl.clientWidth : tblW) + 'px';\n }\n\n let d = removeElm(this.tblCont);\n this.tblMainCont.appendChild(d);\n\n //Headers table container: div wrapping headers table\n this.headTblCont = this.createContainer(\n 'div', this.headContCssClass);\n\n //Headers table\n this.headTbl = createElm('table');\n let tH = createElm('tHead');\n\n //1st row should be headers row, ids are added if not set\n //Those ids are used by the sort feature\n let hRow = tbl.rows[this.headRowIndex];\n let sortTriggers = this.getSortTriggerIds(hRow);\n\n //Filters row is created\n let filtersRow = this.createFiltersRow();\n\n //Headers row are moved from content table to headers table\n this.setHeadersRow(tH);\n\n this.headTbl.appendChild(tH);\n if (tf.filtersRowIndex === 0) {\n tH.insertBefore(filtersRow, hRow);\n } else {\n tH.appendChild(filtersRow);\n }\n\n this.headTblCont.appendChild(this.headTbl);\n this.tblCont.parentNode.insertBefore(this.headTblCont, this.tblCont);\n\n //THead needs to be removed in content table for sort feature\n let thead = tag(tbl, 'thead');\n if (thead.length > 0) {\n tbl.removeChild(thead[0]);\n }\n\n // ensure table layout is always set even if already set in css\n // definitions, potentially with custom css class this could be lost\n this.headTbl.style.tableLayout = 'fixed';\n tbl.style.tableLayout = 'fixed';\n\n //content table without headers needs col widths to be reset\n tf.setColWidths(this.headTbl);\n\n //Headers container width\n this.headTbl.style.width = tbl.style.width;\n //\n\n //scroll synchronisation\n addEvt(this.tblCont, 'scroll', (evt) => {\n let elm = targetEvt(evt);\n let scrollLeft = elm.scrollLeft;\n this.headTblCont.scrollLeft = scrollLeft;\n //New pointerX calc taking into account scrollLeft\n // if(!o.isPointerXOverwritten){\n // try{\n // o.Evt.pointerX = function(evt){\n // let e = evt || global.event;\n // let bdScrollLeft = tf_StandardBody().scrollLeft +\n // scrollLeft;\n // return (e.pageX + scrollLeft) ||\n // (e.clientX + bdScrollLeft);\n // };\n // o.isPointerXOverwritten = true;\n // } catch(err) {\n // o.isPointerXOverwritten = false;\n // }\n // }\n });\n\n // TODO: Trigger a custom event handled by sort extension\n let sort = tf.extension('sort');\n if (sort) {\n sort.asyncSort = true;\n sort.triggerIds = sortTriggers;\n }\n\n //Col elements are enough to keep column widths after sorting and\n //filtering\n this.setColumnElements();\n\n if (tf.popupFilters) {\n filtersRow.style.display = NONE;\n }\n\n /** @inherited */\n this.initialized = true;\n }\n\n /**\n * Overrides TableFilter instance properties to adjust to grid layout mode\n * @private\n */\n setOverrides() {\n let tf = this.tf;\n tf.refRow = 0;\n tf.headersRow = 0;\n tf.filtersRowIndex = 1;\n }\n\n /**\n * Set grid-layout default column widths if column widths are not defined\n * @private\n */\n setDefaultColWidths() {\n let tf = this.tf;\n if (tf.colWidths.length > 0) {\n return;\n }\n\n tf.eachCol((k) => {\n let colW;\n let cell = tf.dom().rows[tf.getHeadersRowIndex()].cells[k];\n if (cell.width !== '') {\n colW = cell.width;\n } else if (cell.style.width !== '') {\n colW = parseInt(cell.style.width, 10);\n } else {\n colW = this.defaultColWidth;\n }\n tf.colWidths[k] = colW;\n });\n\n tf.setColWidths();\n }\n\n /**\n * Initial table width\n * @returns {Number}\n * @private\n */\n initialTableWidth() {\n let tbl = this.tf.dom();\n let width; //initial table width\n\n if (tbl.width !== '') {\n width = tbl.width;\n }\n else if (tbl.style.width !== '') {\n width = tbl.style.width;\n } else {\n width = tbl.clientWidth;\n }\n return parseInt(width, 10);\n }\n\n /**\n * Creates container element\n * @param {String} tag Tag name\n * @param {String} className Css class to assign to element\n * @returns {DOMElement}\n * @private\n */\n createContainer(tag, className) {\n let element = createElm(tag);\n element.className = className;\n return element;\n }\n\n /**\n * Creates filters row with cells\n * @returns {HTMLTableRowElement}\n * @private\n */\n createFiltersRow() {\n let tf = this.tf;\n let filtersRow = createElm('tr');\n if (this.filters && tf.fltGrid) {\n tf.externalFltIds = [];\n tf.eachCol((j) => {\n let fltTdId = `${tf.prfxFlt + j + this.prfxGridFltTd + tf.id}`;\n let cl = createElm(tf.fltCellTag, ['id', fltTdId]);\n filtersRow.appendChild(cl);\n tf.externalFltIds[j] = fltTdId;\n });\n }\n return filtersRow;\n }\n\n /**\n * Generates column elements if necessary and assigns their widths\n * @private\n */\n setColumnElements() {\n let tf = this.tf;\n let cols = tag(tf.dom(), 'col');\n this.tblHasColTag = cols.length > 0;\n\n for (let k = (tf.getCellsNb() - 1); k >= 0; k--) {\n let col;\n\n if (!this.tblHasColTag) {\n col = createElm('col');\n tf.dom().insertBefore(col, tf.dom().firstChild);\n } else {\n col = cols[k];\n }\n col.style.width = tf.colWidths[k];\n this.colElms[k] = col;\n }\n this.tblHasColTag = true;\n }\n\n /**\n * Sets headers row in headers table\n * @param {HTMLHeadElement} tableHead Table head element\n * @private\n */\n setHeadersRow(tableHead) {\n if (this.noHeaders) {\n // Handle table with no headers, assuming here headers do not\n // exist\n tableHead.appendChild(createElm('tr'));\n } else {\n // Headers row are moved from content table to headers table\n for (let i = 0; i < this.headRows.length; i++) {\n let row = this.tf.dom().rows[this.headRows[i]];\n tableHead.appendChild(row);\n }\n }\n }\n\n /**\n * Sets width defined in configuration to passed element\n * @param {DOMElement} element DOM element\n * @private\n */\n setConfigWidth(element) {\n if (!this.width) {\n return;\n }\n if (this.width.indexOf('%') !== -1) {\n element.style.width = '100%';\n } else {\n element.style.width = this.width;\n }\n }\n\n /**\n * Returns a list of header IDs used for specifing external sort triggers\n * @param {HTMLTableRowElement} row DOM row element\n * @returns {Array} List of IDs\n * @private\n */\n getSortTriggerIds(row) {\n let tf = this.tf;\n let sortTriggers = [];\n tf.eachCol((n) => {\n let c = row.cells[n];\n let thId = c.getAttribute('id');\n if (!thId || thId === '') {\n thId = `${this.prfxGridTh + n}_${tf.id}`;\n c.setAttribute('id', thId);\n }\n sortTriggers.push(thId);\n });\n return sortTriggers;\n }\n\n /**\n * Removes the grid layout\n */\n destroy() {\n let tf = this.tf;\n let tbl = tf.dom();\n\n if (!this.initialized) {\n return;\n }\n let t = removeElm(tbl);\n this.tblMainCont.parentNode.insertBefore(t, this.tblMainCont);\n removeElm(this.tblMainCont);\n\n this.tblMainCont = null;\n this.headTblCont = null;\n this.headTbl = null;\n this.tblCont = null;\n\n tbl.outerHTML = this.sourceTblHtml;\n //needed to keep reference of table element for future usage\n this.tf.tbl = elm(tf.id);\n\n this.initialized = false;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/modules/gridLayout.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 445,
"kind": "class",
"name": "GridLayout",
"memberof": "src/modules/gridLayout.js",
"static": true,
"longname": "src/modules/gridLayout.js~GridLayout",
"access": "public",
"export": true,
"importPath": "tablefilter/src/modules/gridLayout.js",
"importStyle": "{GridLayout}",
"description": "Grid layout, table with fixed headers",
"lineNumber": 13,
"interface": false,
"extends": [
"src/feature.js~Feature"
]
},
{
"__docId__": 446,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#constructor",
"access": "public",
"description": "Creates an instance of GridLayout",
"lineNumber": 19,
"params": [
{
"nullable": null,
"types": [
"TableFilter"
],
"spread": false,
"optional": false,
"name": "tf",
"description": "TableFilter instance"
}
]
},
{
"__docId__": 447,
"kind": "member",
"name": "width",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#width",
"access": "public",
"description": "Grid-layout container width as CSS string",
"lineNumber": 28,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 448,
"kind": "member",
"name": "height",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#height",
"access": "public",
"description": "Grid-layout container height as CSS string",
"lineNumber": 34,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 449,
"kind": "member",
"name": "mainContCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#mainContCssClass",
"access": "public",
"description": "Css class for main container element",
"lineNumber": 40,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 450,
"kind": "member",
"name": "contCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#contCssClass",
"access": "public",
"description": "Css class for body table container element",
"lineNumber": 46,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 451,
"kind": "member",
"name": "headContCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#headContCssClass",
"access": "public",
"description": "Css class for headers table container element",
"lineNumber": 52,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 452,
"kind": "member",
"name": "infDivCssClass",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#infDivCssClass",
"access": "public",
"description": "Css class for toolbar container element (rows counter, paging etc.)",
"lineNumber": 59,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 453,
"kind": "member",
"name": "headRowIndex",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#headRowIndex",
"access": "public",
"description": "Index of the headers row, default: 0",
"lineNumber": 65,
"type": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": null
}
},
{
"__docId__": 454,
"kind": "member",
"name": "headRows",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#headRows",
"access": "public",
"description": "Collection of the header row indexes to be moved into headers table",
"lineNumber": 71,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
}
},
{
"__docId__": 455,
"kind": "member",
"name": "filters",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#filters",
"access": "public",
"description": "Enable or disable column filters generation, default: true",
"lineNumber": 77,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 456,
"kind": "member",
"name": "noHeaders",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#noHeaders",
"access": "public",
"description": "Enable or disable column headers, default: false",
"lineNumber": 83,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
}
},
{
"__docId__": 457,
"kind": "member",
"name": "defaultColWidth",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#defaultColWidth",
"access": "public",
"description": "Grid-layout default column widht as CSS string",
"lineNumber": 89,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
}
},
{
"__docId__": 458,
"kind": "member",
"name": "colElms",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#colElms",
"access": "private",
"description": "List of column elements",
"lineNumber": 96,
"type": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 459,
"kind": "member",
"name": "prfxGridFltTd",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#prfxGridFltTd",
"access": "private",
"description": "Prefix for grid-layout filter's cell ID",
"lineNumber": 103,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 460,
"kind": "member",
"name": "prfxGridTh",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#prfxGridTh",
"access": "private",
"description": "Prefix for grid-layout header's cell ID",
"lineNumber": 110,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 461,
"kind": "member",
"name": "sourceTblHtml",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#sourceTblHtml",
"access": "private",
"description": "Mark-up of original HTML table",
"lineNumber": 117,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 462,
"kind": "member",
"name": "tblHasColTag",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#tblHasColTag",
"access": "private",
"description": "Indicates if working table has column elements",
"lineNumber": 124,
"type": {
"nullable": null,
"types": [
"Boolean"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 463,
"kind": "member",
"name": "tblMainCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#tblMainCont",
"access": "private",
"description": "Main container element",
"lineNumber": 130,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 464,
"kind": "member",
"name": "tblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#tblCont",
"access": "private",
"description": "Table container element",
"lineNumber": 136,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 465,
"kind": "member",
"name": "headTblCont",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#headTblCont",
"access": "private",
"description": "Headers' table container element",
"lineNumber": 142,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 466,
"kind": "member",
"name": "headTbl",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#headTbl",
"access": "private",
"description": "Headers' table element",
"lineNumber": 148,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 467,
"kind": "method",
"name": "init",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#init",
"access": "public",
"description": "Generates a grid with fixed headers\nTODO: reduce size of init by extracting single purposed methods",
"lineNumber": 158,
"params": [],
"return": null
},
{
"__docId__": 472,
"kind": "member",
"name": "initialized",
"memberof": "src/modules/gridLayout.js~GridLayout",
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#initialized",
"access": "public",
"description": null,
"lineNumber": 285,
"unknown": [
{
"tagName": "@inherited",
"tagValue": ""
}
],
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 473,
"kind": "method",
"name": "setOverrides",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#setOverrides",
"access": "private",
"description": "Overrides TableFilter instance properties to adjust to grid layout mode",
"lineNumber": 292,
"ignore": true,
"params": [],
"return": null
},
{
"__docId__": 474,
"kind": "method",
"name": "setDefaultColWidths",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#setDefaultColWidths",
"access": "private",
"description": "Set grid-layout default column widths if column widths are not defined",
"lineNumber": 303,
"ignore": true,
"params": [],
"return": null
},
{
"__docId__": 475,
"kind": "method",
"name": "initialTableWidth",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#initialTableWidth",
"access": "private",
"description": "Initial table width",
"lineNumber": 330,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Number}"
}
],
"return": {
"nullable": null,
"types": [
"Number"
],
"spread": false,
"description": ""
},
"ignore": true,
"params": []
},
{
"__docId__": 476,
"kind": "method",
"name": "createContainer",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#createContainer",
"access": "private",
"description": "Creates container element",
"lineNumber": 352,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{DOMElement}"
}
],
"params": [
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "tag",
"description": "Tag name"
},
{
"nullable": null,
"types": [
"String"
],
"spread": false,
"optional": false,
"name": "className",
"description": "Css class to assign to element"
}
],
"return": {
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"description": ""
},
"ignore": true
},
{
"__docId__": 477,
"kind": "method",
"name": "createFiltersRow",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#createFiltersRow",
"access": "private",
"description": "Creates filters row with cells",
"lineNumber": 363,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{HTMLTableRowElement}"
}
],
"return": {
"nullable": null,
"types": [
"HTMLTableRowElement"
],
"spread": false,
"description": ""
},
"ignore": true,
"params": []
},
{
"__docId__": 478,
"kind": "method",
"name": "setColumnElements",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#setColumnElements",
"access": "private",
"description": "Generates column elements if necessary and assigns their widths",
"lineNumber": 382,
"ignore": true,
"params": [],
"return": null
},
{
"__docId__": 481,
"kind": "method",
"name": "setHeadersRow",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#setHeadersRow",
"access": "private",
"description": "Sets headers row in headers table",
"lineNumber": 407,
"params": [
{
"nullable": null,
"types": [
"HTMLHeadElement"
],
"spread": false,
"optional": false,
"name": "tableHead",
"description": "Table head element"
}
],
"ignore": true,
"return": null
},
{
"__docId__": 482,
"kind": "method",
"name": "setConfigWidth",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#setConfigWidth",
"access": "private",
"description": "Sets width defined in configuration to passed element",
"lineNumber": 426,
"params": [
{
"nullable": null,
"types": [
"DOMElement"
],
"spread": false,
"optional": false,
"name": "element",
"description": "DOM element"
}
],
"ignore": true,
"return": null
},
{
"__docId__": 483,
"kind": "method",
"name": "getSortTriggerIds",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#getSortTriggerIds",
"access": "private",
"description": "Returns a list of header IDs used for specifing external sort triggers",
"lineNumber": 443,
"unknown": [
{
"tagName": "@returns",
"tagValue": "{Array} List of IDs"
}
],
"params": [
{
"nullable": null,
"types": [
"HTMLTableRowElement"
],
"spread": false,
"optional": false,
"name": "row",
"description": "DOM row element"
}
],
"return": {
"nullable": null,
"types": [
"Array"
],
"spread": false,
"description": "List of IDs"
},
"ignore": true
},
{
"__docId__": 484,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/gridLayout.js~GridLayout",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/gridLayout.js~GridLayout#destroy",
"access": "public",
"description": "Removes the grid layout",
"lineNumber": 461,
"params": [],
"return": null
},
{
"__docId__": 490,
"kind": "file",
"name": "src/modules/hash.js",
"content": "import {addEvt, removeEvt} from '../event';\nimport {root} from '../root';\n\nconst JSON = root.JSON;\nconst location = root.location;\nconst decodeURIComponent = root.decodeURIComponent;\nconst encodeURIComponent = root.encodeURIComponent;\n\n/**\n * Checks if browser has onhashchange event\n */\nexport const hasHashChange = () => {\n let docMode = root.documentMode;\n return ('onhashchange' in root) && (docMode === undefined || docMode > 7);\n};\n\n/**\n * Manages state via URL hash changes\n *\n * @export\n * @class Hash\n */\nexport class Hash {\n\n /**\n * Creates an instance of Hash\n *\n * @param {State} state Instance of State\n */\n constructor(state) {\n /**\n * State object\n * @type {State}\n */\n this.state = state;\n\n /**\n * Cached URL hash\n * @type {String} Hash string\n * @private\n */\n this.lastHash = null;\n\n /**\n * Application event emitter instance\n * @type {Emitter}\n */\n this.emitter = state.emitter;\n\n /**\n * Bound sync wrapper for future use\n * @private\n */\n this.boundSync = null;\n }\n\n /**\n * Initializes the Hash object\n */\n init() {\n if (!hasHashChange()) {\n return;\n }\n\n this.lastHash = location.hash;\n //Store a bound sync wrapper\n this.boundSync = this.sync.bind(this);\n this.emitter.on(['state-changed'], (tf, state) => this.update(state));\n this.emitter.on(['initialized'], this.boundSync);\n addEvt(root, 'hashchange', this.boundSync);\n }\n\n /**\n * Updates the URL hash based on a state change\n *\n * @param {State} state Instance of State\n */\n update(state) {\n let hash = `#${encodeURIComponent(JSON.stringify(state))}`;\n if (this.lastHash === hash) {\n return;\n }\n\n location.hash = hash;\n this.lastHash = hash;\n }\n\n /**\n * Converts a URL hash into a state JSON object\n *\n * @param {String} hash URL hash fragment\n * @returns {Object} JSON object\n */\n parse(hash) {\n if (hash.indexOf('#') === -1) {\n return null;\n }\n hash = hash.substr(1);\n return JSON.parse(decodeURIComponent(hash));\n }\n\n /**\n * Applies current hash state to features\n */\n sync() {\n let state = this.parse(location.hash);\n if (!state) {\n return;\n }\n // override current state with persisted one and sync features\n this.state.overrideAndSync(state);\n }\n\n /**\n * Release Hash event subscriptions and clear fields\n */\n destroy() {\n this.emitter.off(['state-changed'], (tf, state) => this.update(state));\n this.emitter.off(['initialized'], this.boundSync);\n removeEvt(root, 'hashchange', this.boundSync);\n\n this.state = null;\n this.lastHash = null;\n this.emitter = null;\n }\n}\n",
"static": true,
"longname": "/home/travis/build/koalyptus/TableFilter/src/modules/hash.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 491,
"kind": "variable",
"name": "JSON",
"memberof": "src/modules/hash.js",
"static": true,
"longname": "src/modules/hash.js~JSON",
"access": "public",
"export": false,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": null,
"description": null,
"lineNumber": 4,
"undocument": true,
"type": {
"types": [
"*"
]
},
"ignore": true
},
{
"__docId__": 492,
"kind": "variable",
"name": "location",
"memberof": "src/modules/hash.js",
"static": true,
"longname": "src/modules/hash.js~location",
"access": "public",
"export": false,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": null,
"description": null,
"lineNumber": 5,
"undocument": true,
"type": {
"types": [
"*"
]
},
"ignore": true
},
{
"__docId__": 493,
"kind": "variable",
"name": "decodeURIComponent",
"memberof": "src/modules/hash.js",
"static": true,
"longname": "src/modules/hash.js~decodeURIComponent",
"access": "public",
"export": false,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": null,
"description": null,
"lineNumber": 6,
"undocument": true,
"type": {
"types": [
"*"
]
},
"ignore": true
},
{
"__docId__": 494,
"kind": "variable",
"name": "encodeURIComponent",
"memberof": "src/modules/hash.js",
"static": true,
"longname": "src/modules/hash.js~encodeURIComponent",
"access": "public",
"export": false,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": null,
"description": null,
"lineNumber": 7,
"undocument": true,
"type": {
"types": [
"*"
]
},
"ignore": true
},
{
"__docId__": 495,
"kind": "function",
"name": "hasHashChange",
"memberof": "src/modules/hash.js",
"generator": false,
"async": false,
"static": true,
"longname": "src/modules/hash.js~hasHashChange",
"access": "public",
"export": true,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": "{hasHashChange}",
"description": "Checks if browser has onhashchange event",
"lineNumber": 12,
"params": [],
"return": {
"types": [
"*"
]
}
},
{
"__docId__": 496,
"kind": "class",
"name": "Hash",
"memberof": "src/modules/hash.js",
"static": true,
"longname": "src/modules/hash.js~Hash",
"access": "public",
"export": true,
"importPath": "tablefilter/src/modules/hash.js",
"importStyle": "{Hash}",
"description": "Manages state via URL hash changes",
"lineNumber": 23,
"unknown": [
{
"tagName": "@class",
"tagValue": "Hash"
}
],
"interface": false
},
{
"__docId__": 497,
"kind": "constructor",
"name": "constructor",
"memberof": "src/modules/hash.js~Hash",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/hash.js~Hash#constructor",
"access": "public",
"description": "Creates an instance of Hash",
"lineNumber": 30,
"params": [
{
"nullable": null,
"types": [
"State"
],
"spread": false,
"optional": false,
"name": "state",
"description": "Instance of State"
}
]
},
{
"__docId__": 498,
"kind": "member",
"name": "state",
"memberof": "src/modules/hash.js~Hash",
"static": false,
"longname": "src/modules/hash.js~Hash#state",
"access": "public",
"description": "State object",
"lineNumber": 35,
"type": {
"nullable": null,
"types": [
"State"
],
"spread": false,
"description": null
}
},
{
"__docId__": 499,
"kind": "member",
"name": "lastHash",
"memberof": "src/modules/hash.js~Hash",
"static": false,
"longname": "src/modules/hash.js~Hash#lastHash",
"access": "private",
"description": "Cached URL hash",
"lineNumber": 42,
"type": {
"nullable": null,
"types": [
"String"
],
"spread": false,
"description": null
},
"ignore": true
},
{
"__docId__": 500,
"kind": "member",
"name": "emitter",
"memberof": "src/modules/hash.js~Hash",
"static": false,
"longname": "src/modules/hash.js~Hash#emitter",
"access": "public",
"description": "Application event emitter instance",
"lineNumber": 48,
"type": {
"nullable": null,
"types": [
"Emitter"
],
"spread": false,
"description": null
}
},
{
"__docId__": 501,
"kind": "member",
"name": "boundSync",
"memberof": "src/modules/hash.js~Hash",
"static": false,
"longname": "src/modules/hash.js~Hash#boundSync",
"access": "private",
"description": "Bound sync wrapper for future use",
"lineNumber": 54,
"ignore": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 502,
"kind": "method",
"name": "init",
"memberof": "src/modules/hash.js~Hash",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/hash.js~Hash#init",
"access": "public",
"description": "Initializes the Hash object",
"lineNumber": 60,
"params": [],
"return": null
},
{
"__docId__": 505,
"kind": "method",
"name": "update",
"memberof": "src/modules/hash.js~Hash",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/hash.js~Hash#update",
"access": "public",
"description": "Updates the URL hash based on a state change",
"lineNumber": 78,
"params": [
{
"nullable": null,
"types": [
"State"
],
"spread": false,
"optional": false,
"name": "state",
"description": "Instance of State"
}
],
"return": null
},
{
"__docId__": 507,
"kind": "method",
"name": "parse",
"memberof": "src/modules/hash.js~Hash",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/hash.js~Hash#parse",
"access": "public",
"description": "Converts a URL hash into a state JSON object",
"lineNumber": 94,
"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"
}
},
{
"__docId__": 508,
"kind": "method",
"name": "sync",
"memberof": "src/modules/hash.js~Hash",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/hash.js~Hash#sync",
"access": "public",
"description": "Applies current hash state to features",
"lineNumber": 105,
"params": [],
"return": null
},
{
"__docId__": 509,
"kind": "method",
"name": "destroy",
"memberof": "src/modules/hash.js~Hash",
"generator": false,
"async": false,
"static": false,
"longname": "src/modules/hash.js~Hash#destroy",
"access": "public",
"description": "Release Hash event subscriptions and clear fields",
"lineNumber": 117,
"params": [],
"return": null
},
{
"__docId__": 513,
"kind": "file",
"name": "src/modules/help.js",
"content": "import {Feature} from '../feature';\nimport {createElm, createText, elm, removeElm} from '../dom';\nimport {addEvt, targetEvt, removeEvt} from '../event';\nimport {NONE} from '../const';\nimport {root} from '../root';\nimport {isEmpty, isNull} from '../types';\nimport {defaultsStr} from '../settings';\nimport {RIGHT} from './toolbar';\n\nconst WIKI_URL = 'https://github.com/koalyptus/TableFilter/wiki/' +\n '4.-Filter-operators';\nconst WEBSITE_URL = 'http://koalyptus.github.io/TableFilter/';\n\n/**\n * Help UI component\n */\nexport class Help extends Feature {\n\n /**\n * Creates an instance of Help\n * @param {TableFilter} tf TableFilter instance\n */\n constructor(tf) {\n super(tf, 'help');\n\n let f = this.config.help_instructions || {};\n\n /**\n * ID of main custom container element\n * @type {String}\n */\n this.tgtId = defaultsStr(f.target_id, null);\n\n /**\n * ID of custom container element for instructions\n * @type {String}\n */\n this.contTgtId = defaultsStr(f.container_target_id, null);\n\n /**\n * Instructions text (accepts HTML)\n * @type {String}\n */\n this.instrText = !isEmpty(f.text) ? f.text :\n 'Use the filters above each column to filter and limit table ' +\n 'data. Advanced searches can be performed by using the following ' +\n 'operators:
<, <=, >, ' +\n '>=, =, *, !, {, }, ' +\n '||,&&, [empty], [nonempty], ' +\n 'rgx:
' +\n 'Learn more