mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-05-02 06:43:08 +02:00
wip
This commit is contained in:
parent
bfa440b265
commit
37f6db7025
|
@ -13,7 +13,7 @@
|
|||
"array-bracket-spacing": 2,
|
||||
"keyword-spacing": ["error", { "after": true, "before": true }],
|
||||
"max-depth": [2, 7],
|
||||
"max-statements": [2, 133],
|
||||
"max-statements": [2, 134],
|
||||
"complexity": [2, 41],
|
||||
"no-unused-vars": 2,
|
||||
"no-eval": 2,
|
||||
|
|
27491
dist/tablefilter/tablefilter.js
vendored
27491
dist/tablefilter/tablefilter.js
vendored
File diff suppressed because one or more lines are too long
2
dist/tablefilter/tablefilter.js.map
vendored
2
dist/tablefilter/tablefilter.js.map
vendored
File diff suppressed because one or more lines are too long
3504
dist/tablefilter/tf-0-1891d14d4ad1233555f2.js
vendored
Normal file
3504
dist/tablefilter/tf-0-1891d14d4ad1233555f2.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/tablefilter/tf-0-1891d14d4ad1233555f2.js.map
vendored
Normal file
1
dist/tablefilter/tf-0-1891d14d4ad1233555f2.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3478
dist/tablefilter/tf-0-2e300f81646508aa8de1.js
vendored
Normal file
3478
dist/tablefilter/tf-0-2e300f81646508aa8de1.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/tablefilter/tf-0-2e300f81646508aa8de1.js.map
vendored
Normal file
1
dist/tablefilter/tf-0-2e300f81646508aa8de1.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
3480
dist/tablefilter/tf-0-8ba4e8f28dcb16cfc50b.js
vendored
Normal file
3480
dist/tablefilter/tf-0-8ba4e8f28dcb16cfc50b.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/tablefilter/tf-0-8ba4e8f28dcb16cfc50b.js.map
vendored
Normal file
1
dist/tablefilter/tf-0-8ba4e8f28dcb16cfc50b.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "tablefilter",
|
||||
"version": "0.6.76",
|
||||
"version": "0.6.77",
|
||||
"description": "A Javascript library making HTML tables filterable and a bit more",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
import {TfBase} from './tfBase';
|
||||
|
||||
const NOT_IMPLEMENTED = 'Not implemented.';
|
||||
|
||||
/**
|
||||
* Base class defining the interface of a TableFilter feature
|
||||
*/
|
||||
export class Feature {
|
||||
export class Feature extends TfBase {
|
||||
/**
|
||||
* Creates an instance of Feature
|
||||
* @param {Object} tf TableFilter instance
|
||||
* @param {String} feature Feature name known by TableFilter
|
||||
*/
|
||||
constructor(tf, feature) {
|
||||
constructor(tf, feature, cls) {
|
||||
super(tf, cls);
|
||||
|
||||
/**
|
||||
* TableFilter instance
|
||||
* @type {TableFilter}
|
||||
|
|
|
@ -137,3 +137,6 @@ export class ClearButton extends Feature {
|
|||
this.initialized = false;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove as soon as feature name is fixed
|
||||
ClearButton.altName = 'btnReset';
|
||||
|
|
|
@ -238,3 +238,6 @@ export class Help extends Feature {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO: remove as soon as feature name is fixed
|
||||
Help.alwaysInstantiate = true;
|
||||
|
|
|
@ -172,3 +172,6 @@ export class HighlightKeyword {
|
|||
this.highlight(cell, term, this.highlightCssClass);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove as soon as feature name is fixed
|
||||
HighlightKeyword.altName = 'highlightKeywords';
|
||||
|
|
|
@ -456,3 +456,6 @@ export class PopupFilter extends Feature {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO: remove as soon as feature name is fixed
|
||||
PopupFilter.altName = 'popupFilters';
|
||||
|
|
|
@ -17,7 +17,7 @@ export class RowsCounter extends Feature {
|
|||
* @param {TableFilter} tf TableFilter instance
|
||||
*/
|
||||
constructor(tf) {
|
||||
super(tf, 'rowsCounter');
|
||||
super(tf, 'rowsCounter', RowsCounter);
|
||||
|
||||
// TableFilter configuration
|
||||
let f = this.config.rows_counter || {};
|
||||
|
|
|
@ -219,3 +219,6 @@ export class Toolbar extends Feature {
|
|||
this.initialized = false;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove as soon as feature name is fixed
|
||||
Toolbar.alwaysInstantiate = true;
|
||||
|
|
|
@ -74,3 +74,18 @@ export const contains = (term, data, exactMatch = false, caseSensitive = false,
|
|||
}
|
||||
return regexp.test(data);
|
||||
};
|
||||
|
||||
/**
|
||||
* Camelize a string, cutting the string by multiple separators like
|
||||
* hyphens, underscores and spaces.
|
||||
* @param {String} text text to camelize
|
||||
* @return {String} camelized text
|
||||
*/
|
||||
export const toCamelCase = (text = '') => {
|
||||
return text.replace(/^([A-Z])|[\s-_]+(\w)/g, (match, p1, p2) => {
|
||||
if (p2) {
|
||||
return p2.toUpperCase();
|
||||
}
|
||||
return p1.toLowerCase();
|
||||
});
|
||||
};
|
||||
|
|
|
@ -919,6 +919,7 @@ export class TableFilter {
|
|||
* @private
|
||||
*/
|
||||
this.Mod = {};
|
||||
this._mod_ = [];
|
||||
|
||||
/**
|
||||
* Extensions registry
|
||||
|
|
21
src/tfBase.js
Normal file
21
src/tfBase.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
import {defaultsStr} from './settings';
|
||||
import {toCamelCase} from './string';
|
||||
|
||||
export class TfBase {
|
||||
constructor(tf, cls = {}) {
|
||||
/**
|
||||
* TableFilter instance
|
||||
* @type {TableFilter}
|
||||
*/
|
||||
this.tf = tf;
|
||||
|
||||
/**
|
||||
* Feature name, retrieved from alternate class name if found or from
|
||||
* camelised class name
|
||||
* @type {String}
|
||||
*/
|
||||
this.feature = defaultsStr(cls.altName, toCamelCase(cls.name));
|
||||
|
||||
this.tf._mod_.push(this.feature);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue