1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-04-27 12:31:58 +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 }],
"max-depth": [2, 7],
"max-statements": [2, 143],
"complexity": [2, 81],
"complexity": [2, 82],
"no-unused-vars": 2,
"no-eval": 2,
"no-underscore-dangle": 0,

View file

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

View file

@ -16,75 +16,73 @@ export class GridLayout extends Feature {
constructor(tf) {
super(tf, 'gridLayout');
let f = this.config;
let f = this.config.grid_layout || {};
/**
* Grid-layout container width as CSS string
* @type {String}
*/
this.width = f.grid_width || null;
this.width = f.width || null;
/**
* Grid-layout container height as CSS string
* @type {String}
*/
this.height = f.grid_height || null;
this.height = f.height || null;
/**
* Css class for main container element
* @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
* @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
* @type {String}
*/
this.headContCssClass = f.grid_tblHead_cont_css_class ||
'grd_headTblCont';
this.headContCssClass = f.tblHead_cont_css_class || 'grd_headTblCont';
/**
* Css class for toolbar container element (rows counter, paging etc.)
* @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
* @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
* @type {Array}
*/
this.headRows = f.grid_headers_rows || [0];
this.headRows = f.headers_rows || [0];
/**
* Enable or disable column filters generation, default: true
* @type {Boolean}
*/
this.enableFilters = f.grid_enable_default_filters === false ?
false : true;
this.enableFilters = f.enable_default_filters === false ? false : true;
/**
* Enable or disable column headers, default: false
* @type {Boolean}
*/
this.noHeaders = Boolean(f.grid_no_headers);
this.noHeaders = Boolean(f.no_headers);
/**
* Grid-layout default column widht as CSS string
* @type {String}
*/
this.defaultColWidth = f.grid_default_col_width || '100px';
this.defaultColWidth = f.default_col_width || '100px';
/**
* List of column elements

View file

@ -161,9 +161,9 @@ export class TableFilter {
/**
* 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
@ -812,14 +812,14 @@ export class TableFilter {
/**
* Enable no results message UI component
* @type {Boolean}
* @type {Object|Boolean}
*/
this.noResults = isObj(f.no_results_message) ||
Boolean(f.no_results_message);
/**
* Enable state persistence
* @type {Boolean}
* @type {Object|Boolean}
*/
this.state = isObj(f.state) || Boolean(f.state);