@senior-gestao-pessoas/hcm-entity-lookups 5.3.2 → 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/bundles/senior-gestao-pessoas-hcm-entity-lookups.umd.js +69 -37
- package/bundles/senior-gestao-pessoas-hcm-entity-lookups.umd.js.map +1 -1
- package/bundles/senior-gestao-pessoas-hcm-entity-lookups.umd.min.js +1 -1
- package/bundles/senior-gestao-pessoas-hcm-entity-lookups.umd.min.js.map +1 -1
- package/esm2015/lookups/employment-relationship-lookup/employment-relationship-lookup.component.js +3 -3
- package/esm2015/lookups/employment-relationship-lookup/employment-relationship-lookup.service.js +68 -36
- package/esm5/lookups/employment-relationship-lookup/employment-relationship-lookup.component.js +3 -3
- package/esm5/lookups/employment-relationship-lookup/employment-relationship-lookup.service.js +68 -36
- package/fesm2015/senior-gestao-pessoas-hcm-entity-lookups.js +69 -37
- package/fesm2015/senior-gestao-pessoas-hcm-entity-lookups.js.map +1 -1
- package/fesm5/senior-gestao-pessoas-hcm-entity-lookups.js +69 -37
- package/fesm5/senior-gestao-pessoas-hcm-entity-lookups.js.map +1 -1
- package/lookups/employment-relationship-lookup/employment-relationship-lookup.service.d.ts +3 -5
- package/package.json +1 -1
- package/senior-gestao-pessoas-hcm-entity-lookups.metadata.json +1 -1
|
@@ -4821,16 +4821,48 @@
|
|
|
4821
4821
|
this.translate = translate;
|
|
4822
4822
|
this.configService = configService;
|
|
4823
4823
|
this.employmentRelationshipService = employmentRelationshipService;
|
|
4824
|
-
this.employmentRelationshipLookupDisplayFields = ["code", "name"];
|
|
4825
|
-
this.employmentRelationshipLookupSeparator = " - ";
|
|
4826
|
-
this.employmentRelationshipSearchSubject = new rxjs.Subject();
|
|
4827
|
-
this.employmentRelationshipLookupSubject = new rxjs.Subject();
|
|
4828
4824
|
this.ngUnsubscribe = new rxjs.Subject();
|
|
4825
|
+
this.lookupServiceConfig = {
|
|
4826
|
+
lookupDisplayFields: ["code", "name"],
|
|
4827
|
+
lookupSeparator: " - ",
|
|
4828
|
+
searchSubject: new rxjs.Subject(),
|
|
4829
|
+
lookupSubject: new rxjs.Subject(),
|
|
4830
|
+
entityName: "employmentRelationship",
|
|
4831
|
+
dynamicFormOptions: {
|
|
4832
|
+
cancelLabel: this.translate.instant(this.configService.getTranslationPrefix() + ".cancel"),
|
|
4833
|
+
clearLabel: this.translate.instant(this.configService.getTranslationPrefix() + ".clear"),
|
|
4834
|
+
dataKey: "id",
|
|
4835
|
+
emptyFieldLabel: this.translate.instant(this.configService.getTranslationPrefix() + ".list_grid_empty_field"),
|
|
4836
|
+
emptyMessage: this.translate.instant(this.configService.getTranslationPrefix() + ".empty_message_field"),
|
|
4837
|
+
filterLabel: this.translate.instant(this.configService.getTranslationPrefix() + ".filter"),
|
|
4838
|
+
filterTitle: this.translate.instant(this.configService.getTranslationPrefix() + ".filters"),
|
|
4839
|
+
label: this.translate.instant(this.configService.getTranslationPrefix() + ".employment_relationship_label"),
|
|
4840
|
+
lookupDisplayField: "label",
|
|
4841
|
+
multiple: false,
|
|
4842
|
+
name: "employmentRelationship",
|
|
4843
|
+
recordLabel: this.translate.instant(this.configService.getTranslationPrefix() + ".records_found"),
|
|
4844
|
+
recordsLabel: this.translate.instant(this.configService.getTranslationPrefix() + ".records_found"),
|
|
4845
|
+
required: true,
|
|
4846
|
+
searchEmptyTitle: this.translate.instant(this.configService.getTranslationPrefix() + ".nothing_found"),
|
|
4847
|
+
searchFields: this.getEmploymentRelationshipSearchFields(),
|
|
4848
|
+
searchGridFields: this.getEmploymentRelationshipSearchFields(),
|
|
4849
|
+
searchTitle: this.translate.instant(this.configService.getTranslationPrefix() + ".employment_relationship_history_employment_relationship_search_title"),
|
|
4850
|
+
selectLabel: this.translate.instant(this.configService.getTranslationPrefix() + ".select"),
|
|
4851
|
+
visible: true,
|
|
4852
|
+
isCollective: false,
|
|
4853
|
+
},
|
|
4854
|
+
filters: {
|
|
4855
|
+
additionalFilter: undefined,
|
|
4856
|
+
initialFilter: undefined,
|
|
4857
|
+
companyIds: [],
|
|
4858
|
+
},
|
|
4859
|
+
};
|
|
4829
4860
|
}
|
|
4830
4861
|
EmploymentRelationshipLookupService.prototype.updateSuggestions = function (value) {
|
|
4862
|
+
var _a, _b;
|
|
4831
4863
|
if (value.employmentRelationship) {
|
|
4832
|
-
value.employmentRelationship.label = this.getSuggestionValue(["code", "name"],
|
|
4833
|
-
if (value.employmentRelationship.label.trim() === this.
|
|
4864
|
+
value.employmentRelationship.label = this.getSuggestionValue(["code", "name"], (_a = this.lookupServiceConfig) === null || _a === void 0 ? void 0 : _a.entityName, value, (_b = this.lookupServiceConfig) === null || _b === void 0 ? void 0 : _b.lookupSeparator);
|
|
4865
|
+
if (value.employmentRelationship.label.trim() === this.lookupServiceConfig.lookupSeparator.trim()) {
|
|
4834
4866
|
delete value.employmentRelationship.label;
|
|
4835
4867
|
}
|
|
4836
4868
|
}
|
|
@@ -4846,37 +4878,37 @@
|
|
|
4846
4878
|
EmploymentRelationshipLookupService.prototype.getFormField = function (isCollective, additionalFilter, initialFilter) {
|
|
4847
4879
|
var _this = this;
|
|
4848
4880
|
return new angularComponents.FormField({
|
|
4849
|
-
cancelLabel: this.
|
|
4850
|
-
clearLabel: this.
|
|
4881
|
+
cancelLabel: this.lookupServiceConfig.dynamicFormOptions.cancelLabel,
|
|
4882
|
+
clearLabel: this.lookupServiceConfig.dynamicFormOptions.clearLabel,
|
|
4851
4883
|
dataKey: "id",
|
|
4852
|
-
emptyFieldLabel: this.
|
|
4853
|
-
emptyMessage: this.
|
|
4854
|
-
filterLabel: this.
|
|
4855
|
-
filterTitle: this.
|
|
4856
|
-
label: this.
|
|
4857
|
-
lookupDisplayField:
|
|
4858
|
-
multiple:
|
|
4859
|
-
name:
|
|
4884
|
+
emptyFieldLabel: this.lookupServiceConfig.dynamicFormOptions.emptyFieldLabel,
|
|
4885
|
+
emptyMessage: this.lookupServiceConfig.dynamicFormOptions.emptyMessage,
|
|
4886
|
+
filterLabel: this.lookupServiceConfig.dynamicFormOptions.filterLabel,
|
|
4887
|
+
filterTitle: this.lookupServiceConfig.dynamicFormOptions.filterTitle,
|
|
4888
|
+
label: this.lookupServiceConfig.dynamicFormOptions.label,
|
|
4889
|
+
lookupDisplayField: this.lookupServiceConfig.dynamicFormOptions.lookupDisplayField,
|
|
4890
|
+
multiple: this.lookupServiceConfig.dynamicFormOptions.multiple,
|
|
4891
|
+
name: this.lookupServiceConfig.dynamicFormOptions.name,
|
|
4860
4892
|
onLookupRequest: function (value) { return _this.onEmploymentRelationshipLookupRequest(value, additionalFilter, initialFilter); },
|
|
4861
4893
|
onSearchRequest: function (event) { return _this.onEmploymentRelationshipSearchRequest(event, additionalFilter, initialFilter); },
|
|
4862
|
-
recordLabel: this.
|
|
4863
|
-
recordsLabel: this.
|
|
4894
|
+
recordLabel: this.lookupServiceConfig.dynamicFormOptions.recordLabel,
|
|
4895
|
+
recordsLabel: this.lookupServiceConfig.dynamicFormOptions.recordsLabel,
|
|
4864
4896
|
required: function () { return true; },
|
|
4865
|
-
searchEmptyTitle: this.
|
|
4866
|
-
searchFields: this.
|
|
4867
|
-
searchGridFields: this.
|
|
4868
|
-
searchObservable: this.
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4897
|
+
searchEmptyTitle: this.lookupServiceConfig.dynamicFormOptions.searchEmptyTitle,
|
|
4898
|
+
searchFields: this.lookupServiceConfig.dynamicFormOptions.searchFields,
|
|
4899
|
+
searchGridFields: this.lookupServiceConfig.dynamicFormOptions.searchGridFields,
|
|
4900
|
+
searchObservable: this.lookupServiceConfig.searchSubject,
|
|
4901
|
+
suggestionsObservable: this.lookupServiceConfig.lookupSubject,
|
|
4902
|
+
searchTitle: this.lookupServiceConfig.dynamicFormOptions.searchTitle,
|
|
4903
|
+
selectLabel: this.lookupServiceConfig.dynamicFormOptions.selectLabel,
|
|
4872
4904
|
type: angularComponents.FieldType.Lookup,
|
|
4873
|
-
visible:
|
|
4905
|
+
visible: this.lookupServiceConfig.dynamicFormOptions.visible,
|
|
4874
4906
|
});
|
|
4875
4907
|
};
|
|
4876
4908
|
EmploymentRelationshipLookupService.prototype.onEmploymentRelationshipSearchRequest = function (event, additionalFilter, initialFilter) {
|
|
4877
4909
|
var _this = this;
|
|
4878
4910
|
this.onEmploymentRelationshipSearchRequestObservable(event, additionalFilter, initialFilter, true)
|
|
4879
|
-
.subscribe(function (data) { return _this.
|
|
4911
|
+
.subscribe(function (data) { return _this.lookupServiceConfig.searchSubject.next(data); });
|
|
4880
4912
|
};
|
|
4881
4913
|
EmploymentRelationshipLookupService.prototype.onEmploymentRelationshipSearchRequestObservable = function (event, additionalFilter, initialFilter, isDynamicForm) {
|
|
4882
4914
|
var _this = this;
|
|
@@ -4886,7 +4918,7 @@
|
|
|
4886
4918
|
var sort = multiSortMeta;
|
|
4887
4919
|
var employmentRelationshipFilterQuery = createSearchRequestFilter(filterData, this.getEmploymentRelationshipSearchFields());
|
|
4888
4920
|
employmentRelationshipFilterQuery = getFilterForLookup(employmentRelationshipFilterQuery, additionalFilter, initialFilter);
|
|
4889
|
-
var displayFields = mergeUnique(this.
|
|
4921
|
+
var displayFields = mergeUnique(this.lookupServiceConfig.lookupDisplayFields, __spread(this.lookupServiceConfig.lookupDisplayFields));
|
|
4890
4922
|
return this.employmentRelationshipService
|
|
4891
4923
|
.list({ page: page, sort: sort, filterQuery: employmentRelationshipFilterQuery, displayFields: displayFields })
|
|
4892
4924
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
@@ -4908,7 +4940,7 @@
|
|
|
4908
4940
|
};
|
|
4909
4941
|
EmploymentRelationshipLookupService.prototype.getLabelForMaping = function (item) {
|
|
4910
4942
|
var _this = this;
|
|
4911
|
-
return this.
|
|
4943
|
+
return this.lookupServiceConfig.lookupDisplayFields
|
|
4912
4944
|
.map(function (field) {
|
|
4913
4945
|
if (field === "name" && !item.name) {
|
|
4914
4946
|
item.name = _this.translate
|
|
@@ -4919,24 +4951,24 @@
|
|
|
4919
4951
|
}
|
|
4920
4952
|
return item[field];
|
|
4921
4953
|
})
|
|
4922
|
-
.join(this.
|
|
4954
|
+
.join(this.lookupServiceConfig.lookupSeparator);
|
|
4923
4955
|
};
|
|
4924
4956
|
EmploymentRelationshipLookupService.prototype.onEmploymentRelationshipLookupRequest = function (value, additionalFilter, initialFilter) {
|
|
4925
4957
|
var _this = this;
|
|
4926
4958
|
this.onEmploymentRelationshipLookupRequestObservable(value, additionalFilter, initialFilter)
|
|
4927
|
-
.subscribe(function (data) { return _this.
|
|
4959
|
+
.subscribe(function (data) { return _this.lookupServiceConfig.lookupSubject.next(data.contents); });
|
|
4928
4960
|
};
|
|
4929
4961
|
EmploymentRelationshipLookupService.prototype.onEmploymentRelationshipLookupRequestObservable = function (value, additionalFilter, initialFilter) {
|
|
4930
4962
|
var _this = this;
|
|
4931
|
-
var sort = this.
|
|
4963
|
+
var sort = this.lookupServiceConfig.lookupDisplayFields
|
|
4932
4964
|
.map(function (field) { return ({ field: field, order: 1 }); });
|
|
4933
4965
|
var workshiftfilterQuery = createLookupRequestFilter(value, this.getEmploymentRelationshipSearchFields());
|
|
4934
4966
|
workshiftfilterQuery = getFilterForLookup(workshiftfilterQuery, additionalFilter, initialFilter);
|
|
4935
|
-
var displayFields = mergeUnique(this.
|
|
4967
|
+
var displayFields = mergeUnique(this.lookupServiceConfig.lookupDisplayFields, __spread(this.lookupServiceConfig.lookupDisplayFields));
|
|
4936
4968
|
return this.employmentRelationshipService
|
|
4937
4969
|
.list({ sort: sort, filterQuery: workshiftfilterQuery, displayFields: displayFields })
|
|
4938
4970
|
.pipe(operators.takeUntil(this.ngUnsubscribe))
|
|
4939
|
-
.pipe(operators.map(function (list) { return (__assign(__assign({}, list), { contents: list.contents.map(function (item) { return (__assign(__assign({}, item), { label: _this.
|
|
4971
|
+
.pipe(operators.map(function (list) { return (__assign(__assign({}, list), { contents: list.contents.map(function (item) { return (__assign(__assign({}, item), { label: _this.lookupServiceConfig.lookupDisplayFields
|
|
4940
4972
|
.map(function (field) {
|
|
4941
4973
|
if (field === "name" && !item.name) {
|
|
4942
4974
|
item.name = _this.translate
|
|
@@ -4946,7 +4978,7 @@
|
|
|
4946
4978
|
return getProp(item, field);
|
|
4947
4979
|
}
|
|
4948
4980
|
return item[field];
|
|
4949
|
-
}).join(_this.
|
|
4981
|
+
}).join(_this.lookupServiceConfig.lookupSeparator) })); }) })); }));
|
|
4950
4982
|
};
|
|
4951
4983
|
EmploymentRelationshipLookupService.prototype.getEmploymentRelationshipSearchFields = function () {
|
|
4952
4984
|
return [
|
|
@@ -4990,8 +5022,8 @@
|
|
|
4990
5022
|
return _this;
|
|
4991
5023
|
}
|
|
4992
5024
|
EmploymentRelationshipLookupComponent.prototype.ngOnInit = function () {
|
|
4993
|
-
this.employmentRelationshipSearchFields = this.employmentRelationshipLookupService.
|
|
4994
|
-
this.employmentRelationshipSearchGridFields = this.employmentRelationshipLookupService.
|
|
5025
|
+
this.employmentRelationshipSearchFields = this.employmentRelationshipLookupService.lookupServiceConfig.dynamicFormOptions.searchFields;
|
|
5026
|
+
this.employmentRelationshipSearchGridFields = this.employmentRelationshipLookupService.lookupServiceConfig.dynamicFormOptions.searchFields;
|
|
4995
5027
|
};
|
|
4996
5028
|
EmploymentRelationshipLookupComponent.prototype.onEmploymentRelationshipLookupRequest = function (value) {
|
|
4997
5029
|
var _this = this;
|