1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-29 12:04:06 +02:00

Compare commits

...

5 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
7 changed files with 35 additions and 34 deletions

View file

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

4
dist/starter.html vendored
View file

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

File diff suppressed because one or more lines are too long

38
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "tablefilter", "name": "tablefilter",
"version": "0.7.1", "version": "0.7.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -54,7 +54,7 @@
"integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/highlight": "^7.8.3" "@babel/highlight": "7.9.0"
} }
}, },
"@babel/generator": { "@babel/generator": {
@ -75,9 +75,9 @@
"integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/helper-validator-identifier": "^7.9.0", "@babel/helper-validator-identifier": "7.9.5",
"chalk": "^2.0.0", "chalk": "2.4.2",
"js-tokens": "^4.0.0" "js-tokens": "4.0.0"
} }
}, },
"@babel/parser": { "@babel/parser": {
@ -131,7 +131,7 @@
"integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==",
"dev": true, "dev": true,
"requires": { "requires": {
"safe-buffer": "~5.1.1" "safe-buffer": "5.1.2"
} }
} }
} }
@ -1609,9 +1609,9 @@
"dev": true "dev": true
}, },
"agent-base": { "agent-base": {
"version": "6.0.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz",
"integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==", "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==",
"dev": true, "dev": true,
"requires": { "requires": {
"debug": "4.1.1" "debug": "4.1.1"
@ -3352,9 +3352,9 @@
"dev": true "dev": true
}, },
"codecov": { "codecov": {
"version": "3.7.0", "version": "3.7.1",
"resolved": "https://registry.npmjs.org/codecov/-/codecov-3.7.0.tgz", "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.7.1.tgz",
"integrity": "sha512-uIixKofG099NbUDyzRk1HdGtaG8O+PBUAg3wfmjwXw2+ek+PZp+puRvbTohqrVfuudaezivJHFgTtSC3M8MXww==", "integrity": "sha512-JHWxyPTkMLLJn9SmKJnwAnvY09kg2Os2+Ux+GG7LwZ9g8gzDDISpIN5wAsH1UBaafA/yGcd3KofMaorE8qd6Lw==",
"dev": true, "dev": true,
"requires": { "requires": {
"argv": "0.0.2", "argv": "0.0.2",
@ -5601,7 +5601,6 @@
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "1.0.0", "balanced-match": "1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -5626,8 +5625,7 @@
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -5744,8 +5742,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -5771,7 +5768,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "1.1.11" "brace-expansion": "1.1.11"
} }
@ -5779,8 +5775,7 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
@ -5804,7 +5799,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -6882,7 +6876,7 @@
"dev": true, "dev": true,
"requires": { "requires": {
"@tootallnate/once": "1.1.2", "@tootallnate/once": "1.1.2",
"agent-base": "6.0.0", "agent-base": "6.0.1",
"debug": "4.1.1" "debug": "4.1.1"
} }
}, },

View file

@ -1,6 +1,6 @@
{ {
"name": "tablefilter", "name": "tablefilter",
"version": "0.7.1", "version": "0.7.3",
"description": "A Javascript library making HTML tables filterable and a bit more", "description": "A Javascript library making HTML tables filterable and a bit more",
"license": "MIT", "license": "MIT",
"author": { "author": {
@ -46,7 +46,7 @@
"babel-loader": "^8.0.2", "babel-loader": "^8.0.2",
"babel-preset-env": "1.7.0", "babel-preset-env": "1.7.0",
"clean-webpack-plugin": "^3.0.0", "clean-webpack-plugin": "^3.0.0",
"codecov": "3.7.0", "codecov": "3.7.1",
"diacritics": "1.3.0", "diacritics": "1.3.0",
"esdoc": "1.1.0", "esdoc": "1.1.0",
"esdoc-standard-plugin": "1.0.0", "esdoc-standard-plugin": "1.0.0",

View file

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

View file

@ -72,7 +72,14 @@
tf.clearFilters(); tf.clearFilters();
tf.setFilterValue(4, '[empty]'); tf.setFilterValue(4, '[empty]');
tf.filter(); 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() { test('Non-empty operator - [nonempty]', function() {
@ -96,7 +103,7 @@
tf.setFilterValue(4, '[nonempty]'); tf.setFilterValue(4, '[nonempty]');
tf.filter(); tf.filter();
deepEqual(tf.getValidRows().length, 7, 'Expected number of matches'); deepEqual(tf.getValidRows().length, 6, 'Expected number of matches');
}); });
test('Or operator - ||', function() { test('Or operator - ||', function() {