mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-06-16 12:45:49 +02:00
Refactored string module
This commit is contained in:
parent
64f197866a
commit
b6c4fd6675
163
dist/tablefilter/tablefilter.js
vendored
163
dist/tablefilter/tablefilter.js
vendored
|
@ -124,8 +124,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
var _string = __webpack_require__(5);
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
var _types = __webpack_require__(4);
|
var _types = __webpack_require__(4);
|
||||||
|
|
||||||
var _date = __webpack_require__(6);
|
var _date = __webpack_require__(6);
|
||||||
|
@ -1359,7 +1357,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
re_l = new RegExp(this.lwOperator),
|
re_l = new RegExp(this.lwOperator),
|
||||||
re_g = new RegExp(this.grOperator),
|
re_g = new RegExp(this.grOperator),
|
||||||
re_d = new RegExp(this.dfOperator),
|
re_d = new RegExp(this.dfOperator),
|
||||||
re_lk = new RegExp(_string2.default.rgxEsc(this.lkOperator)),
|
re_lk = new RegExp((0, _string.rgxEsc)(this.lkOperator)),
|
||||||
re_eq = new RegExp(this.eqOperator),
|
re_eq = new RegExp(this.eqOperator),
|
||||||
re_st = new RegExp(this.stOperator),
|
re_st = new RegExp(this.stOperator),
|
||||||
re_en = new RegExp(this.enOperator),
|
re_en = new RegExp(this.enOperator),
|
||||||
|
@ -1368,7 +1366,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
// re_cr = new RegExp(this.curExp),
|
// re_cr = new RegExp(this.curExp),
|
||||||
re_em = this.emOperator,
|
re_em = this.emOperator,
|
||||||
re_nm = this.nmOperator,
|
re_nm = this.nmOperator,
|
||||||
re_re = new RegExp(_string2.default.rgxEsc(this.rgxOperator));
|
re_re = new RegExp((0, _string.rgxEsc)(this.rgxOperator));
|
||||||
|
|
||||||
//keyword highlighting
|
//keyword highlighting
|
||||||
function highlight(str, ok, cell) {
|
function highlight(str, ok, cell) {
|
||||||
|
@ -1390,7 +1388,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
//looks for search argument in current row
|
//looks for search argument in current row
|
||||||
function hasArg(sA, cellData, j) {
|
function hasArg(sA, cellData, j) {
|
||||||
sA = _string2.default.matchCase(sA, this.caseSensitive);
|
sA = (0, _string.matchCase)(sA, this.caseSensitive);
|
||||||
|
|
||||||
var occurence = void 0;
|
var occurence = void 0;
|
||||||
var dtType = this.hasColDateType ? this.colDateType[j] : this.defaultDateType;
|
var dtType = this.hasColDateType ? this.colDateType[j] : this.defaultDateType;
|
||||||
|
@ -1457,20 +1455,20 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
// searched keyword with * operator doesn't have to be a date
|
// searched keyword with * operator doesn't have to be a date
|
||||||
else if (re_lk.test(sA)) {
|
else if (re_lk.test(sA)) {
|
||||||
// like date
|
// like date
|
||||||
occurence = _string2.default.contains(sA.replace(re_lk, ''), cellData, false, this.caseSensitive);
|
occurence = (0, _string.contains)(sA.replace(re_lk, ''), cellData, false, this.caseSensitive);
|
||||||
} else if (_date2.default.isValid(sA, dtType)) {
|
} else if (_date2.default.isValid(sA, dtType)) {
|
||||||
dte2 = _date2.default.format(sA, dtType);
|
dte2 = _date2.default.format(sA, dtType);
|
||||||
occurence = dte1.toString() === dte2.toString();
|
occurence = dte1.toString() === dte2.toString();
|
||||||
}
|
}
|
||||||
//empty
|
//empty
|
||||||
else if (hasEM) {
|
else if (hasEM) {
|
||||||
occurence = _string2.default.isEmpty(cellData);
|
occurence = (0, _string.isEmpty)(cellData);
|
||||||
}
|
}
|
||||||
//non-empty
|
//non-empty
|
||||||
else if (hasNM) {
|
else if (hasNM) {
|
||||||
occurence = !_string2.default.isEmpty(cellData);
|
occurence = !(0, _string.isEmpty)(cellData);
|
||||||
} else {
|
} else {
|
||||||
occurence = _string2.default.contains(sA, cellData, this.isExactMatch(j), this.caseSensitive);
|
occurence = (0, _string.contains)(sA, cellData, this.isExactMatch(j), this.caseSensitive);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//first numbers need to be formated
|
//first numbers need to be formated
|
||||||
|
@ -1507,15 +1505,15 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
//different
|
//different
|
||||||
else if (hasDF) {
|
else if (hasDF) {
|
||||||
occurence = _string2.default.contains(sA.replace(re_d, ''), cellData, false, this.caseSensitive) ? false : true;
|
occurence = (0, _string.contains)(sA.replace(re_d, ''), cellData, false, this.caseSensitive) ? false : true;
|
||||||
}
|
}
|
||||||
//like
|
//like
|
||||||
else if (hasLK) {
|
else if (hasLK) {
|
||||||
occurence = _string2.default.contains(sA.replace(re_lk, ''), cellData, false, this.caseSensitive);
|
occurence = (0, _string.contains)(sA.replace(re_lk, ''), cellData, false, this.caseSensitive);
|
||||||
}
|
}
|
||||||
//equal
|
//equal
|
||||||
else if (hasEQ) {
|
else if (hasEQ) {
|
||||||
occurence = _string2.default.contains(sA.replace(re_eq, ''), cellData, true, this.caseSensitive);
|
occurence = (0, _string.contains)(sA.replace(re_eq, ''), cellData, true, this.caseSensitive);
|
||||||
}
|
}
|
||||||
//starts with
|
//starts with
|
||||||
else if (hasST) {
|
else if (hasST) {
|
||||||
|
@ -1528,11 +1526,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
//empty
|
//empty
|
||||||
else if (hasEM) {
|
else if (hasEM) {
|
||||||
occurence = _string2.default.isEmpty(cellData);
|
occurence = (0, _string.isEmpty)(cellData);
|
||||||
}
|
}
|
||||||
//non-empty
|
//non-empty
|
||||||
else if (hasNM) {
|
else if (hasNM) {
|
||||||
occurence = !_string2.default.isEmpty(cellData);
|
occurence = !(0, _string.isEmpty)(cellData);
|
||||||
}
|
}
|
||||||
//regexp
|
//regexp
|
||||||
else if (hasRE) {
|
else if (hasRE) {
|
||||||
|
@ -1550,10 +1548,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
// fallback to unformatted number string comparison
|
// fallback to unformatted number string comparison
|
||||||
if (numCellData && this.hasColNbFormat && this.colNbFormat[j] && !this.singleSearchFlt) {
|
if (numCellData && this.hasColNbFormat && this.colNbFormat[j] && !this.singleSearchFlt) {
|
||||||
sA = (0, _helpers.removeNbFormat)(sA, nbFormat);
|
sA = (0, _helpers.removeNbFormat)(sA, nbFormat);
|
||||||
occurence = numCellData === sA || _string2.default.contains(sA.toString(), numCellData.toString(), this.isExactMatch(j), this.caseSensitive);
|
occurence = numCellData === sA || (0, _string.contains)(sA.toString(), numCellData.toString(), this.isExactMatch(j), this.caseSensitive);
|
||||||
} else {
|
} else {
|
||||||
// Finally test search term is contained in cell data
|
// Finally test search term is contained in cell data
|
||||||
occurence = _string2.default.contains(sA, cellData, this.isExactMatch(j), this.caseSensitive);
|
occurence = (0, _string.contains)(sA, cellData, this.isExactMatch(j), this.caseSensitive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //else
|
} //else
|
||||||
|
@ -1587,7 +1585,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var cellData = _string2.default.matchCase(this.getCellData(cells[j]), this.caseSensitive);
|
var cellData = (0, _string.matchCase)(this.getCellData(cells[j]), this.caseSensitive);
|
||||||
|
|
||||||
//multiple search parameter operator ||
|
//multiple search parameter operator ||
|
||||||
var sAOrSplit = sA.toString().split(this.orOperator),
|
var sAOrSplit = sA.toString().split(this.orOperator),
|
||||||
|
@ -1613,7 +1611,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
// TODO: improve clarity/readability of this block
|
// TODO: improve clarity/readability of this block
|
||||||
for (var w = 0, len = s.length; w < len; w++) {
|
for (var w = 0, len = s.length; w < len; w++) {
|
||||||
cS = _string2.default.trim(s[w]);
|
cS = (0, _string.trim)(s[w]);
|
||||||
occur = hasArg.call(this, cS, cellData, j);
|
occur = hasArg.call(this, cS, cellData, j);
|
||||||
highlight.call(this, cS, occur, cells[j]);
|
highlight.call(this, cS, occur, cells[j]);
|
||||||
if (hasMultiOrSA && occur || hasMultiAndSA && !occur) {
|
if (hasMultiOrSA && occur || hasMultiAndSA && !occur) {
|
||||||
|
@ -1627,7 +1625,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
//single search parameter
|
//single search parameter
|
||||||
else {
|
else {
|
||||||
occurence[j] = hasArg.call(this, _string2.default.trim(sA), cellData, j);
|
occurence[j] = hasArg.call(this, (0, _string.trim)(sA), cellData, j);
|
||||||
highlight.call(this, sA, occurence[j], cells[j]);
|
highlight.call(this, sA, occurence[j], cells[j]);
|
||||||
} //else single param
|
} //else single param
|
||||||
|
|
||||||
|
@ -1772,7 +1770,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
if ((0, _types.isArray)(fltValue)) {
|
if ((0, _types.isArray)(fltValue)) {
|
||||||
searchArgs.push(fltValue);
|
searchArgs.push(fltValue);
|
||||||
} else {
|
} else {
|
||||||
searchArgs.push(_string2.default.trim(fltValue));
|
searchArgs.push((0, _string.trim)(fltValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return searchArgs;
|
return searchArgs;
|
||||||
|
@ -1810,7 +1808,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
var arr = [];
|
var arr = [];
|
||||||
for (var i = 0, len = this.fltIds.length; i < len; i++) {
|
for (var i = 0, len = this.fltIds.length; i < len; i++) {
|
||||||
var fltType = this.getFilterType(i);
|
var fltType = this.getFilterType(i);
|
||||||
if (fltType === _string2.default.lower(type)) {
|
if (fltType === type.toLowerCase()) {
|
||||||
var a = bool ? i : this.fltIds[i];
|
var a = bool ? i : this.fltIds[i];
|
||||||
arr.push(a);
|
arr.push(a);
|
||||||
}
|
}
|
||||||
|
@ -2106,7 +2104,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
if ((0, _types.isArray)(query)) {
|
if ((0, _types.isArray)(query)) {
|
||||||
_values = query;
|
_values = query;
|
||||||
} else {
|
} else {
|
||||||
query = _string2.default.matchCase(query, this.caseSensitive);
|
query = (0, _string.matchCase)(query, this.caseSensitive);
|
||||||
_values = query.split(' ' + this.orOperator + ' ');
|
_values = query.split(' ' + this.orOperator + ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2376,7 +2374,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
file = void 0,
|
file = void 0,
|
||||||
head = _dom2.default.tag(doc, 'head')[0];
|
head = _dom2.default.tag(doc, 'head')[0];
|
||||||
|
|
||||||
if (_string2.default.lower(ftype) === 'link') {
|
if (ftype.toLowerCase() === 'link') {
|
||||||
file = _dom2.default.create('link', ['id', fileId], ['type', 'text/css'], ['rel', 'stylesheet'], ['href', filePath]);
|
file = _dom2.default.create('link', ['id', fileId], ['type', 'text/css'], ['rel', 'stylesheet'], ['href', filePath]);
|
||||||
} else {
|
} else {
|
||||||
file = _dom2.default.create('script', ['id', fileId], ['type', 'text/javascript'], ['src', filePath]);
|
file = _dom2.default.create('script', ['id', fileId], ['type', 'text/javascript'], ['src', filePath]);
|
||||||
|
@ -2548,7 +2546,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
TableFilter.prototype.getFilterType = function getFilterType(colIndex) {
|
TableFilter.prototype.getFilterType = function getFilterType(colIndex) {
|
||||||
var colType = this.cfg['col_' + colIndex];
|
var colType = this.cfg['col_' + colIndex];
|
||||||
return !colType ? _const.INPUT : _string2.default.lower(colType);
|
return !colType ? _const.INPUT : colType.toLowerCase();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2671,10 +2669,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
var _string = __webpack_require__(5);
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DOM utilities
|
* DOM utilities
|
||||||
*/
|
*/
|
||||||
|
@ -2689,9 +2683,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
getText: function getText(node) {
|
getText: function getText(node) {
|
||||||
if ((0, _types.isUndef)(node.textContent)) {
|
if ((0, _types.isUndef)(node.textContent)) {
|
||||||
return _string2.default.trim(node.innerText);
|
return (0, _string.trim)(node.innerText);
|
||||||
}
|
}
|
||||||
return _string2.default.trim(node.textContent);
|
return (0, _string.trim)(node.textContent);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
@ -2943,34 +2937,29 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
* String utilities
|
* String utilities
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.default = {
|
var trim = exports.trim = function trim(text) {
|
||||||
lower: function lower(text) {
|
|
||||||
return text.toLowerCase();
|
|
||||||
},
|
|
||||||
upper: function upper(text) {
|
|
||||||
return text.toUpperCase();
|
|
||||||
},
|
|
||||||
trim: function trim(text) {
|
|
||||||
if (text.trim) {
|
if (text.trim) {
|
||||||
return text.trim();
|
return text.trim();
|
||||||
}
|
}
|
||||||
return text.replace(/^\s*|\s*$/g, '');
|
return text.replace(/^\s*|\s*$/g, '');
|
||||||
},
|
};
|
||||||
isEmpty: function isEmpty(text) {
|
|
||||||
return this.trim(text) === '';
|
var isEmpty = exports.isEmpty = function isEmpty(text) {
|
||||||
},
|
return trim(text) === '';
|
||||||
rgxEsc: function rgxEsc(text) {
|
};
|
||||||
|
|
||||||
|
var rgxEsc = exports.rgxEsc = function rgxEsc(text) {
|
||||||
var chars = /[-\/\\^$*+?.()|[\]{}]/g;
|
var chars = /[-\/\\^$*+?.()|[\]{}]/g;
|
||||||
var escMatch = '\\$&';
|
var escMatch = '\\$&';
|
||||||
return String(text).replace(chars, escMatch);
|
return String(text).replace(chars, escMatch);
|
||||||
},
|
};
|
||||||
matchCase: function matchCase(text, caseSensitive) {
|
|
||||||
|
var matchCase = exports.matchCase = function matchCase(text, caseSensitive) {
|
||||||
if (!caseSensitive) {
|
if (!caseSensitive) {
|
||||||
return this.lower(text);
|
return text.toLowerCase();
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
},
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if passed data contains the searched term
|
* Checks if passed data contains the searched term
|
||||||
|
@ -2980,21 +2969,20 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
* @param {Boolean} caseSensitive Case sensitive
|
* @param {Boolean} caseSensitive Case sensitive
|
||||||
* @return {Boolean}
|
* @return {Boolean}
|
||||||
*/
|
*/
|
||||||
contains: function contains(term, data) {
|
var contains = exports.contains = function contains(term, data) {
|
||||||
var exactMatch = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
|
var exactMatch = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];
|
||||||
var caseSensitive = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
|
var caseSensitive = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
|
||||||
|
|
||||||
// Improved by Cedric Wartel (cwl) automatic exact match for selects and
|
// Improved by Cedric Wartel (cwl) automatic exact match for selects and
|
||||||
// special characters are now filtered
|
// special characters are now filtered
|
||||||
var regexp = void 0,
|
var regexp = void 0;
|
||||||
modifier = caseSensitive ? 'g' : 'gi';
|
var modifier = caseSensitive ? 'g' : 'gi';
|
||||||
if (exactMatch) {
|
if (exactMatch) {
|
||||||
regexp = new RegExp('(^\\s*)' + this.rgxEsc(term) + '(\\s*$)', modifier);
|
regexp = new RegExp('(^\\s*)' + rgxEsc(term) + '(\\s*$)', modifier);
|
||||||
} else {
|
} else {
|
||||||
regexp = new RegExp(this.rgxEsc(term), modifier);
|
regexp = new RegExp(rgxEsc(term), modifier);
|
||||||
}
|
}
|
||||||
return regexp.test(data);
|
return regexp.test(data);
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/***/ },
|
/***/ },
|
||||||
|
@ -3307,8 +3295,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
var _string = __webpack_require__(5);
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
var _const = __webpack_require__(11);
|
var _const = __webpack_require__(11);
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
@ -3456,7 +3442,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
//In case table width is expressed in %
|
//In case table width is expressed in %
|
||||||
if (tbl.style.width === '') {
|
if (tbl.style.width === '') {
|
||||||
tbl.style.width = (_string2.default.contains('%', tblW) ? tbl.clientWidth : tblW) + 'px';
|
tbl.style.width = ((0, _string.contains)('%', tblW) ? tbl.clientWidth : tblW) + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
var d = _dom2.default.remove(this.tblCont);
|
var d = _dom2.default.remove(this.tblCont);
|
||||||
|
@ -3934,10 +3920,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var _dom2 = _interopRequireDefault(_dom);
|
var _dom2 = _interopRequireDefault(_dom);
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
var _types = __webpack_require__(4);
|
var _types = __webpack_require__(4);
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
@ -3993,8 +3975,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.nodeType === 3) {
|
if (node.nodeType === 3) {
|
||||||
var tempNodeVal = _string2.default.lower(node.nodeValue);
|
var tempNodeVal = node.nodeValue.toLowerCase();
|
||||||
var tempWordVal = _string2.default.lower(word);
|
var tempWordVal = word.toLowerCase();
|
||||||
if (tempNodeVal.indexOf(tempWordVal) !== -1) {
|
if (tempNodeVal.indexOf(tempWordVal) !== -1) {
|
||||||
var pn = node.parentNode;
|
var pn = node.parentNode;
|
||||||
if (pn && pn.className !== cssClass) {
|
if (pn && pn.className !== cssClass) {
|
||||||
|
@ -4031,8 +4013,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
for (var i = 0; i < highlightedNodes.length; i++) {
|
for (var i = 0; i < highlightedNodes.length; i++) {
|
||||||
var n = highlightedNodes[i];
|
var n = highlightedNodes[i];
|
||||||
var nodeVal = _dom2.default.getText(n),
|
var nodeVal = _dom2.default.getText(n),
|
||||||
tempNodeVal = _string2.default.lower(nodeVal),
|
tempNodeVal = nodeVal.toLowerCase(),
|
||||||
tempWordVal = _string2.default.lower(word);
|
tempWordVal = word.toLowerCase();
|
||||||
|
|
||||||
if (tempNodeVal.indexOf(tempWordVal) !== -1) {
|
if (tempNodeVal.indexOf(tempWordVal) !== -1) {
|
||||||
n.parentNode.replaceChild(_dom2.default.text(nodeVal), n);
|
n.parentNode.replaceChild(_dom2.default.text(nodeVal), n);
|
||||||
|
@ -4431,8 +4413,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
var _string = __webpack_require__(5);
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
var _sort = __webpack_require__(17);
|
var _sort = __webpack_require__(17);
|
||||||
|
|
||||||
var _event = __webpack_require__(1);
|
var _event = __webpack_require__(1);
|
||||||
|
@ -4521,7 +4501,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
slc.multiple = _const.MULTIPLE;
|
slc.multiple = _const.MULTIPLE;
|
||||||
slc.title = this.multipleSlcTooltip;
|
slc.title = this.multipleSlcTooltip;
|
||||||
}
|
}
|
||||||
slc.className = _string2.default.lower(col) === _const.SELECT ? tf.fltCssClass : tf.fltMultiCssClass;
|
slc.className = col.toLowerCase() === _const.SELECT ? tf.fltCssClass : tf.fltMultiCssClass;
|
||||||
|
|
||||||
//filter is appended in container element
|
//filter is appended in container element
|
||||||
if (externalFltTgtId) {
|
if (externalFltTgtId) {
|
||||||
|
@ -4580,8 +4560,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
var slcId = tf.fltIds[colIndex];
|
var slcId = tf.fltIds[colIndex];
|
||||||
var slc = _dom2.default.id(slcId),
|
var slc = _dom2.default.id(slcId),
|
||||||
rows = tf.tbl.rows,
|
rows = tf.tbl.rows,
|
||||||
nbRows = tf.getRowsNb(true),
|
nbRows = tf.getRowsNb(true);
|
||||||
matchCase = tf.matchCase;
|
|
||||||
|
|
||||||
//custom select test
|
//custom select test
|
||||||
this.isCustom = tf.isCustomOptions(colIndex);
|
this.isCustom = tf.isCustomOptions(colIndex);
|
||||||
|
@ -4623,10 +4602,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
var cellData = tf.getCellData(cell[j]),
|
var cellData = tf.getCellData(cell[j]),
|
||||||
|
|
||||||
//Vary Peter's patch
|
//Vary Peter's patch
|
||||||
cellString = _string2.default.matchCase(cellData, matchCase);
|
cellString = (0, _string.matchCase)(cellData, tf.matchCase);
|
||||||
|
|
||||||
// checks if celldata is already in array
|
// checks if celldata is already in array
|
||||||
if (!(0, _array.has)(this.opts, cellString, matchCase)) {
|
if (!(0, _array.has)(this.opts, cellString, tf.matchCase)) {
|
||||||
this.opts.push(cellData);
|
this.opts.push(cellData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4635,7 +4614,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
if (!filteredCol) {
|
if (!filteredCol) {
|
||||||
filteredCol = tf.getFilteredDataCol(j);
|
filteredCol = tf.getFilteredDataCol(j);
|
||||||
}
|
}
|
||||||
if (!(0, _array.has)(filteredCol, cellString, matchCase) && !(0, _array.has)(excludedOpts, cellString, matchCase)) {
|
if (!(0, _array.has)(filteredCol, cellString, tf.matchCase) && !(0, _array.has)(excludedOpts, cellString, tf.matchCase)) {
|
||||||
excludedOpts.push(cellData);
|
excludedOpts.push(cellData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4651,7 +4630,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tf.sortSlc && !this.isCustom) {
|
if (tf.sortSlc && !this.isCustom) {
|
||||||
if (!matchCase) {
|
if (!tf.matchCase) {
|
||||||
this.opts.sort(_sort.ignoreCase);
|
this.opts.sort(_sort.ignoreCase);
|
||||||
if (excludedOpts) {
|
if (excludedOpts) {
|
||||||
excludedOpts.sort(_sort.ignoreCase);
|
excludedOpts.sort(_sort.ignoreCase);
|
||||||
|
@ -4722,7 +4701,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
var val = this.opts[y]; //option value
|
var val = this.opts[y]; //option value
|
||||||
var lbl = this.isCustom ? this.optsTxt[y] : val; //option text
|
var lbl = this.isCustom ? this.optsTxt[y] : val; //option text
|
||||||
var isDisabled = false;
|
var isDisabled = false;
|
||||||
if (isLinked && tf.disableExcludedOptions && (0, _array.has)(excludedOpts, _string2.default.matchCase(val, tf.matchCase), tf.matchCase)) {
|
if (isLinked && tf.disableExcludedOptions && (0, _array.has)(excludedOpts, (0, _string.matchCase)(val, tf.matchCase), tf.matchCase)) {
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4850,14 +4829,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
var _string = __webpack_require__(5);
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
||||||
|
|
||||||
var has = exports.has = function has(arr, val, caseSensitive) {
|
var has = exports.has = function has(arr, val, caseSensitive) {
|
||||||
var sCase = Boolean(caseSensitive);
|
var sCase = Boolean(caseSensitive);
|
||||||
for (var i = 0, l = arr.length; i < l; i++) {
|
for (var i = 0, l = arr.length; i < l; i++) {
|
||||||
if (_string2.default.matchCase(arr[i].toString(), sCase) === val) {
|
if ((0, _string.matchCase)(arr[i].toString(), sCase) === val) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4914,8 +4889,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
var _string = __webpack_require__(5);
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
var _sort = __webpack_require__(17);
|
var _sort = __webpack_require__(17);
|
||||||
|
|
||||||
var _event = __webpack_require__(1);
|
var _event = __webpack_require__(1);
|
||||||
|
@ -5114,7 +5087,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var cellData = tf.getCellData(cells[j]);
|
var cellData = tf.getCellData(cells[j]);
|
||||||
//Vary Peter's patch
|
//Vary Peter's patch
|
||||||
var cellString = _string2.default.matchCase(cellData, tf.matchCase);
|
var cellString = (0, _string.matchCase)(cellData, tf.matchCase);
|
||||||
// checks if celldata is already in array
|
// checks if celldata is already in array
|
||||||
if (!(0, _array.has)(this.opts, cellString, tf.matchCase)) {
|
if (!(0, _array.has)(this.opts, cellString, tf.matchCase)) {
|
||||||
this.opts.push(cellData);
|
this.opts.push(cellData);
|
||||||
|
@ -5211,7 +5184,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
var li = _dom2.default.createCheckItem(tf.fltIds[colIndex] + '_' + (y + chkCt), val, lbl);
|
var li = _dom2.default.createCheckItem(tf.fltIds[colIndex] + '_' + (y + chkCt), val, lbl);
|
||||||
li.className = this.checkListItemCssClass;
|
li.className = this.checkListItemCssClass;
|
||||||
|
|
||||||
if (tf.linkedFilters && tf.disableExcludedOptions && (0, _array.has)(this.excludedOpts, _string2.default.matchCase(val, tf.matchCase), tf.matchCase)) {
|
if (tf.linkedFilters && tf.disableExcludedOptions && (0, _array.has)(this.excludedOpts, (0, _string.matchCase)(val, tf.matchCase), tf.matchCase)) {
|
||||||
_dom2.default.addClass(li, this.checkListItemDisabledCssClass);
|
_dom2.default.addClass(li, this.checkListItemDisabledCssClass);
|
||||||
li.check.disabled = true;
|
li.check.disabled = true;
|
||||||
li.disabled = true;
|
li.disabled = true;
|
||||||
|
@ -5319,7 +5292,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
n.setAttribute('indexes', '');
|
n.setAttribute('indexes', '');
|
||||||
} else {
|
} else {
|
||||||
fltValue = fltValue ? fltValue : '';
|
fltValue = fltValue ? fltValue : '';
|
||||||
chkValue = _string2.default.trim(fltValue + ' ' + chkValue + ' ' + tf.orOperator);
|
chkValue = (0, _string.trim)(fltValue + ' ' + chkValue + ' ' + tf.orOperator);
|
||||||
chkIndex = fltIndexes + chkIndex + tf.separator;
|
chkIndex = fltIndexes + chkIndex + tf.separator;
|
||||||
n.setAttribute('value', chkValue);
|
n.setAttribute('value', chkValue);
|
||||||
n.setAttribute('indexes', chkIndex);
|
n.setAttribute('indexes', chkIndex);
|
||||||
|
@ -5336,11 +5309,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
} else {
|
} else {
|
||||||
//removes values and indexes
|
//removes values and indexes
|
||||||
if (chkValue !== '') {
|
if (chkValue !== '') {
|
||||||
var replaceValue = new RegExp(_string2.default.rgxEsc(chkValue + ' ' + tf.orOperator));
|
var replaceValue = new RegExp((0, _string.rgxEsc)(chkValue + ' ' + tf.orOperator));
|
||||||
fltValue = fltValue.replace(replaceValue, '');
|
fltValue = fltValue.replace(replaceValue, '');
|
||||||
n.setAttribute('value', _string2.default.trim(fltValue));
|
n.setAttribute('value', (0, _string.trim)(fltValue));
|
||||||
|
|
||||||
var replaceIndex = new RegExp(_string2.default.rgxEsc(chkIndex + tf.separator));
|
var replaceIndex = new RegExp((0, _string.rgxEsc)(chkIndex + tf.separator));
|
||||||
fltIndexes = fltIndexes.replace(replaceIndex, '');
|
fltIndexes = fltIndexes.replace(replaceIndex, '');
|
||||||
n.setAttribute('indexes', fltIndexes);
|
n.setAttribute('indexes', fltIndexes);
|
||||||
}
|
}
|
||||||
|
@ -5375,7 +5348,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
var li = _dom2.default.tag(flt, 'li')[k],
|
var li = _dom2.default.tag(flt, 'li')[k],
|
||||||
lbl = _dom2.default.tag(li, 'label')[0],
|
lbl = _dom2.default.tag(li, 'label')[0],
|
||||||
chk = _dom2.default.tag(li, 'input')[0],
|
chk = _dom2.default.tag(li, 'input')[0],
|
||||||
lblTxt = _string2.default.matchCase(_dom2.default.getText(lbl), tf.caseSensitive);
|
lblTxt = (0, _string.matchCase)(_dom2.default.getText(lbl), tf.caseSensitive);
|
||||||
if (lblTxt !== '' && (0, _array.has)(values, lblTxt, tf.caseSensitive)) {
|
if (lblTxt !== '' && (0, _array.has)(values, lblTxt, tf.caseSensitive)) {
|
||||||
chk.checked = true;
|
chk.checked = true;
|
||||||
this.setCheckListValues(chk);
|
this.setCheckListValues(chk);
|
||||||
|
@ -5878,10 +5851,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var _types = __webpack_require__(4);
|
var _types = __webpack_require__(4);
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
var _event = __webpack_require__(1);
|
var _event = __webpack_require__(1);
|
||||||
|
|
||||||
var _event2 = _interopRequireDefault(_event);
|
var _event2 = _interopRequireDefault(_event);
|
||||||
|
@ -6334,7 +6303,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
var btnEvt = this.evt,
|
var btnEvt = this.evt,
|
||||||
cmdtype = typeof cmd === 'undefined' ? 'undefined' : _typeof(cmd);
|
cmdtype = typeof cmd === 'undefined' ? 'undefined' : _typeof(cmd);
|
||||||
if (cmdtype === 'string') {
|
if (cmdtype === 'string') {
|
||||||
switch (_string2.default.lower(cmd)) {
|
switch (cmd.toLowerCase()) {
|
||||||
case 'next':
|
case 'next':
|
||||||
btnEvt.next();
|
btnEvt.next();
|
||||||
break;
|
break;
|
||||||
|
@ -7327,12 +7296,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
var _string = __webpack_require__(5);
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
var _types = __webpack_require__(4);
|
var _types = __webpack_require__(4);
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||||
|
|
||||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||||
|
@ -7462,7 +7427,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
||||||
filterValues.forEach(function (val, idx) {
|
filterValues.forEach(function (val, idx) {
|
||||||
var key = '' + _this3.prfxCol + idx;
|
var key = '' + _this3.prfxCol + idx;
|
||||||
|
|
||||||
if ((0, _types.isString)(val) && _string2.default.isEmpty(val)) {
|
if ((0, _types.isString)(val) && (0, _string.isEmpty)(val)) {
|
||||||
if (state.hasOwnProperty(key)) {
|
if (state.hasOwnProperty(key)) {
|
||||||
state[key].flt = undefined;
|
state[key].flt = undefined;
|
||||||
}
|
}
|
||||||
|
|
8
dist/tablefilter/tf-1.js
vendored
8
dist/tablefilter/tf-1.js
vendored
|
@ -626,10 +626,6 @@ webpackJsonp([1],{
|
||||||
|
|
||||||
var _dom2 = _interopRequireDefault(_dom);
|
var _dom2 = _interopRequireDefault(_dom);
|
||||||
|
|
||||||
var _string = __webpack_require__(5);
|
|
||||||
|
|
||||||
var _string2 = _interopRequireDefault(_string);
|
|
||||||
|
|
||||||
var _types = __webpack_require__(4);
|
var _types = __webpack_require__(4);
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
@ -774,7 +770,7 @@ webpackJsonp([1],{
|
||||||
for (var k = 0; k < colIndex.length; k++) {
|
for (var k = 0; k < colIndex.length; k++) {
|
||||||
if (colIndex[k] === ucolIndex[ucol]) {
|
if (colIndex[k] === ucolIndex[ucol]) {
|
||||||
mThisCol++;
|
mThisCol++;
|
||||||
opsThisCol[mThisCol] = _string2.default.lower(operation[k]);
|
opsThisCol[mThisCol] = operation[k].toLowerCase();
|
||||||
decThisCol[mThisCol] = decimalPrecision[k];
|
decThisCol[mThisCol] = decimalPrecision[k];
|
||||||
labThisCol[mThisCol] = labelId[k];
|
labThisCol[mThisCol] = labelId[k];
|
||||||
oTypeThisCol = (0, _types.isArray)(outputType) ? outputType[k] : null;
|
oTypeThisCol = (0, _types.isArray)(outputType) ? outputType[k] : null;
|
||||||
|
@ -910,7 +906,7 @@ webpackJsonp([1],{
|
||||||
result = result.toFixed(precision);
|
result = result.toFixed(precision);
|
||||||
|
|
||||||
if (_dom2.default.id(labThisCol[i])) {
|
if (_dom2.default.id(labThisCol[i])) {
|
||||||
switch (_string2.default.lower(oTypeThisCol)) {
|
switch (oTypeThisCol.toLowerCase()) {
|
||||||
case 'innerhtml':
|
case 'innerhtml':
|
||||||
if (isNaN(result) || !isFinite(result) || nbvalues === 0) {
|
if (isNaN(result) || !isFinite(result) || nbvalues === 0) {
|
||||||
_dom2.default.id(labThisCol[i]).innerHTML = '.';
|
_dom2.default.id(labThisCol[i]).innerHTML = '.';
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
* Array utilities
|
* Array utilities
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Str from './string';
|
import {matchCase} from './string';
|
||||||
|
|
||||||
export const has = (arr, val, caseSensitive) => {
|
export const has = (arr, val, caseSensitive) => {
|
||||||
let sCase = Boolean(caseSensitive);
|
let sCase = Boolean(caseSensitive);
|
||||||
for (var i = 0, l = arr.length; i < l; i++) {
|
for (var i = 0, l = arr.length; i < l; i++) {
|
||||||
if (Str.matchCase(arr[i].toString(), sCase) === val) {
|
if (matchCase(arr[i].toString(), sCase) === val) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {isUndef} from './types';
|
import {isUndef} from './types';
|
||||||
import Str from './string';
|
import {trim} from './string';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DOM utilities
|
* DOM utilities
|
||||||
|
@ -14,9 +14,9 @@ export default {
|
||||||
*/
|
*/
|
||||||
getText(node) {
|
getText(node) {
|
||||||
if (isUndef(node.textContent)) {
|
if (isUndef(node.textContent)) {
|
||||||
return Str.trim(node.innerText);
|
return trim(node.innerText);
|
||||||
}
|
}
|
||||||
return Str.trim(node.textContent);
|
return trim(node.textContent);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import {Feature} from '../../feature';
|
import {Feature} from '../../feature';
|
||||||
import Dom from '../../dom';
|
import Dom from '../../dom';
|
||||||
import Str from '../../string';
|
|
||||||
import {isArray, isFn, isUndef} from '../../types';
|
import {isArray, isFn, isUndef} from '../../types';
|
||||||
|
|
||||||
export default class ColOps extends Feature {
|
export default class ColOps extends Feature {
|
||||||
|
@ -129,7 +128,7 @@ export default class ColOps extends Feature {
|
||||||
for (var k = 0; k < colIndex.length; k++) {
|
for (var k = 0; k < colIndex.length; k++) {
|
||||||
if (colIndex[k] === ucolIndex[ucol]) {
|
if (colIndex[k] === ucolIndex[ucol]) {
|
||||||
mThisCol++;
|
mThisCol++;
|
||||||
opsThisCol[mThisCol] = Str.lower(operation[k]);
|
opsThisCol[mThisCol] = operation[k].toLowerCase();
|
||||||
decThisCol[mThisCol] = decimalPrecision[k];
|
decThisCol[mThisCol] = decimalPrecision[k];
|
||||||
labThisCol[mThisCol] = labelId[k];
|
labThisCol[mThisCol] = labelId[k];
|
||||||
oTypeThisCol = isArray(outputType) ?
|
oTypeThisCol = isArray(outputType) ?
|
||||||
|
@ -270,7 +269,7 @@ export default class ColOps extends Feature {
|
||||||
result = result.toFixed(precision);
|
result = result.toFixed(precision);
|
||||||
|
|
||||||
if (Dom.id(labThisCol[i])) {
|
if (Dom.id(labThisCol[i])) {
|
||||||
switch (Str.lower(oTypeThisCol)) {
|
switch (oTypeThisCol.toLowerCase()) {
|
||||||
case 'innerhtml':
|
case 'innerhtml':
|
||||||
if (isNaN(result) || !isFinite(result) ||
|
if (isNaN(result) || !isFinite(result) ||
|
||||||
nbvalues === 0) {
|
nbvalues === 0) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {Feature} from '../feature';
|
import {Feature} from '../feature';
|
||||||
import Dom from '../dom';
|
import Dom from '../dom';
|
||||||
import {has} from '../array';
|
import {has} from '../array';
|
||||||
import Str from '../string';
|
import {matchCase, trim, rgxEsc} from '../string';
|
||||||
import {ignoreCase, numSortAsc, numSortDesc} from '../sort';
|
import {ignoreCase, numSortAsc, numSortDesc} from '../sort';
|
||||||
import Event from '../event';
|
import Event from '../event';
|
||||||
import {isEmpty} from '../types';
|
import {isEmpty} from '../types';
|
||||||
|
@ -186,7 +186,7 @@ export class CheckList extends Feature {
|
||||||
|
|
||||||
let cellData = tf.getCellData(cells[j]);
|
let cellData = tf.getCellData(cells[j]);
|
||||||
//Vary Peter's patch
|
//Vary Peter's patch
|
||||||
let cellString = Str.matchCase(cellData, tf.matchCase);
|
let cellString = matchCase(cellData, tf.matchCase);
|
||||||
// checks if celldata is already in array
|
// checks if celldata is already in array
|
||||||
if (!has(this.opts, cellString, tf.matchCase)) {
|
if (!has(this.opts, cellString, tf.matchCase)) {
|
||||||
this.opts.push(cellData);
|
this.opts.push(cellData);
|
||||||
|
@ -284,7 +284,7 @@ export class CheckList extends Feature {
|
||||||
li.className = this.checkListItemCssClass;
|
li.className = this.checkListItemCssClass;
|
||||||
|
|
||||||
if (tf.linkedFilters && tf.disableExcludedOptions &&
|
if (tf.linkedFilters && tf.disableExcludedOptions &&
|
||||||
has(this.excludedOpts, Str.matchCase(val, tf.matchCase),
|
has(this.excludedOpts, matchCase(val, tf.matchCase),
|
||||||
tf.matchCase)) {
|
tf.matchCase)) {
|
||||||
Dom.addClass(li, this.checkListItemDisabledCssClass);
|
Dom.addClass(li, this.checkListItemDisabledCssClass);
|
||||||
li.check.disabled = true;
|
li.check.disabled = true;
|
||||||
|
@ -390,7 +390,7 @@ export class CheckList extends Feature {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
fltValue = (fltValue) ? fltValue : '';
|
fltValue = (fltValue) ? fltValue : '';
|
||||||
chkValue = Str.trim(fltValue + ' ' + chkValue + ' ' +
|
chkValue = trim(fltValue + ' ' + chkValue + ' ' +
|
||||||
tf.orOperator);
|
tf.orOperator);
|
||||||
chkIndex = fltIndexes + chkIndex + tf.separator;
|
chkIndex = fltIndexes + chkIndex + tf.separator;
|
||||||
n.setAttribute('value', chkValue);
|
n.setAttribute('value', chkValue);
|
||||||
|
@ -409,12 +409,12 @@ export class CheckList extends Feature {
|
||||||
} else { //removes values and indexes
|
} else { //removes values and indexes
|
||||||
if (chkValue !== '') {
|
if (chkValue !== '') {
|
||||||
let replaceValue = new RegExp(
|
let replaceValue = new RegExp(
|
||||||
Str.rgxEsc(chkValue + ' ' + tf.orOperator));
|
rgxEsc(chkValue + ' ' + tf.orOperator));
|
||||||
fltValue = fltValue.replace(replaceValue, '');
|
fltValue = fltValue.replace(replaceValue, '');
|
||||||
n.setAttribute('value', Str.trim(fltValue));
|
n.setAttribute('value', trim(fltValue));
|
||||||
|
|
||||||
let replaceIndex = new RegExp(
|
let replaceIndex = new RegExp(
|
||||||
Str.rgxEsc(chkIndex + tf.separator));
|
rgxEsc(chkIndex + tf.separator));
|
||||||
fltIndexes = fltIndexes.replace(replaceIndex, '');
|
fltIndexes = fltIndexes.replace(replaceIndex, '');
|
||||||
n.setAttribute('indexes', fltIndexes);
|
n.setAttribute('indexes', fltIndexes);
|
||||||
}
|
}
|
||||||
|
@ -445,7 +445,7 @@ export class CheckList extends Feature {
|
||||||
let li = Dom.tag(flt, 'li')[k],
|
let li = Dom.tag(flt, 'li')[k],
|
||||||
lbl = Dom.tag(li, 'label')[0],
|
lbl = Dom.tag(li, 'label')[0],
|
||||||
chk = Dom.tag(li, 'input')[0],
|
chk = Dom.tag(li, 'input')[0],
|
||||||
lblTxt = Str.matchCase(Dom.getText(lbl), tf.caseSensitive);
|
lblTxt = matchCase(Dom.getText(lbl), tf.caseSensitive);
|
||||||
if (lblTxt !== '' && has(values, lblTxt, tf.caseSensitive)) {
|
if (lblTxt !== '' && has(values, lblTxt, tf.caseSensitive)) {
|
||||||
chk.checked = true;
|
chk.checked = true;
|
||||||
this.setCheckListValues(chk);
|
this.setCheckListValues(chk);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {Feature} from '../feature';
|
import {Feature} from '../feature';
|
||||||
import Dom from '../dom';
|
import Dom from '../dom';
|
||||||
import {has} from '../array';
|
import {has} from '../array';
|
||||||
import Str from '../string';
|
import {matchCase} from '../string';
|
||||||
import {ignoreCase, numSortAsc, numSortDesc} from '../sort';
|
import {ignoreCase, numSortAsc, numSortDesc} from '../sort';
|
||||||
import Event from '../event';
|
import Event from '../event';
|
||||||
import {SELECT, MULTIPLE, NONE} from '../const';
|
import {SELECT, MULTIPLE, NONE} from '../const';
|
||||||
|
@ -76,7 +76,7 @@ export class Dropdown extends Feature {
|
||||||
slc.multiple = MULTIPLE;
|
slc.multiple = MULTIPLE;
|
||||||
slc.title = this.multipleSlcTooltip;
|
slc.title = this.multipleSlcTooltip;
|
||||||
}
|
}
|
||||||
slc.className = Str.lower(col) === SELECT ?
|
slc.className = col.toLowerCase() === SELECT ?
|
||||||
tf.fltCssClass : tf.fltMultiCssClass;
|
tf.fltCssClass : tf.fltMultiCssClass;
|
||||||
|
|
||||||
//filter is appended in container element
|
//filter is appended in container element
|
||||||
|
@ -131,8 +131,7 @@ export class Dropdown extends Feature {
|
||||||
let slcId = tf.fltIds[colIndex];
|
let slcId = tf.fltIds[colIndex];
|
||||||
let slc = Dom.id(slcId),
|
let slc = Dom.id(slcId),
|
||||||
rows = tf.tbl.rows,
|
rows = tf.tbl.rows,
|
||||||
nbRows = tf.getRowsNb(true),
|
nbRows = tf.getRowsNb(true);
|
||||||
matchCase = tf.matchCase;
|
|
||||||
|
|
||||||
//custom select test
|
//custom select test
|
||||||
this.isCustom = tf.isCustomOptions(colIndex);
|
this.isCustom = tf.isCustomOptions(colIndex);
|
||||||
|
@ -184,10 +183,10 @@ export class Dropdown extends Feature {
|
||||||
tf.validRowsIndex.indexOf(k) !== -1)))))) {
|
tf.validRowsIndex.indexOf(k) !== -1)))))) {
|
||||||
let cellData = tf.getCellData(cell[j]),
|
let cellData = tf.getCellData(cell[j]),
|
||||||
//Vary Peter's patch
|
//Vary Peter's patch
|
||||||
cellString = Str.matchCase(cellData, matchCase);
|
cellString = matchCase(cellData, tf.matchCase);
|
||||||
|
|
||||||
// checks if celldata is already in array
|
// checks if celldata is already in array
|
||||||
if (!has(this.opts, cellString, matchCase)) {
|
if (!has(this.opts, cellString, tf.matchCase)) {
|
||||||
this.opts.push(cellData);
|
this.opts.push(cellData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,8 +195,8 @@ export class Dropdown extends Feature {
|
||||||
if (!filteredCol) {
|
if (!filteredCol) {
|
||||||
filteredCol = tf.getFilteredDataCol(j);
|
filteredCol = tf.getFilteredDataCol(j);
|
||||||
}
|
}
|
||||||
if (!has(filteredCol, cellString, matchCase) &&
|
if (!has(filteredCol, cellString, tf.matchCase) &&
|
||||||
!has(excludedOpts, cellString, matchCase)) {
|
!has(excludedOpts, cellString, tf.matchCase)) {
|
||||||
excludedOpts.push(cellData);
|
excludedOpts.push(cellData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +212,7 @@ export class Dropdown extends Feature {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tf.sortSlc && !this.isCustom) {
|
if (tf.sortSlc && !this.isCustom) {
|
||||||
if (!matchCase) {
|
if (!tf.matchCase) {
|
||||||
this.opts.sort(ignoreCase);
|
this.opts.sort(ignoreCase);
|
||||||
if (excludedOpts) {
|
if (excludedOpts) {
|
||||||
excludedOpts.sort(ignoreCase);
|
excludedOpts.sort(ignoreCase);
|
||||||
|
@ -283,8 +282,7 @@ export class Dropdown extends Feature {
|
||||||
let lbl = this.isCustom ? this.optsTxt[y] : val; //option text
|
let lbl = this.isCustom ? this.optsTxt[y] : val; //option text
|
||||||
let isDisabled = false;
|
let isDisabled = false;
|
||||||
if (isLinked && tf.disableExcludedOptions &&
|
if (isLinked && tf.disableExcludedOptions &&
|
||||||
has(excludedOpts, Str.matchCase(val, tf.matchCase),
|
has(excludedOpts, matchCase(val, tf.matchCase), tf.matchCase)) {
|
||||||
tf.matchCase)) {
|
|
||||||
isDisabled = true;
|
isDisabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {Feature} from '../feature';
|
||||||
import Dom from '../dom';
|
import Dom from '../dom';
|
||||||
import {isFn, isNull, isUndef} from '../types';
|
import {isFn, isNull, isUndef} from '../types';
|
||||||
import Event from '../event';
|
import Event from '../event';
|
||||||
import Str from '../string';
|
import {contains} from '../string';
|
||||||
import {NONE} from '../const';
|
import {NONE} from '../const';
|
||||||
|
|
||||||
export class GridLayout extends Feature {
|
export class GridLayout extends Feature {
|
||||||
|
@ -137,7 +137,7 @@ export class GridLayout extends Feature {
|
||||||
|
|
||||||
//In case table width is expressed in %
|
//In case table width is expressed in %
|
||||||
if (tbl.style.width === '') {
|
if (tbl.style.width === '') {
|
||||||
tbl.style.width = (Str.contains('%', tblW) ?
|
tbl.style.width = (contains('%', tblW) ?
|
||||||
tbl.clientWidth : tblW) + 'px';
|
tbl.clientWidth : tblW) + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import Dom from '../dom';
|
import Dom from '../dom';
|
||||||
import Str from '../string';
|
|
||||||
import {isArray} from '../types';
|
import {isArray} from '../types';
|
||||||
|
|
||||||
export class HighlightKeyword {
|
export class HighlightKeyword {
|
||||||
|
@ -47,8 +46,8 @@ export class HighlightKeyword {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.nodeType === 3) {
|
if (node.nodeType === 3) {
|
||||||
let tempNodeVal = Str.lower(node.nodeValue);
|
let tempNodeVal = node.nodeValue.toLowerCase();
|
||||||
let tempWordVal = Str.lower(word);
|
let tempWordVal = word.toLowerCase();
|
||||||
if (tempNodeVal.indexOf(tempWordVal) !== -1) {
|
if (tempNodeVal.indexOf(tempWordVal) !== -1) {
|
||||||
let pn = node.parentNode;
|
let pn = node.parentNode;
|
||||||
if (pn && pn.className !== cssClass) {
|
if (pn && pn.className !== cssClass) {
|
||||||
|
@ -82,8 +81,8 @@ export class HighlightKeyword {
|
||||||
for (let i = 0; i < highlightedNodes.length; i++) {
|
for (let i = 0; i < highlightedNodes.length; i++) {
|
||||||
let n = highlightedNodes[i];
|
let n = highlightedNodes[i];
|
||||||
let nodeVal = Dom.getText(n),
|
let nodeVal = Dom.getText(n),
|
||||||
tempNodeVal = Str.lower(nodeVal),
|
tempNodeVal = nodeVal.toLowerCase(),
|
||||||
tempWordVal = Str.lower(word);
|
tempWordVal = word.toLowerCase();
|
||||||
|
|
||||||
if (tempNodeVal.indexOf(tempWordVal) !== -1) {
|
if (tempNodeVal.indexOf(tempWordVal) !== -1) {
|
||||||
n.parentNode.replaceChild(Dom.text(nodeVal), n);
|
n.parentNode.replaceChild(Dom.text(nodeVal), n);
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import {Feature} from '../feature';
|
import {Feature} from '../feature';
|
||||||
import Dom from '../dom';
|
import Dom from '../dom';
|
||||||
import {isArray, isFn, isNull} from '../types';
|
import {isArray, isFn, isNull} from '../types';
|
||||||
import Str from '../string';
|
|
||||||
import Event from '../event';
|
import Event from '../event';
|
||||||
import {INPUT, SELECT, NONE, ENTER_KEY} from '../const';
|
import {INPUT, SELECT, NONE, ENTER_KEY} from '../const';
|
||||||
|
|
||||||
|
@ -465,7 +464,7 @@ export class Paging extends Feature {
|
||||||
var btnEvt = this.evt,
|
var btnEvt = this.evt,
|
||||||
cmdtype = typeof cmd;
|
cmdtype = typeof cmd;
|
||||||
if (cmdtype === 'string') {
|
if (cmdtype === 'string') {
|
||||||
switch (Str.lower(cmd)) {
|
switch (cmd.toLowerCase()) {
|
||||||
case 'next':
|
case 'next':
|
||||||
btnEvt.next();
|
btnEvt.next();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {Feature} from '../feature';
|
import {Feature} from '../feature';
|
||||||
import {Hash} from './hash';
|
import {Hash} from './hash';
|
||||||
import {Storage} from './storage';
|
import {Storage} from './storage';
|
||||||
import Str from '../string';
|
import {isEmpty} from '../string';
|
||||||
import {isArray, isNull, isString, isUndef} from '../types';
|
import {isArray, isNull, isString, isUndef} from '../types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -107,7 +107,7 @@ export class State extends Feature {
|
||||||
filterValues.forEach((val, idx) => {
|
filterValues.forEach((val, idx) => {
|
||||||
let key = `${this.prfxCol}${idx}`;
|
let key = `${this.prfxCol}${idx}`;
|
||||||
|
|
||||||
if (isString(val) && Str.isEmpty(val)) {
|
if (isString(val) && isEmpty(val)) {
|
||||||
if (state.hasOwnProperty(key)) {
|
if (state.hasOwnProperty(key)) {
|
||||||
state[key].flt = undefined;
|
state[key].flt = undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,39 +2,27 @@
|
||||||
* String utilities
|
* String utilities
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default {
|
export const trim = text => {
|
||||||
|
|
||||||
lower(text){
|
|
||||||
return text.toLowerCase();
|
|
||||||
},
|
|
||||||
|
|
||||||
upper(text){
|
|
||||||
return text.toUpperCase();
|
|
||||||
},
|
|
||||||
|
|
||||||
trim(text){
|
|
||||||
if (text.trim) {
|
if (text.trim) {
|
||||||
return text.trim();
|
return text.trim();
|
||||||
}
|
}
|
||||||
return text.replace(/^\s*|\s*$/g, '');
|
return text.replace(/^\s*|\s*$/g, '');
|
||||||
},
|
}
|
||||||
|
|
||||||
isEmpty(text){
|
export const isEmpty = (text) => trim(text) === '';
|
||||||
return this.trim(text) === '';
|
|
||||||
},
|
|
||||||
|
|
||||||
rgxEsc(text){
|
export const rgxEsc = text => {
|
||||||
let chars = /[-\/\\^$*+?.()|[\]{}]/g;
|
let chars = /[-\/\\^$*+?.()|[\]{}]/g;
|
||||||
let escMatch = '\\$&';
|
let escMatch = '\\$&';
|
||||||
return String(text).replace(chars, escMatch);
|
return String(text).replace(chars, escMatch);
|
||||||
},
|
}
|
||||||
|
|
||||||
matchCase(text, caseSensitive){
|
export const matchCase = (text, caseSensitive) => {
|
||||||
if (!caseSensitive) {
|
if (!caseSensitive) {
|
||||||
return this.lower(text);
|
return text.toLowerCase();
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
},
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if passed data contains the searched term
|
* Checks if passed data contains the searched term
|
||||||
|
@ -44,18 +32,17 @@ export default {
|
||||||
* @param {Boolean} caseSensitive Case sensitive
|
* @param {Boolean} caseSensitive Case sensitive
|
||||||
* @return {Boolean}
|
* @return {Boolean}
|
||||||
*/
|
*/
|
||||||
contains(term, data, exactMatch=false, caseSensitive=false){
|
export const contains =
|
||||||
|
(term, data, exactMatch = false, caseSensitive = false) => {
|
||||||
// Improved by Cedric Wartel (cwl) automatic exact match for selects and
|
// Improved by Cedric Wartel (cwl) automatic exact match for selects and
|
||||||
// special characters are now filtered
|
// special characters are now filtered
|
||||||
let regexp,
|
let regexp;
|
||||||
modifier = caseSensitive ? 'g' : 'gi';
|
let modifier = caseSensitive ? 'g' : 'gi';
|
||||||
if (exactMatch) {
|
if (exactMatch) {
|
||||||
regexp = new RegExp(
|
regexp = new RegExp('(^\\s*)' + rgxEsc(term) + '(\\s*$)',
|
||||||
'(^\\s*)'+ this.rgxEsc(term) +'(\\s*$)', modifier);
|
modifier);
|
||||||
} else {
|
} else {
|
||||||
regexp = new RegExp(this.rgxEsc(term), modifier);
|
regexp = new RegExp(rgxEsc(term), modifier);
|
||||||
}
|
}
|
||||||
return regexp.test(data);
|
return regexp.test(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import Event from './event';
|
import Event from './event';
|
||||||
import Dom from './dom';
|
import Dom from './dom';
|
||||||
import Str from './string';
|
import {contains, matchCase, rgxEsc, trim} from './string';
|
||||||
|
import {isEmpty as isEmptyString} from './string';
|
||||||
import {isArray, isEmpty, isFn, isNumber, isObj, isString, isUndef}
|
import {isArray, isEmpty, isFn, isNumber, isObj, isString, isUndef}
|
||||||
from './types';
|
from './types';
|
||||||
import DateHelper from './date';
|
import DateHelper from './date';
|
||||||
|
@ -1151,7 +1152,7 @@ export class TableFilter {
|
||||||
re_l = new RegExp(this.lwOperator),
|
re_l = new RegExp(this.lwOperator),
|
||||||
re_g = new RegExp(this.grOperator),
|
re_g = new RegExp(this.grOperator),
|
||||||
re_d = new RegExp(this.dfOperator),
|
re_d = new RegExp(this.dfOperator),
|
||||||
re_lk = new RegExp(Str.rgxEsc(this.lkOperator)),
|
re_lk = new RegExp(rgxEsc(this.lkOperator)),
|
||||||
re_eq = new RegExp(this.eqOperator),
|
re_eq = new RegExp(this.eqOperator),
|
||||||
re_st = new RegExp(this.stOperator),
|
re_st = new RegExp(this.stOperator),
|
||||||
re_en = new RegExp(this.enOperator),
|
re_en = new RegExp(this.enOperator),
|
||||||
|
@ -1159,7 +1160,7 @@ export class TableFilter {
|
||||||
// re_cr = new RegExp(this.curExp),
|
// re_cr = new RegExp(this.curExp),
|
||||||
re_em = this.emOperator,
|
re_em = this.emOperator,
|
||||||
re_nm = this.nmOperator,
|
re_nm = this.nmOperator,
|
||||||
re_re = new RegExp(Str.rgxEsc(this.rgxOperator));
|
re_re = new RegExp(rgxEsc(this.rgxOperator));
|
||||||
|
|
||||||
//keyword highlighting
|
//keyword highlighting
|
||||||
function highlight(str, ok, cell) {
|
function highlight(str, ok, cell) {
|
||||||
|
@ -1182,7 +1183,7 @@ export class TableFilter {
|
||||||
|
|
||||||
//looks for search argument in current row
|
//looks for search argument in current row
|
||||||
function hasArg(sA, cellData, j) {
|
function hasArg(sA, cellData, j) {
|
||||||
sA = Str.matchCase(sA, this.caseSensitive);
|
sA = matchCase(sA, this.caseSensitive);
|
||||||
|
|
||||||
let occurence;
|
let occurence;
|
||||||
let dtType = this.hasColDateType ?
|
let dtType = this.hasColDateType ?
|
||||||
|
@ -1253,7 +1254,7 @@ export class TableFilter {
|
||||||
}
|
}
|
||||||
// searched keyword with * operator doesn't have to be a date
|
// searched keyword with * operator doesn't have to be a date
|
||||||
else if (re_lk.test(sA)) {// like date
|
else if (re_lk.test(sA)) {// like date
|
||||||
occurence = Str.contains(sA.replace(re_lk, ''), cellData,
|
occurence = contains(sA.replace(re_lk, ''), cellData,
|
||||||
false, this.caseSensitive);
|
false, this.caseSensitive);
|
||||||
}
|
}
|
||||||
else if (DateHelper.isValid(sA, dtType)) {
|
else if (DateHelper.isValid(sA, dtType)) {
|
||||||
|
@ -1262,13 +1263,13 @@ export class TableFilter {
|
||||||
}
|
}
|
||||||
//empty
|
//empty
|
||||||
else if (hasEM) {
|
else if (hasEM) {
|
||||||
occurence = Str.isEmpty(cellData);
|
occurence = isEmptyString(cellData);
|
||||||
}
|
}
|
||||||
//non-empty
|
//non-empty
|
||||||
else if (hasNM) {
|
else if (hasNM) {
|
||||||
occurence = !Str.isEmpty(cellData);
|
occurence = !isEmptyString(cellData);
|
||||||
} else {
|
} else {
|
||||||
occurence = Str.contains(sA, cellData, this.isExactMatch(j),
|
occurence = contains(sA, cellData, this.isExactMatch(j),
|
||||||
this.caseSensitive);
|
this.caseSensitive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1313,17 +1314,17 @@ export class TableFilter {
|
||||||
}
|
}
|
||||||
//different
|
//different
|
||||||
else if (hasDF) {
|
else if (hasDF) {
|
||||||
occurence = Str.contains(sA.replace(re_d, ''), cellData,
|
occurence = contains(sA.replace(re_d, ''), cellData,
|
||||||
false, this.caseSensitive) ? false : true;
|
false, this.caseSensitive) ? false : true;
|
||||||
}
|
}
|
||||||
//like
|
//like
|
||||||
else if (hasLK) {
|
else if (hasLK) {
|
||||||
occurence = Str.contains(sA.replace(re_lk, ''), cellData,
|
occurence = contains(sA.replace(re_lk, ''), cellData,
|
||||||
false, this.caseSensitive);
|
false, this.caseSensitive);
|
||||||
}
|
}
|
||||||
//equal
|
//equal
|
||||||
else if (hasEQ) {
|
else if (hasEQ) {
|
||||||
occurence = Str.contains(sA.replace(re_eq, ''), cellData,
|
occurence = contains(sA.replace(re_eq, ''), cellData,
|
||||||
true, this.caseSensitive);
|
true, this.caseSensitive);
|
||||||
}
|
}
|
||||||
//starts with
|
//starts with
|
||||||
|
@ -1342,11 +1343,11 @@ export class TableFilter {
|
||||||
}
|
}
|
||||||
//empty
|
//empty
|
||||||
else if (hasEM) {
|
else if (hasEM) {
|
||||||
occurence = Str.isEmpty(cellData);
|
occurence = isEmptyString(cellData);
|
||||||
}
|
}
|
||||||
//non-empty
|
//non-empty
|
||||||
else if (hasNM) {
|
else if (hasNM) {
|
||||||
occurence = !Str.isEmpty(cellData);
|
occurence = !isEmptyString(cellData);
|
||||||
}
|
}
|
||||||
//regexp
|
//regexp
|
||||||
else if (hasRE) {
|
else if (hasRE) {
|
||||||
|
@ -1366,12 +1367,12 @@ export class TableFilter {
|
||||||
this.colNbFormat[j] && !this.singleSearchFlt) {
|
this.colNbFormat[j] && !this.singleSearchFlt) {
|
||||||
sA = removeNbFormat(sA, nbFormat);
|
sA = removeNbFormat(sA, nbFormat);
|
||||||
occurence = numCellData === sA ||
|
occurence = numCellData === sA ||
|
||||||
Str.contains(sA.toString(), numCellData.toString(),
|
contains(sA.toString(), numCellData.toString(),
|
||||||
this.isExactMatch(j), this.caseSensitive);
|
this.isExactMatch(j), this.caseSensitive);
|
||||||
} else {
|
} else {
|
||||||
// Finally test search term is contained in cell data
|
// Finally test search term is contained in cell data
|
||||||
occurence = Str.contains(sA, cellData,
|
occurence = contains(sA, cellData, this.isExactMatch(j),
|
||||||
this.isExactMatch(j), this.caseSensitive);
|
this.caseSensitive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1405,7 +1406,7 @@ export class TableFilter {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let cellData = Str.matchCase(this.getCellData(cells[j]),
|
let cellData = matchCase(this.getCellData(cells[j]),
|
||||||
this.caseSensitive);
|
this.caseSensitive);
|
||||||
|
|
||||||
//multiple search parameter operator ||
|
//multiple search parameter operator ||
|
||||||
|
@ -1429,7 +1430,7 @@ export class TableFilter {
|
||||||
}
|
}
|
||||||
// TODO: improve clarity/readability of this block
|
// TODO: improve clarity/readability of this block
|
||||||
for (let w = 0, len = s.length; w < len; w++) {
|
for (let w = 0, len = s.length; w < len; w++) {
|
||||||
cS = Str.trim(s[w]);
|
cS = trim(s[w]);
|
||||||
occur = hasArg.call(this, cS, cellData, j);
|
occur = hasArg.call(this, cS, cellData, j);
|
||||||
highlight.call(this, cS, occur, cells[j]);
|
highlight.call(this, cS, occur, cells[j]);
|
||||||
if ((hasMultiOrSA && occur) ||
|
if ((hasMultiOrSA && occur) ||
|
||||||
|
@ -1445,7 +1446,7 @@ export class TableFilter {
|
||||||
}
|
}
|
||||||
//single search parameter
|
//single search parameter
|
||||||
else {
|
else {
|
||||||
occurence[j] = hasArg.call(this, Str.trim(sA), cellData, j);
|
occurence[j] = hasArg.call(this, trim(sA), cellData, j);
|
||||||
highlight.call(this, sA, occurence[j], cells[j]);
|
highlight.call(this, sA, occurence[j], cells[j]);
|
||||||
}//else single param
|
}//else single param
|
||||||
|
|
||||||
|
@ -1584,7 +1585,7 @@ export class TableFilter {
|
||||||
if (isArray(fltValue)) {
|
if (isArray(fltValue)) {
|
||||||
searchArgs.push(fltValue);
|
searchArgs.push(fltValue);
|
||||||
} else {
|
} else {
|
||||||
searchArgs.push(Str.trim(fltValue));
|
searchArgs.push(trim(fltValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return searchArgs;
|
return searchArgs;
|
||||||
|
@ -1618,7 +1619,7 @@ export class TableFilter {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
for (let i = 0, len = this.fltIds.length; i < len; i++) {
|
for (let i = 0, len = this.fltIds.length; i < len; i++) {
|
||||||
let fltType = this.getFilterType(i);
|
let fltType = this.getFilterType(i);
|
||||||
if (fltType === Str.lower(type)) {
|
if (fltType === type.toLowerCase()) {
|
||||||
let a = bool ? i : this.fltIds[i];
|
let a = bool ? i : this.fltIds[i];
|
||||||
arr.push(a);
|
arr.push(a);
|
||||||
}
|
}
|
||||||
|
@ -1883,7 +1884,7 @@ export class TableFilter {
|
||||||
if (isArray(query)) {
|
if (isArray(query)) {
|
||||||
values = query;
|
values = query;
|
||||||
} else {
|
} else {
|
||||||
query = Str.matchCase(query, this.caseSensitive);
|
query = matchCase(query, this.caseSensitive);
|
||||||
values = query.split(' ' + this.orOperator + ' ');
|
values = query.split(' ' + this.orOperator + ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2134,7 +2135,7 @@ export class TableFilter {
|
||||||
file,
|
file,
|
||||||
head = Dom.tag(doc, 'head')[0];
|
head = Dom.tag(doc, 'head')[0];
|
||||||
|
|
||||||
if (Str.lower(ftype) === 'link') {
|
if (ftype.toLowerCase() === 'link') {
|
||||||
file = Dom.create('link',
|
file = Dom.create('link',
|
||||||
['id', fileId], ['type', 'text/css'],
|
['id', fileId], ['type', 'text/css'],
|
||||||
['rel', 'stylesheet'], ['href', filePath]
|
['rel', 'stylesheet'], ['href', filePath]
|
||||||
|
@ -2293,7 +2294,7 @@ export class TableFilter {
|
||||||
*/
|
*/
|
||||||
getFilterType(colIndex) {
|
getFilterType(colIndex) {
|
||||||
let colType = this.cfg['col_' + colIndex];
|
let colType = this.cfg['col_' + colIndex];
|
||||||
return !colType ? INPUT : Str.lower(colType);
|
return !colType ? INPUT : colType.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue