1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-10 02:16:40 +02:00

Started refactoring configuration options

This commit is contained in:
Max Guglielmi 2017-06-02 14:01:10 +10:00
parent 9dde61e7a0
commit 38424bfdca
4 changed files with 18 additions and 20 deletions

View file

@ -13,7 +13,7 @@
"keyword-spacing": ["error", { "after": true, "before": true }], "keyword-spacing": ["error", { "after": true, "before": true }],
"max-depth": [2, 7], "max-depth": [2, 7],
"max-statements": [2, 143], "max-statements": [2, 143],
"complexity": [2, 81], "complexity": [2, 82],
"no-unused-vars": 2, "no-unused-vars": 2,
"no-eval": 2, "no-eval": 2,
"no-underscore-dangle": 0, "no-underscore-dangle": 0,

View file

@ -1,6 +1,6 @@
{ {
"name": "tablefilter", "name": "tablefilter",
"version": "0.5.19", "version": "0.5.20",
"description": "A Javascript library making HTML tables filterable and a bit more", "description": "A Javascript library making HTML tables filterable and a bit more",
"license": "MIT", "license": "MIT",
"author": { "author": {

View file

@ -16,75 +16,73 @@ export class GridLayout extends Feature {
constructor(tf) { constructor(tf) {
super(tf, 'gridLayout'); super(tf, 'gridLayout');
let f = this.config; let f = this.config.grid_layout || {};
/** /**
* Grid-layout container width as CSS string * Grid-layout container width as CSS string
* @type {String} * @type {String}
*/ */
this.width = f.grid_width || null; this.width = f.width || null;
/** /**
* Grid-layout container height as CSS string * Grid-layout container height as CSS string
* @type {String} * @type {String}
*/ */
this.height = f.grid_height || null; this.height = f.height || null;
/** /**
* Css class for main container element * Css class for main container element
* @type {String} * @type {String}
*/ */
this.mainContCssClass = f.grid_cont_css_class || 'grd_Cont'; this.mainContCssClass = f.cont_css_class || 'grd_Cont';
/** /**
* Css class for body table container element * Css class for body table container element
* @type {String} * @type {String}
*/ */
this.contCssClass = f.grid_tbl_cont_css_class || 'grd_tblCont'; this.contCssClass = f.tbl_cont_css_class || 'grd_tblCont';
/** /**
* Css class for headers table container element * Css class for headers table container element
* @type {String} * @type {String}
*/ */
this.headContCssClass = f.grid_tblHead_cont_css_class || this.headContCssClass = f.tblHead_cont_css_class || 'grd_headTblCont';
'grd_headTblCont';
/** /**
* Css class for toolbar container element (rows counter, paging etc.) * Css class for toolbar container element (rows counter, paging etc.)
* @type {String} * @type {String}
*/ */
this.infDivCssClass = f.grid_inf_grid_css_class || 'grd_inf'; this.infDivCssClass = f.inf_grid_css_class || 'grd_inf';
/** /**
* Index of the headers row, default: 0 * Index of the headers row, default: 0
* @type {Number} * @type {Number}
*/ */
this.headRowIndex = f.grid_headers_row_index || 0; this.headRowIndex = f.headers_row_index || 0;
/** /**
* Collection of the header row indexes to be moved into headers table * Collection of the header row indexes to be moved into headers table
* @type {Array} * @type {Array}
*/ */
this.headRows = f.grid_headers_rows || [0]; this.headRows = f.headers_rows || [0];
/** /**
* Enable or disable column filters generation, default: true * Enable or disable column filters generation, default: true
* @type {Boolean} * @type {Boolean}
*/ */
this.enableFilters = f.grid_enable_default_filters === false ? this.enableFilters = f.enable_default_filters === false ? false : true;
false : true;
/** /**
* Enable or disable column headers, default: false * Enable or disable column headers, default: false
* @type {Boolean} * @type {Boolean}
*/ */
this.noHeaders = Boolean(f.grid_no_headers); this.noHeaders = Boolean(f.no_headers);
/** /**
* Grid-layout default column widht as CSS string * Grid-layout default column widht as CSS string
* @type {String} * @type {String}
*/ */
this.defaultColWidth = f.grid_default_col_width || '100px'; this.defaultColWidth = f.default_col_width || '100px';
/** /**
* List of column elements * List of column elements

View file

@ -161,9 +161,9 @@ export class TableFilter {
/** /**
* Enable/disable grid layout (fixed headers) * Enable/disable grid layout (fixed headers)
* @type {Boolean} * @type {Object|Boolean}
*/ */
this.gridLayout = Boolean(f.grid_layout); this.gridLayout = isObj(f.grid_layout) || Boolean(f.grid_layout);
/** /**
* Filters row index * Filters row index
@ -812,14 +812,14 @@ export class TableFilter {
/** /**
* Enable no results message UI component * Enable no results message UI component
* @type {Boolean} * @type {Object|Boolean}
*/ */
this.noResults = isObj(f.no_results_message) || this.noResults = isObj(f.no_results_message) ||
Boolean(f.no_results_message); Boolean(f.no_results_message);
/** /**
* Enable state persistence * Enable state persistence
* @type {Boolean} * @type {Object|Boolean}
*/ */
this.state = isObj(f.state) || Boolean(f.state); this.state = isObj(f.state) || Boolean(f.state);