1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-09 09:22:28 +02:00

Compare commits

...

10 commits

Author SHA1 Message Date
koalyptus 7afe45f1e6
Merge pull request #787 from koalyptus/dependabot/npm_and_yarn/codecov-3.7.1
Bump codecov from 3.7.0 to 3.7.1
2020-07-22 19:51:17 +10:00
koalyptus 6e01e45dfb prepare dist 2020-07-22 19:45:07 +10:00
dependabot[bot] 12c30629af
Bump codecov from 3.7.0 to 3.7.1
Bumps [codecov](https://github.com/codecov/codecov-node) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/codecov/codecov-node/releases)
- [Commits](https://github.com/codecov/codecov-node/compare/v3.7.0...v3.7.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-21 12:35:35 +00:00
koalyptus 3e763efac9
Merge pull request #784 from koalyptus/769-refine-empty-cell-logic
769 refine empty nonempty operators logic
2020-06-16 13:03:27 +10:00
koalyptus 825b915ae8 769 refine empty nonempty operators logic 2020-06-16 12:28:12 +10:00
koalyptus 8e48bf2943
Merge pull request #783 from koalyptus/greenkeeper/monorepo.babel7-20200526215451
Update babel7 to the latest version 🚀
2020-06-15 15:20:26 +10:00
koalyptus be7a5e585f prepare dist for 0.7.1 2020-06-15 15:19:11 +10:00
greenkeeper[bot] c44bef22a2
chore(package): update lockfile package-lock.json 2020-05-26 23:57:32 +00:00
greenkeeper[bot] 6dcebbf67e
chore(package): update @babel/preset-env to version 7.10.0 2020-05-26 23:57:28 +00:00
greenkeeper[bot] 44cb6f9124
chore(package): update @babel/core to version 7.10.0 2020-05-26 23:57:25 +00:00
9 changed files with 586 additions and 1035 deletions

View file

@ -14,7 +14,7 @@
"keyword-spacing": ["error", { "after": true, "before": true }],
"max-depth": [2, 7],
"max-statements": [2, 133],
"complexity": [2, 42],
"complexity": [2, 45],
"no-unused-vars": 2,
"no-eval": 2,
"no-underscore-dangle": 0,

4
dist/starter.html vendored
View file

@ -1,10 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>tablefilter v0.7.0 - Starter</title>
<title>tablefilter v0.7.3 - Starter</title>
</head>
<body>
<h1>tablefilter v0.7.0</h1>
<h1>tablefilter v0.7.3</h1>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1584
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "tablefilter",
"version": "0.7.0",
"version": "0.7.3",
"description": "A Javascript library making HTML tables filterable and a bit more",
"license": "MIT",
"author": {
@ -40,13 +40,13 @@
"tag": "next"
},
"devDependencies": {
"@babel/core": "7.9.6",
"@babel/preset-env": "7.9.6",
"@babel/core": "7.10.0",
"@babel/preset-env": "7.10.0",
"babel-eslint": "10.1.0",
"babel-loader": "^8.0.2",
"babel-preset-env": "1.7.0",
"clean-webpack-plugin": "^3.0.0",
"codecov": "3.6.5",
"codecov": "3.7.1",
"diacritics": "1.3.0",
"esdoc": "1.1.0",
"esdoc-standard-plugin": "1.0.0",

View file

@ -1785,11 +1785,11 @@ export class TableFilter {
}
//empty
else if (hasEM) {
occurence = !cell.hasChildNodes();
occurence = !cell.hasChildNodes() || isEmpty(cellValue);
}
//non-empty
else if (hasNM) {
occurence = cell.hasChildNodes();
occurence = cell.hasChildNodes() && !isEmpty(cellValue);
} else {
occurence = contains(term, cellValue,
this.isExactMatch(colIdx), this.caseSensitive);
@ -1875,11 +1875,11 @@ export class TableFilter {
}
//empty
else if (hasEM) {
occurence = !cell.hasChildNodes();
occurence = !cell.hasChildNodes() || isEmpty(cellValue);
}
//non-empty
else if (hasNM) {
occurence = cell.hasChildNodes();
occurence = cell.hasChildNodes() && !isEmpty(cellValue);
} else {
// If numeric type data, perform a strict equality test and
// fallback to unformatted number string comparison

View file

@ -72,7 +72,14 @@
tf.clearFilters();
tf.setFilterValue(4, '[empty]');
tf.filter();
deepEqual(tf.getValidRows().length, 0, 'No matches expected');
var filteredData = tf.getFilteredData();
deepEqual(tf.getValidRows().length, 1, 'Expected match');
deepEqual(
filteredData[0],
[6, ['Adelaide', 'Perth', '2781', '3.1', '']],
'Expected row data'
);
});
test('Non-empty operator - [nonempty]', function() {
@ -96,7 +103,7 @@
tf.setFilterValue(4, '[nonempty]');
tf.filter();
deepEqual(tf.getValidRows().length, 7, 'Expected number of matches');
deepEqual(tf.getValidRows().length, 6, 'Expected number of matches');
});
test('Or operator - ||', function() {