dbgate-datalib 5.3.1 → 5.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/GridDisplay.js +15 -14
- package/package.json +5 -5
package/lib/GridDisplay.js
CHANGED
|
@@ -135,27 +135,28 @@ class GridDisplay {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
if (this.baseTableOrView && this.config.multiColumnFilter) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
const orCondition = {
|
|
139
|
+
conditionType: 'or',
|
|
140
|
+
conditions: [],
|
|
141
|
+
};
|
|
142
|
+
for (const column of this.baseTableOrView.columns) {
|
|
143
|
+
try {
|
|
144
|
+
const condition = (0, dbgate_filterparser_1.parseFilter)(this.config.multiColumnFilter, (0, dbgate_filterparser_1.getFilterType)(column.dataType));
|
|
145
|
+
if (condition) {
|
|
146
146
|
orCondition.conditions.push(lodash_1.default.cloneDeepWith(condition, (expr) => {
|
|
147
147
|
if (expr.exprType == 'placeholder') {
|
|
148
148
|
return this.createColumnExpression(column, { alias: 'basetbl' });
|
|
149
149
|
}
|
|
150
150
|
}));
|
|
151
151
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
// skip for this column
|
|
155
|
+
continue;
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
if (orCondition.conditions.length > 0) {
|
|
159
|
+
conditions.push(orCondition);
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
if (conditions.length > 0) {
|
|
@@ -336,7 +337,7 @@ class GridDisplay {
|
|
|
336
337
|
return lodash_1.default.compact(lodash_1.default.values(this.config.filters)).length;
|
|
337
338
|
}
|
|
338
339
|
clearFilters() {
|
|
339
|
-
this.setConfig(cfg => (Object.assign(Object.assign({}, cfg), { filters: {} })));
|
|
340
|
+
this.setConfig(cfg => (Object.assign(Object.assign({}, cfg), { filters: {}, multiColumnFilter: null })));
|
|
340
341
|
this.reload();
|
|
341
342
|
}
|
|
342
343
|
resetConfig() {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.3.
|
|
2
|
+
"version": "5.3.3",
|
|
3
3
|
"name": "dbgate-datalib",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"typings": "lib/index.d.ts",
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"lib"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"dbgate-sqltree": "^5.3.
|
|
17
|
-
"dbgate-tools": "^5.3.
|
|
18
|
-
"dbgate-filterparser": "^5.3.
|
|
16
|
+
"dbgate-sqltree": "^5.3.3",
|
|
17
|
+
"dbgate-tools": "^5.3.3",
|
|
18
|
+
"dbgate-filterparser": "^5.3.3"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"dbgate-types": "^5.3.
|
|
21
|
+
"dbgate-types": "^5.3.3",
|
|
22
22
|
"@types/node": "^13.7.0",
|
|
23
23
|
"jest": "^28.1.3",
|
|
24
24
|
"ts-jest": "^28.0.7",
|