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:
parent
9dde61e7a0
commit
38424bfdca
|
@ -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,
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue