@senior-gestao-pessoas/payroll-core 9.8.0 → 9.9.0
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-payroll-core.umd.js +87 -49
- package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
- package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +1 -1
- package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
- package/components/input-rest-auto-complete/input-rest-auto-complete.component.d.ts +2 -0
- package/esm2015/components/input-rest-auto-complete/input-rest-auto-complete.component.js +87 -50
- package/esm5/components/input-rest-auto-complete/input-rest-auto-complete.component.js +88 -50
- package/fesm2015/senior-gestao-pessoas-payroll-core.js +86 -49
- package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
- package/fesm5/senior-gestao-pessoas-payroll-core.js +87 -49
- package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
- package/package.json +1 -1
- package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
|
@@ -3037,62 +3037,97 @@
|
|
|
3037
3037
|
InputRestAutoCompleteComponent.prototype.filterQuery = function (event) {
|
|
3038
3038
|
var _this = this;
|
|
3039
3039
|
var query = event.query;
|
|
3040
|
-
if (!(isNaN(query) && query.toString().length < this.minCharactersToSearch)) {
|
|
3040
|
+
if (!(Number.isNaN(query) && query.toString().length < this.minCharactersToSearch)) {
|
|
3041
3041
|
try {
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
referenceDate: this.referenceDate,
|
|
3047
|
-
})
|
|
3048
|
-
.subscribe(function (payload) { return _this.formaterResponce(payload.result); });
|
|
3049
|
-
}
|
|
3050
|
-
else if (this.isDismissalReason) {
|
|
3051
|
-
var params = { valueSearch: query };
|
|
3052
|
-
if (this.referenceDate) {
|
|
3053
|
-
params['referenceDate'] = this.referenceDate;
|
|
3054
|
-
}
|
|
3055
|
-
return this.service
|
|
3056
|
-
.query('autocompleteDismissalReason', params, exports.ServiceType.GENERAL_REGISTER)
|
|
3057
|
-
.subscribe(function (payload) { return _this.formaterResponce(payload.result); });
|
|
3058
|
-
}
|
|
3059
|
-
else if (this.usingType && this.usingType.length) {
|
|
3060
|
-
return this.service
|
|
3061
|
-
.query('autocompleteOtherCompanyFilterUsingType', {
|
|
3062
|
-
searchText: query,
|
|
3063
|
-
usingType: this.usingType,
|
|
3064
|
-
})
|
|
3065
|
-
.subscribe(function (payload) { return _this.formaterResponce(payload.result); });
|
|
3066
|
-
}
|
|
3067
|
-
else if (this.isDepartmentFromCompany) {
|
|
3068
|
-
return this.service
|
|
3069
|
-
.query('autocompleteDepartmentQuery', {
|
|
3070
|
-
searchText: query,
|
|
3071
|
-
companyId: this.companyId,
|
|
3072
|
-
referenceDate: this.referenceDate,
|
|
3073
|
-
})
|
|
3074
|
-
.subscribe(function (payload) { return _this.formaterResponce(payload.result); });
|
|
3075
|
-
}
|
|
3076
|
-
else if (this.isSituationDefinition) {
|
|
3077
|
-
var params = { searchText: query };
|
|
3078
|
-
return this.service
|
|
3079
|
-
.query('autocompleteSituationDefinitionQuery', params, exports.ServiceType.ORGANIZATION_REGISTER)
|
|
3080
|
-
.subscribe(function (payload) { return _this.formaterResponce(payload.result); });
|
|
3081
|
-
}
|
|
3082
|
-
else if (this.isWagetype) {
|
|
3083
|
-
var params = { searchText: query, companyId: this.companyId };
|
|
3084
|
-
return this.service
|
|
3085
|
-
.query('autocompleteWagetypeQuery', params, exports.ServiceType.ENTRY)
|
|
3086
|
-
.subscribe(function (payload) { return _this.formaterResponce(payload.result); });
|
|
3087
|
-
}
|
|
3088
|
-
this.service
|
|
3089
|
-
.query('autocomplete', this.getParamsRest(query), this.serviceType).subscribe(function (payload) { return _this.formaterResponce(payload.result); });
|
|
3042
|
+
var queryConfig = this.getQueryConfiguration(query);
|
|
3043
|
+
return this.service
|
|
3044
|
+
.query(queryConfig.endpoint, queryConfig.params, queryConfig.serviceType)
|
|
3045
|
+
.subscribe(function (payload) { return _this.formaterResponce(payload.result); });
|
|
3090
3046
|
}
|
|
3091
3047
|
catch (e) {
|
|
3092
3048
|
console.log(e);
|
|
3093
3049
|
}
|
|
3094
3050
|
}
|
|
3095
3051
|
};
|
|
3052
|
+
InputRestAutoCompleteComponent.prototype.getQueryConfiguration = function (query) {
|
|
3053
|
+
var _this = this;
|
|
3054
|
+
var queryStrategies = [
|
|
3055
|
+
{
|
|
3056
|
+
condition: function () { return _this.isTimetrackingSituation; },
|
|
3057
|
+
endpoint: 'autocompleteTimetrackingSituation',
|
|
3058
|
+
params: function () { return ({
|
|
3059
|
+
valueSearch: query,
|
|
3060
|
+
referenceDate: _this.referenceDate,
|
|
3061
|
+
}); },
|
|
3062
|
+
serviceType: this.serviceType,
|
|
3063
|
+
},
|
|
3064
|
+
{
|
|
3065
|
+
condition: function () { return _this.isDismissalReason; },
|
|
3066
|
+
endpoint: 'autocompleteDismissalReason',
|
|
3067
|
+
params: function () {
|
|
3068
|
+
var params = { valueSearch: query };
|
|
3069
|
+
if (_this.referenceDate) {
|
|
3070
|
+
params['referenceDate'] = _this.referenceDate;
|
|
3071
|
+
}
|
|
3072
|
+
return params;
|
|
3073
|
+
},
|
|
3074
|
+
serviceType: exports.ServiceType.GENERAL_REGISTER,
|
|
3075
|
+
},
|
|
3076
|
+
{
|
|
3077
|
+
condition: function () { return _this.usingType && _this.usingType.length; },
|
|
3078
|
+
endpoint: 'autocompleteOtherCompanyFilterUsingType',
|
|
3079
|
+
params: function () { return ({
|
|
3080
|
+
searchText: query,
|
|
3081
|
+
usingType: _this.usingType,
|
|
3082
|
+
}); },
|
|
3083
|
+
serviceType: this.serviceType,
|
|
3084
|
+
},
|
|
3085
|
+
{
|
|
3086
|
+
condition: function () { return _this.isDepartmentFromCompany; },
|
|
3087
|
+
endpoint: 'autocompleteDepartmentQuery',
|
|
3088
|
+
params: function () { return ({
|
|
3089
|
+
searchText: query,
|
|
3090
|
+
companyId: _this.companyId,
|
|
3091
|
+
referenceDate: _this.referenceDate,
|
|
3092
|
+
}); },
|
|
3093
|
+
serviceType: this.serviceType,
|
|
3094
|
+
},
|
|
3095
|
+
{
|
|
3096
|
+
condition: function () { return _this.isSituationDefinition; },
|
|
3097
|
+
endpoint: 'autocompleteSituationDefinitionQuery',
|
|
3098
|
+
params: function () { return ({ searchText: query }); },
|
|
3099
|
+
serviceType: exports.ServiceType.ORGANIZATION_REGISTER,
|
|
3100
|
+
},
|
|
3101
|
+
{
|
|
3102
|
+
condition: function () { return _this.isWagetype; },
|
|
3103
|
+
endpoint: 'autocompleteWagetypeQuery',
|
|
3104
|
+
params: function () { return ({
|
|
3105
|
+
searchText: query,
|
|
3106
|
+
companyId: _this.companyId,
|
|
3107
|
+
}); },
|
|
3108
|
+
serviceType: exports.ServiceType.ENTRY,
|
|
3109
|
+
},
|
|
3110
|
+
{
|
|
3111
|
+
condition: function () { return _this.isTransportationVoucherScaleGroup; },
|
|
3112
|
+
endpoint: 'autocompleteTransportationVoucherScaleGroupQuery',
|
|
3113
|
+
params: function () { return ({ searchText: query }); },
|
|
3114
|
+
serviceType: exports.ServiceType.GENERAL_REGISTER,
|
|
3115
|
+
},
|
|
3116
|
+
];
|
|
3117
|
+
var strategy = queryStrategies.find(function (s) { return s.condition(); });
|
|
3118
|
+
if (strategy) {
|
|
3119
|
+
return {
|
|
3120
|
+
endpoint: strategy.endpoint,
|
|
3121
|
+
params: strategy.params(),
|
|
3122
|
+
serviceType: strategy.serviceType,
|
|
3123
|
+
};
|
|
3124
|
+
}
|
|
3125
|
+
return {
|
|
3126
|
+
endpoint: 'autocomplete',
|
|
3127
|
+
params: this.getParamsRest(query),
|
|
3128
|
+
serviceType: this.serviceType,
|
|
3129
|
+
};
|
|
3130
|
+
};
|
|
3096
3131
|
InputRestAutoCompleteComponent.prototype.formaterResponce = function (result) {
|
|
3097
3132
|
var _this = this;
|
|
3098
3133
|
this.suggestions = [];
|
|
@@ -3316,6 +3351,9 @@
|
|
|
3316
3351
|
__decorate([
|
|
3317
3352
|
core.Input()
|
|
3318
3353
|
], InputRestAutoCompleteComponent.prototype, "multiple", void 0);
|
|
3354
|
+
__decorate([
|
|
3355
|
+
core.Input()
|
|
3356
|
+
], InputRestAutoCompleteComponent.prototype, "isTransportationVoucherScaleGroup", void 0);
|
|
3319
3357
|
__decorate([
|
|
3320
3358
|
core.Input()
|
|
3321
3359
|
], InputRestAutoCompleteComponent.prototype, "serviceType", void 0);
|