@netgrif/components-core 6.0.3 → 6.0.4-rc.1
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/bundles/netgrif-components-core.umd.js +69 -18
- package/bundles/netgrif-components-core.umd.js.map +1 -1
- package/bundles/netgrif-components-core.umd.min.js +1 -1
- package/bundles/netgrif-components-core.umd.min.js.map +1 -1
- package/esm2015/lib/resources/engine-endpoint/public/public-task-resource.service.js +1 -1
- package/esm2015/lib/search/models/category/case/case-dataset.js +3 -6
- package/esm2015/lib/search/models/category/case/case-simple-dataset.js +3 -3
- package/esm2015/lib/search/models/category/case/case-title.js +13 -3
- package/esm2015/lib/search/models/category/case/case-visual-id.js +13 -3
- package/esm2015/lib/search/models/category/category.js +10 -2
- package/esm2015/lib/search/models/operator/substring.js +3 -3
- package/esm2015/lib/search/search-keyword-resolver-service/search-index-resolver.service.js +18 -3
- package/esm2015/lib/search/search-service/search.service.js +3 -2
- package/esm5/lib/resources/engine-endpoint/public/public-task-resource.service.js +1 -1
- package/esm5/lib/search/models/category/case/case-dataset.js +3 -6
- package/esm5/lib/search/models/category/case/case-simple-dataset.js +3 -3
- package/esm5/lib/search/models/category/case/case-title.js +19 -4
- package/esm5/lib/search/models/category/case/case-visual-id.js +19 -4
- package/esm5/lib/search/models/category/category.js +10 -2
- package/esm5/lib/search/models/operator/substring.js +3 -3
- package/esm5/lib/search/search-keyword-resolver-service/search-index-resolver.service.js +17 -2
- package/esm5/lib/search/search-service/search.service.js +3 -2
- package/fesm2015/netgrif-components-core.js +58 -17
- package/fesm2015/netgrif-components-core.js.map +1 -1
- package/fesm5/netgrif-components-core.js +69 -18
- package/fesm5/netgrif-components-core.js.map +1 -1
- package/lib/search/models/category/case/case-dataset.d.ts +0 -2
- package/lib/search/models/category/case/case-title.d.ts +4 -1
- package/lib/search/models/category/case/case-visual-id.d.ts +4 -1
- package/lib/search/models/category/category.d.ts +7 -0
- package/lib/search/search-keyword-resolver-service/search-index-resolver.service.d.ts +12 -0
- package/netgrif-components-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -9726,8 +9726,8 @@
|
|
|
9726
9726
|
// TODO IMPROVEMENT 27.4.2020 - we could use regular expressions to search for substrings which would solve the unintuitive
|
|
9727
9727
|
// behavior that occurs when we search for strings that contain spaces. We need to escape the input string in a special way
|
|
9728
9728
|
// if we choose to do this
|
|
9729
|
-
var escapedValue = Operator.escapeInput(args[0]).value;
|
|
9730
|
-
return Operator.forEachKeyword(elasticKeywords, function (keyword) { return new Query("(" + keyword + "
|
|
9729
|
+
var escapedValue = Operator.escapeInput(args[0]).value.replace(' ', '\\ ');
|
|
9730
|
+
return Operator.forEachKeyword(elasticKeywords, function (keyword) { return new Query("(" + keyword + ":*" + escapedValue + "*)"); });
|
|
9731
9731
|
};
|
|
9732
9732
|
Substring.prototype.getOperatorNameTemplate = function () {
|
|
9733
9733
|
return ['search.operator.substring', Operator.INPUT_PLACEHOLDER];
|
|
@@ -10029,6 +10029,7 @@
|
|
|
10029
10029
|
*/
|
|
10030
10030
|
var SearchIndexResolverService = /** @class */ (function () {
|
|
10031
10031
|
function SearchIndexResolverService() {
|
|
10032
|
+
this.KEYWORD = '.keyword';
|
|
10032
10033
|
}
|
|
10033
10034
|
/**
|
|
10034
10035
|
* Constructs the index name for the specified field.
|
|
@@ -10043,7 +10044,21 @@
|
|
|
10043
10044
|
*/
|
|
10044
10045
|
SearchIndexResolverService.prototype.getIndex = function (dataFieldIdentifier, index, keyword) {
|
|
10045
10046
|
if (keyword === void 0) { keyword = false; }
|
|
10046
|
-
return "dataSet." + dataFieldIdentifier + "." + index + (keyword ?
|
|
10047
|
+
return "dataSet." + dataFieldIdentifier + "." + index + (keyword ? this.KEYWORD : '');
|
|
10048
|
+
};
|
|
10049
|
+
/**
|
|
10050
|
+
* Constructs the index name for the specified core field.
|
|
10051
|
+
*
|
|
10052
|
+
* Note that almost all combinations are valid and will not throw an error when used to query the database, but not all combinations are
|
|
10053
|
+
* used by the application engine. The {@link SearchIndex} class has some information about which field types map to which indices, but
|
|
10054
|
+
* you should consult the backend documentation for more reliable information.
|
|
10055
|
+
* @param index the queried index
|
|
10056
|
+
* @param keyword whether the keyword of a TEXT index should be queried
|
|
10057
|
+
* @returns the full name of the specified index
|
|
10058
|
+
*/
|
|
10059
|
+
SearchIndexResolverService.prototype.getCoreIndex = function (index, keyword) {
|
|
10060
|
+
if (keyword === void 0) { keyword = false; }
|
|
10061
|
+
return "" + index + (keyword ? this.KEYWORD : '');
|
|
10047
10062
|
};
|
|
10048
10063
|
SearchIndexResolverService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function SearchIndexResolverService_Factory() { return new SearchIndexResolverService(); }, token: SearchIndexResolverService, providedIn: "root" });
|
|
10049
10064
|
SearchIndexResolverService.decorators = [
|
|
@@ -10538,7 +10553,7 @@
|
|
|
10538
10553
|
if (!this.isOperatorSelected()) {
|
|
10539
10554
|
throw new Error('Category cannot generate a Query if no Operator is selected');
|
|
10540
10555
|
}
|
|
10541
|
-
return this._operatorFormControl.value.createQuery(this.
|
|
10556
|
+
return this._operatorFormControl.value.createQuery(this.elasticKeywords, userInput);
|
|
10542
10557
|
};
|
|
10543
10558
|
/**
|
|
10544
10559
|
* Calls the [generateQuery]{@link Category#generateQuery} method and creates an {@link ElementaryPredicate} with the result.
|
|
@@ -10839,6 +10854,14 @@
|
|
|
10839
10854
|
}
|
|
10840
10855
|
return { segment: segment, bold: true };
|
|
10841
10856
|
};
|
|
10857
|
+
/**
|
|
10858
|
+
* Checks for selected operator
|
|
10859
|
+
* @param operatorClass the operator to be checked
|
|
10860
|
+
* @return boolean of the statement
|
|
10861
|
+
*/
|
|
10862
|
+
Category.prototype.isSelectedOperator = function (operatorClass) {
|
|
10863
|
+
return this.selectedOperator === this._operatorService.getOperator(operatorClass);
|
|
10864
|
+
};
|
|
10842
10865
|
/**
|
|
10843
10866
|
* The {@link CategoryMetadataConfiguration} key for this Category's {@link Operator}
|
|
10844
10867
|
*/
|
|
@@ -11691,12 +11714,12 @@
|
|
|
11691
11714
|
return resolver.getIndex(datafield.fieldId, exports.SearchIndex.BOOLEAN);
|
|
11692
11715
|
case 'file':
|
|
11693
11716
|
case 'fileList':
|
|
11694
|
-
return resolver.getIndex(datafield.fieldId, exports.SearchIndex.FILE_NAME, this.isSelectedOperator(Equals) || this.isSelectedOperator(NotEquals));
|
|
11717
|
+
return resolver.getIndex(datafield.fieldId, exports.SearchIndex.FILE_NAME, this.isSelectedOperator(Equals) || this.isSelectedOperator(NotEquals) || this.isSelectedOperator(Substring));
|
|
11695
11718
|
case 'user':
|
|
11696
11719
|
case 'userList':
|
|
11697
11720
|
return resolver.getIndex(datafield.fieldId, exports.SearchIndex.USER_ID);
|
|
11698
11721
|
default:
|
|
11699
|
-
return resolver.getIndex(datafield.fieldId, exports.SearchIndex.FULLTEXT, this.isSelectedOperator(Equals) || this.isSelectedOperator(NotEquals));
|
|
11722
|
+
return resolver.getIndex(datafield.fieldId, exports.SearchIndex.FULLTEXT, this.isSelectedOperator(Equals) || this.isSelectedOperator(NotEquals) || this.isSelectedOperator(Substring));
|
|
11700
11723
|
}
|
|
11701
11724
|
};
|
|
11702
11725
|
Object.defineProperty(CaseDataset.prototype, "inputPlaceholder", {
|
|
@@ -11844,9 +11867,6 @@
|
|
|
11844
11867
|
}
|
|
11845
11868
|
return value;
|
|
11846
11869
|
};
|
|
11847
|
-
CaseDataset.prototype.isSelectedOperator = function (operatorClass) {
|
|
11848
|
-
return this.selectedOperator === this._operatorService.getOperator(operatorClass);
|
|
11849
|
-
};
|
|
11850
11870
|
CaseDataset.prototype.serializeClass = function () {
|
|
11851
11871
|
return exports.Categories.CASE_DATASET;
|
|
11852
11872
|
};
|
|
@@ -12067,14 +12087,14 @@
|
|
|
12067
12087
|
break;
|
|
12068
12088
|
case 'file':
|
|
12069
12089
|
case 'fileList':
|
|
12070
|
-
this._elasticKeyword = resolver.getIndex(this._fieldId, exports.SearchIndex.FILE_NAME);
|
|
12090
|
+
this._elasticKeyword = resolver.getIndex(this._fieldId, exports.SearchIndex.FILE_NAME, this.isSelectedOperator(Substring));
|
|
12071
12091
|
break;
|
|
12072
12092
|
case 'user':
|
|
12073
12093
|
case 'userList':
|
|
12074
12094
|
this._elasticKeyword = resolver.getIndex(this._fieldId, exports.SearchIndex.USER_ID);
|
|
12075
12095
|
break;
|
|
12076
12096
|
default:
|
|
12077
|
-
this._elasticKeyword = resolver.getIndex(this._fieldId, exports.SearchIndex.FULLTEXT);
|
|
12097
|
+
this._elasticKeyword = resolver.getIndex(this._fieldId, exports.SearchIndex.FULLTEXT, this.isSelectedOperator(Substring));
|
|
12078
12098
|
}
|
|
12079
12099
|
};
|
|
12080
12100
|
Object.defineProperty(CaseSimpleDataset.prototype, "elasticKeywords", {
|
|
@@ -12179,13 +12199,15 @@
|
|
|
12179
12199
|
|
|
12180
12200
|
var CaseTitle = /** @class */ (function (_super) {
|
|
12181
12201
|
__extends(CaseTitle, _super);
|
|
12182
|
-
function CaseTitle(operators, logger) {
|
|
12183
|
-
|
|
12202
|
+
function CaseTitle(operators, logger, _optionalDependencies) {
|
|
12203
|
+
var _this = _super.call(this, [exports.CaseSearch.TITLE], [
|
|
12184
12204
|
operators.getOperator(Substring),
|
|
12185
12205
|
operators.getOperator(Equals),
|
|
12186
12206
|
operators.getOperator(NotEquals),
|
|
12187
12207
|
operators.getOperator(Like)
|
|
12188
12208
|
], CaseTitle._i18n + ".name", exports.SearchInputType.TEXT, logger, operators) || this;
|
|
12209
|
+
_this._optionalDependencies = _optionalDependencies;
|
|
12210
|
+
return _this;
|
|
12189
12211
|
}
|
|
12190
12212
|
Object.defineProperty(CaseTitle.prototype, "inputPlaceholder", {
|
|
12191
12213
|
get: function () {
|
|
@@ -12195,19 +12217,34 @@
|
|
|
12195
12217
|
configurable: true
|
|
12196
12218
|
});
|
|
12197
12219
|
CaseTitle.prototype.duplicate = function () {
|
|
12198
|
-
return new CaseTitle(this._operatorService, this._log);
|
|
12220
|
+
return new CaseTitle(this._operatorService, this._log, this._optionalDependencies);
|
|
12199
12221
|
};
|
|
12200
12222
|
CaseTitle.prototype.serializeClass = function () {
|
|
12201
12223
|
return exports.Categories.CASE_TITLE;
|
|
12202
12224
|
};
|
|
12225
|
+
Object.defineProperty(CaseTitle.prototype, "elasticKeywords", {
|
|
12226
|
+
get: function () {
|
|
12227
|
+
if (!!this._optionalDependencies) {
|
|
12228
|
+
var resolver = this._optionalDependencies.searchIndexResolver;
|
|
12229
|
+
return [resolver.getCoreIndex(exports.CaseSearch.TITLE, this.isSelectedOperator(Substring))];
|
|
12230
|
+
}
|
|
12231
|
+
else {
|
|
12232
|
+
return this._elasticKeywords;
|
|
12233
|
+
}
|
|
12234
|
+
},
|
|
12235
|
+
enumerable: false,
|
|
12236
|
+
configurable: true
|
|
12237
|
+
});
|
|
12203
12238
|
CaseTitle._i18n = 'search.category.case.title';
|
|
12204
12239
|
return CaseTitle;
|
|
12205
12240
|
}(NoConfigurationCategory));
|
|
12206
12241
|
|
|
12207
12242
|
var CaseVisualId = /** @class */ (function (_super) {
|
|
12208
12243
|
__extends(CaseVisualId, _super);
|
|
12209
|
-
function CaseVisualId(operators, logger) {
|
|
12210
|
-
|
|
12244
|
+
function CaseVisualId(operators, logger, _optionalDependencies) {
|
|
12245
|
+
var _this = _super.call(this, [exports.CaseSearch.VISUAL_ID], [operators.getOperator(Substring), operators.getOperator(Equals), operators.getOperator(NotEquals)], CaseVisualId._i18n + ".name", exports.SearchInputType.TEXT, logger, operators) || this;
|
|
12246
|
+
_this._optionalDependencies = _optionalDependencies;
|
|
12247
|
+
return _this;
|
|
12211
12248
|
}
|
|
12212
12249
|
Object.defineProperty(CaseVisualId.prototype, "inputPlaceholder", {
|
|
12213
12250
|
get: function () {
|
|
@@ -12217,11 +12254,24 @@
|
|
|
12217
12254
|
configurable: true
|
|
12218
12255
|
});
|
|
12219
12256
|
CaseVisualId.prototype.duplicate = function () {
|
|
12220
|
-
return new CaseVisualId(this._operatorService, this._log);
|
|
12257
|
+
return new CaseVisualId(this._operatorService, this._log, this._optionalDependencies);
|
|
12221
12258
|
};
|
|
12222
12259
|
CaseVisualId.prototype.serializeClass = function () {
|
|
12223
12260
|
return exports.Categories.CASE_VISUAL_ID;
|
|
12224
12261
|
};
|
|
12262
|
+
Object.defineProperty(CaseVisualId.prototype, "elasticKeywords", {
|
|
12263
|
+
get: function () {
|
|
12264
|
+
if (!!this._optionalDependencies) {
|
|
12265
|
+
var resolver = this._optionalDependencies.searchIndexResolver;
|
|
12266
|
+
return [resolver.getCoreIndex(exports.CaseSearch.VISUAL_ID, this.isSelectedOperator(Substring))];
|
|
12267
|
+
}
|
|
12268
|
+
else {
|
|
12269
|
+
return this._elasticKeywords;
|
|
12270
|
+
}
|
|
12271
|
+
},
|
|
12272
|
+
enumerable: false,
|
|
12273
|
+
configurable: true
|
|
12274
|
+
});
|
|
12225
12275
|
CaseVisualId._i18n = 'search.category.case.visualId';
|
|
12226
12276
|
return CaseVisualId;
|
|
12227
12277
|
}(NoConfigurationCategory));
|
|
@@ -13646,7 +13696,8 @@
|
|
|
13646
13696
|
* @param searchedSubstring value that should be searched on all full text fields
|
|
13647
13697
|
*/
|
|
13648
13698
|
SearchService.prototype.setFullTextFilter = function (searchedSubstring) {
|
|
13649
|
-
|
|
13699
|
+
var whiteSpacedSubstring = searchedSubstring.replace(' ', '\\ ');
|
|
13700
|
+
this._fullTextFilter = new SimpleFilter('', this._baseFilter.type, { fullText: whiteSpacedSubstring });
|
|
13650
13701
|
this.updateActiveFilter();
|
|
13651
13702
|
};
|
|
13652
13703
|
/**
|