@senior-gestao-pessoas/hcm-advanced-filter-general 1.1.2 → 1.2.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-hcm-advanced-filter-general.umd.js +176 -45
- package/bundles/senior-gestao-pessoas-hcm-advanced-filter-general.umd.js.map +1 -1
- package/bundles/senior-gestao-pessoas-hcm-advanced-filter-general.umd.min.js +2 -2
- package/bundles/senior-gestao-pessoas-hcm-advanced-filter-general.umd.min.js.map +1 -1
- package/core/interfaces/advanced-filter-fields.d.ts +4 -0
- package/esm2015/core/interfaces/advanced-filter-fields.js +1 -1
- package/esm2015/lib/advanced-filter/advanced-filter-dto-converter.js +36 -5
- package/esm2015/lib/advanced-filter/advanced-filter.component.js +44 -26
- package/esm2015/lib/advanced-filter-fields/advanced-filter-fields.component.js +99 -20
- package/esm5/core/interfaces/advanced-filter-fields.js +1 -1
- package/esm5/lib/advanced-filter/advanced-filter-dto-converter.js +37 -5
- package/esm5/lib/advanced-filter/advanced-filter.component.js +45 -26
- package/esm5/lib/advanced-filter-fields/advanced-filter-fields.component.js +101 -21
- package/fesm2015/senior-gestao-pessoas-hcm-advanced-filter-general.js +174 -46
- package/fesm2015/senior-gestao-pessoas-hcm-advanced-filter-general.js.map +1 -1
- package/fesm5/senior-gestao-pessoas-hcm-advanced-filter-general.js +178 -47
- package/fesm5/senior-gestao-pessoas-hcm-advanced-filter-general.js.map +1 -1
- package/lib/advanced-filter/advanced-filter-dto-converter.d.ts +1 -0
- package/lib/advanced-filter/advanced-filter.component.d.ts +7 -7
- package/lib/advanced-filter-fields/advanced-filter-fields.component.d.ts +37 -4
- package/package.json +1 -1
- package/senior-gestao-pessoas-hcm-advanced-filter-general.metadata.json +1 -1
- package/styles.scss +1 -10
|
@@ -596,13 +596,13 @@
|
|
|
596
596
|
}
|
|
597
597
|
|
|
598
598
|
var AdvancedFilterFieldsComponent = /** @class */ (function () {
|
|
599
|
-
function AdvancedFilterFieldsComponent(formBuilder, translate, configTranslateService,
|
|
599
|
+
function AdvancedFilterFieldsComponent(formBuilder, translate, configTranslateService, cd) {
|
|
600
600
|
this.formBuilder = formBuilder;
|
|
601
601
|
this.translate = translate;
|
|
602
602
|
this.configTranslateService = configTranslateService;
|
|
603
|
-
this.employeeLookupService = employeeLookupService;
|
|
604
603
|
this.cd = cd;
|
|
605
604
|
this.updateFormGroup = new core.EventEmitter();
|
|
605
|
+
this.disabledAction = new core.EventEmitter();
|
|
606
606
|
this.fieldListAdvancedFilter = [];
|
|
607
607
|
this.formFields = [];
|
|
608
608
|
this.conditionType = [
|
|
@@ -644,14 +644,92 @@
|
|
|
644
644
|
var key = this.fieldListAdvancedFilter.length;
|
|
645
645
|
this.fieldListAdvancedFilter.push(field);
|
|
646
646
|
this.formFields[key] = this.getFormFieldByIndex(key);
|
|
647
|
+
this.groupAndSortFilters();
|
|
647
648
|
}
|
|
648
649
|
},
|
|
649
650
|
enumerable: true,
|
|
650
651
|
configurable: true
|
|
651
652
|
});
|
|
653
|
+
AdvancedFilterFieldsComponent.prototype.addFilterInGroup = function (filter) {
|
|
654
|
+
this.addFilterFields = filter;
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
*
|
|
658
|
+
* Agrupamento dos filtros
|
|
659
|
+
*
|
|
660
|
+
*/
|
|
661
|
+
/**
|
|
662
|
+
* Agrupa e ordena os filtros.
|
|
663
|
+
* Atualiza os arrays de formulários com os filtros ordenados.
|
|
664
|
+
*/
|
|
665
|
+
AdvancedFilterFieldsComponent.prototype.groupAndSortFilters = function () {
|
|
666
|
+
var groupedFilters = this.groupFilters();
|
|
667
|
+
var sortedFilters = this.sortFilters(groupedFilters);
|
|
668
|
+
this.updateFormArrays(sortedFilters);
|
|
669
|
+
};
|
|
670
|
+
/**
|
|
671
|
+
* Agrupa os filtros avançados por entityName.
|
|
672
|
+
* @returns Um objeto onde as chaves são entityNames e os valores são arrays de filtros e seus índices.
|
|
673
|
+
*/
|
|
674
|
+
AdvancedFilterFieldsComponent.prototype.groupFilters = function () {
|
|
675
|
+
return this.fieldListAdvancedFilter.reduce(function (groupFilters, filter, index) {
|
|
676
|
+
if ((filter === null || filter === void 0 ? void 0 : filter.entityName) && !groupFilters[filter.entityName]) {
|
|
677
|
+
groupFilters[filter === null || filter === void 0 ? void 0 : filter.entityName] = [];
|
|
678
|
+
}
|
|
679
|
+
groupFilters[filter.entityName].push({ filter: filter, index: index });
|
|
680
|
+
return groupFilters;
|
|
681
|
+
}, {});
|
|
682
|
+
};
|
|
683
|
+
/**
|
|
684
|
+
* Ordena os filtros agrupados.
|
|
685
|
+
* @param groupedFilters filtros agrupados por entityName.
|
|
686
|
+
* @returns Um array dos filtros ordenados.
|
|
687
|
+
*/
|
|
688
|
+
AdvancedFilterFieldsComponent.prototype.sortFilters = function (groupedFilters) {
|
|
689
|
+
return Object.keys(groupedFilters)
|
|
690
|
+
.sort(function (filterA, filterB) { return (filterA === "COMPANY" ? -1 : filterB === "COMPANY" ? 1 : 0); })
|
|
691
|
+
.reduce(function (sortedFilters, key) {
|
|
692
|
+
sortedFilters.push.apply(sortedFilters, __spread(groupedFilters[key]));
|
|
693
|
+
return sortedFilters;
|
|
694
|
+
}, []);
|
|
695
|
+
};
|
|
696
|
+
/**
|
|
697
|
+
* Atualiza os arrays de formulários com os filtros ordenados.
|
|
698
|
+
* @param sortedFilters filtros ordenados.
|
|
699
|
+
*/
|
|
700
|
+
AdvancedFilterFieldsComponent.prototype.updateFormArrays = function (sortedFilters) {
|
|
701
|
+
var _this = this;
|
|
702
|
+
var sortedFieldList = sortedFilters.map(function (item) { return item.filter; });
|
|
703
|
+
var sortedFormGroups = sortedFilters.map(function (item) { return _this.getFormGroupByIndex(item.index); });
|
|
704
|
+
var sortedFormFields = sortedFilters.map(function (item) { return _this.formFields[item.index]; });
|
|
705
|
+
this.fieldListAdvancedFilter = sortedFieldList;
|
|
706
|
+
this.formFields = sortedFormFields;
|
|
707
|
+
var formArray = this.getListFiltersForm;
|
|
708
|
+
formArray.clear();
|
|
709
|
+
sortedFormGroups.forEach(function (formGroup) { return formArray.push(formGroup); });
|
|
710
|
+
};
|
|
711
|
+
/**
|
|
712
|
+
*
|
|
713
|
+
* Fim dos métodos de agrupamento.
|
|
714
|
+
*
|
|
715
|
+
*/
|
|
716
|
+
AdvancedFilterFieldsComponent.prototype.isLastElementOfGroup = function (index) {
|
|
717
|
+
var _a, _b;
|
|
718
|
+
var currentEntity = (_a = this.fieldListAdvancedFilter[index]) === null || _a === void 0 ? void 0 : _a.entityName;
|
|
719
|
+
var nextEntity = (_b = this.fieldListAdvancedFilter[index + 1]) === null || _b === void 0 ? void 0 : _b.entityName;
|
|
720
|
+
return currentEntity !== nextEntity;
|
|
721
|
+
};
|
|
722
|
+
AdvancedFilterFieldsComponent.prototype.isFirstElementOfGroup = function (index) {
|
|
723
|
+
var _a, _b;
|
|
724
|
+
var currentEntity = (_a = this.fieldListAdvancedFilter[index]) === null || _a === void 0 ? void 0 : _a.entityName;
|
|
725
|
+
var nextEntity = (_b = this.fieldListAdvancedFilter[index - 1]) === null || _b === void 0 ? void 0 : _b.entityName;
|
|
726
|
+
return currentEntity !== nextEntity;
|
|
727
|
+
};
|
|
652
728
|
AdvancedFilterFieldsComponent.prototype.getConditionType = function (index) {
|
|
653
|
-
|
|
654
|
-
|
|
729
|
+
var _a, _b, _c;
|
|
730
|
+
if (((_a = this.fieldListAdvancedFilter[index]) === null || _a === void 0 ? void 0 : _a.entityName) !== FilterFieldType.SALARY_TYPE
|
|
731
|
+
&& ((_b = this.fieldListAdvancedFilter[index]) === null || _b === void 0 ? void 0 : _b.entityName) !== FilterFieldType.TIME_SHIFT_TYPE
|
|
732
|
+
&& ((_c = this.fieldListAdvancedFilter[index]) === null || _c === void 0 ? void 0 : _c.entityName) !== FilterFieldType.COST_CENTER) {
|
|
655
733
|
return this.conditionType;
|
|
656
734
|
}
|
|
657
735
|
else {
|
|
@@ -670,7 +748,6 @@
|
|
|
670
748
|
field.multiple = true;
|
|
671
749
|
}
|
|
672
750
|
if (this.fieldListAdvancedFilter[index].filterFormFields) {
|
|
673
|
-
this.setCodeAndNameInEmployee(field);
|
|
674
751
|
field.searchFields = this.fieldListAdvancedFilter[index].filterFormFields;
|
|
675
752
|
field.searchGridFields = this.fieldListAdvancedFilter[index].filterFormFields;
|
|
676
753
|
}
|
|
@@ -693,10 +770,15 @@
|
|
|
693
770
|
}
|
|
694
771
|
};
|
|
695
772
|
AdvancedFilterFieldsComponent.prototype.deleteItem = function (index) {
|
|
696
|
-
var _a;
|
|
773
|
+
var _a, _b;
|
|
774
|
+
var entityName = (_a = this.fieldListAdvancedFilter[index]) === null || _a === void 0 ? void 0 : _a.entityName;
|
|
697
775
|
this.fieldListAdvancedFilter.splice(index, 1);
|
|
698
776
|
this.formFields.splice(index, 1);
|
|
699
|
-
(
|
|
777
|
+
(_b = this.getListFiltersForm) === null || _b === void 0 ? void 0 : _b.controls.splice(index, 1);
|
|
778
|
+
if (this.fieldListAdvancedFilter.filter(function (item) { return (item === null || item === void 0 ? void 0 : item.entityName) === entityName; }).length === 0) {
|
|
779
|
+
this.disabledAction.emit(entityName);
|
|
780
|
+
}
|
|
781
|
+
this.groupAndSortFilters();
|
|
700
782
|
};
|
|
701
783
|
AdvancedFilterFieldsComponent.prototype.getFormFieldByIndex = function (index) {
|
|
702
784
|
var _a, _b;
|
|
@@ -726,7 +808,8 @@
|
|
|
726
808
|
};
|
|
727
809
|
AdvancedFilterFieldsComponent.prototype.divisionIsVisible = function (index) {
|
|
728
810
|
var _a, _b, _c, _d;
|
|
729
|
-
return !!(((_b = (_a = this.getListFiltersForm) === null || _a === void 0 ? void 0 : _a.controls) === null || _b === void 0 ? void 0 : _b.length) && (index + 1) !== ((_d = (_c = this.getListFiltersForm) === null || _c === void 0 ? void 0 : _c.controls) === null || _d === void 0 ? void 0 : _d.length))
|
|
811
|
+
return !!(((_b = (_a = this.getListFiltersForm) === null || _a === void 0 ? void 0 : _a.controls) === null || _b === void 0 ? void 0 : _b.length) && (index + 1) !== ((_d = (_c = this.getListFiltersForm) === null || _c === void 0 ? void 0 : _c.controls) === null || _d === void 0 ? void 0 : _d.length))
|
|
812
|
+
&& this.isLastElementOfGroup(index);
|
|
730
813
|
};
|
|
731
814
|
AdvancedFilterFieldsComponent.prototype.getValueCondition = function (index) {
|
|
732
815
|
var _a;
|
|
@@ -746,7 +829,7 @@
|
|
|
746
829
|
equals: new forms.FormControl({ value: "", disabled: true }),
|
|
747
830
|
startRange: new forms.FormControl({ value: "", disabled: true }),
|
|
748
831
|
endRange: new forms.FormControl({ value: "", disabled: true }),
|
|
749
|
-
conditionType: new forms.FormControl(),
|
|
832
|
+
conditionType: new forms.FormControl({}, forms.Validators.required),
|
|
750
833
|
name: new forms.FormControl({ value: field.entityName, disabled: false }),
|
|
751
834
|
label: new forms.FormControl({ value: field.label, disabled: false }),
|
|
752
835
|
id: new forms.FormControl({}),
|
|
@@ -764,11 +847,6 @@
|
|
|
764
847
|
var _a;
|
|
765
848
|
return (_a = this.getListFiltersForm) === null || _a === void 0 ? void 0 : _a.controls[index];
|
|
766
849
|
};
|
|
767
|
-
AdvancedFilterFieldsComponent.prototype.setCodeAndNameInEmployee = function (field) {
|
|
768
|
-
if ((field === null || field === void 0 ? void 0 : field.entityName) === FilterFieldType.EMPLOYEE) {
|
|
769
|
-
this.employeeLookupService.employeeLookupDisplayFields = ["code", "person.nomPes"];
|
|
770
|
-
}
|
|
771
|
-
};
|
|
772
850
|
Object.defineProperty(AdvancedFilterFieldsComponent.prototype, "getTranslateEndRangeError", {
|
|
773
851
|
/**
|
|
774
852
|
* Traduções
|
|
@@ -803,7 +881,6 @@
|
|
|
803
881
|
{ type: forms.FormBuilder },
|
|
804
882
|
{ type: core$1.TranslateService },
|
|
805
883
|
{ type: hcmEntityLookups.EntityLookupConfigService },
|
|
806
|
-
{ type: hcmEntityLookups.EmployeeLookupService },
|
|
807
884
|
{ type: core.ChangeDetectorRef }
|
|
808
885
|
]; };
|
|
809
886
|
__decorate([
|
|
@@ -812,6 +889,9 @@
|
|
|
812
889
|
__decorate([
|
|
813
890
|
core.Output()
|
|
814
891
|
], AdvancedFilterFieldsComponent.prototype, "updateFormGroup", void 0);
|
|
892
|
+
__decorate([
|
|
893
|
+
core.Output()
|
|
894
|
+
], AdvancedFilterFieldsComponent.prototype, "disabledAction", void 0);
|
|
815
895
|
__decorate([
|
|
816
896
|
core.Input()
|
|
817
897
|
], AdvancedFilterFieldsComponent.prototype, "listFilterFields", null);
|
|
@@ -821,8 +901,8 @@
|
|
|
821
901
|
AdvancedFilterFieldsComponent = __decorate([
|
|
822
902
|
core.Component({
|
|
823
903
|
selector: "fnd-advanced-filter-fields",
|
|
824
|
-
template: "<form [formGroup]=\"formGroup\">\n <div class=\"ui-fluid group-fields\" formArrayName=\"advancedFilterFields\">\n <div class=\"ui-fluid
|
|
825
|
-
styles: [".ui-lookup-entires-label{width:100%;margin-bottom:-.5em;font-family:\"Open Sans\",sans-serif;font-weight:400;font-size:14px;line-height:21px}.ui-lookup-entires-condition{margin-top:.5em;display:flex;align-items:center;justify-content:flex-start;width:15%}.ui-lookup-entires-condition .ui-dropdown{min-width:auto!important}.filter-division{text-align:center;margin:25px 0 5px}.filter-division hr{margin:16px 0 -11px;border:0;height:1px;background:#dedce5}.filter-division span{padding:2px 5px;font-size:12px;background:#dedce5}.ui-row-item{display:flex;width:100%;align-items:center}.ui-row-item .ui-row-entries
|
|
904
|
+
template: "<form [formGroup]=\"formGroup\">\n <div class=\"ui-fluid group-fields\" formArrayName=\"advancedFilterFields\">\n <div class=\"ui-fluid\" *ngFor=\"let filter of getListFiltersForm.controls; let i = index\">\n <div class=\"ui-g align-items-center\" [formGroupName]=\"i\">\n <div class=\"ui-lookup-entires-label\" *ngIf=\"isFirstElementOfGroup(i)\">\n <label>{{fieldListAdvancedFilter[i].label}}</label>\n </div>\n <div class=\"ui-row-item\">\n <p-dropdown class=\"ui-lookup-entires-condition\" inputId=\"conditionType\" name=\"conditionType\"\n [options]=\"getConditionType(i)\"\n [placeholder]=\"getPlaceholderCondition()\"\n (onChange)=\"onChangeCondition($event, i)\"\n formControlName=\"conditionType\">\n </p-dropdown>\n <div class=\"ui-row-entries\" *ngIf=\"getValueCondition(i) !== 'ENTRIES'\">\n <s-dynamic-form class=\"ui-lookup-equals\"\n [tooltipPosition]=\"'top'\"\n [pTooltip]=\"!getValueCondition(i) && getTooltipDisableField\"\n [errorMessages]=\"{\n required: getTranslateRequiredError\n }\"\n [fields]=\"formFields[i]?.equals\"\n [form]=\"getFormGroupByIndex(i)\">\n </s-dynamic-form>\n </div>\n <div class=\"ui-row-entries\" *ngIf=\"getValueCondition(i) == 'ENTRIES'\">\n <s-dynamic-form class=\"ui-lookup-entires\"\n [fields]=\"formFields[i]?.startRange\"\n [errorMessages]=\"{\n required: getTranslateRequiredError,\n endRangeIsBeforeInitialRange: getTranslateEndRangeError\n }\"\n [form]=\"getFormGroupByIndex(i)\">\n </s-dynamic-form>\n <div class=\"ui-lookup-entires-icon\">\n <i class=\"fa fa-lg fa-arrows-alt-h\"></i>\n </div>\n <s-dynamic-form class=\"ui-lookup-entires\"\n [fields]=\"formFields[i]?.endRange\"\n [errorMessages]=\"{\n required: getTranslateRequiredError,\n endRangeIsBeforeInitialRange: getTranslateEndRangeError\n }\"\n [form]=\"getFormGroupByIndex(i)\">\n </s-dynamic-form>\n </div>\n <div class=\"ui-row-actions\">\n <s-button\n class=\"btn-delete\"\n [iconClass]=\"'fa fa-solid fa-trash'\"\n (onClick)=\"deleteItem(i)\">\n </s-button>\n <s-button\n *ngIf=\"isLastElementOfGroup(i)\"\n iconClass=\"fa fa-plus\"\n priority=\"default\"\n (onClick)=\"addFilterInGroup(fieldListAdvancedFilter[i])\">\n </s-button>\n </div>\n </div>\n </div>\n <div class=\"filter-division\" *ngIf=\"divisionIsVisible(i)\">\n <hr/>\n <span>{{ getTranslateDivisionAdvancedFilter() }}</span>\n </div>\n </div>\n </div>\n</form>\n",
|
|
905
|
+
styles: [".ui-lookup-entires-label{width:100%;margin-bottom:-.5em;font-family:\"Open Sans\",sans-serif;font-weight:400;font-size:14px;line-height:21px}.ui-lookup-entires-condition{margin-top:.5em;display:flex;align-items:center;justify-content:flex-start;width:15%}.ui-lookup-entires-condition .ui-dropdown{min-width:auto!important}.filter-division{text-align:center;margin:25px 0 5px}.filter-division hr{margin:16px 0 -11px;border:0;height:1px;background:#dedce5}.filter-division span{padding:2px 5px;font-size:12px;background:#dedce5}.ui-row-item{display:flex;width:100%;align-items:center;padding-bottom:10px}.ui-row-item .ui-row-entries{padding:0;display:flex;margin-bottom:-.5em;width:75%;display:flex}.ui-row-item .ui-row-entries .ui-lookup-equals{width:100%}.ui-row-item .ui-row-entries .ui-lookup-entires{width:98%}.ui-row-item .ui-row-entries .ui-lookup-entires s-control-errors{position:absolute}.ui-row-item .ui-row-entries .ui-lookup-entires-icon{width:2%;display:flex;align-items:center;justify-content:center}.ui-row-item .ui-row-actions{display:flex;width:120px}.ui-row-item .ui-row-actions s-button{margin-top:7px}.group-fields{display:flex;flex-direction:column}@media screen and (max-width:820px){.ui-lookup-entires-condition,.ui-lookup-entires-label{padding:.5em}.ui-lookup-entires,.ui-lookup-entires-condition,.ui-lookup-entires-icon{width:100%}}"]
|
|
826
906
|
})
|
|
827
907
|
], AdvancedFilterFieldsComponent);
|
|
828
908
|
return AdvancedFilterFieldsComponent;
|
|
@@ -1046,6 +1126,7 @@
|
|
|
1046
1126
|
};
|
|
1047
1127
|
};
|
|
1048
1128
|
AdvancedFilterDtoConverter.convertFragments = function (fragments, translate) {
|
|
1129
|
+
var _this = this;
|
|
1049
1130
|
return fragments.map(function (fragment) {
|
|
1050
1131
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1051
1132
|
var dto = {
|
|
@@ -1058,27 +1139,58 @@
|
|
|
1058
1139
|
dto.startRange = {
|
|
1059
1140
|
id: (_b = (_a = fragment.dataBindings[0]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.id,
|
|
1060
1141
|
code: (_d = (_c = fragment.dataBindings[0]) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.code,
|
|
1061
|
-
label: (_f = (_e = fragment.dataBindings[0]) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.
|
|
1142
|
+
label: (_f = (_e = fragment.dataBindings[0]) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.code,
|
|
1062
1143
|
};
|
|
1063
1144
|
dto.endRange = {
|
|
1064
1145
|
id: (_h = (_g = fragment.dataBindings[1]) === null || _g === void 0 ? void 0 : _g.value) === null || _h === void 0 ? void 0 : _h.id,
|
|
1065
1146
|
code: (_k = (_j = fragment.dataBindings[1]) === null || _j === void 0 ? void 0 : _j.value) === null || _k === void 0 ? void 0 : _k.code,
|
|
1066
|
-
label: (_m = (_l = fragment.dataBindings[1]) === null || _l === void 0 ? void 0 : _l.value) === null || _m === void 0 ? void 0 : _m.
|
|
1147
|
+
label: (_m = (_l = fragment.dataBindings[1]) === null || _l === void 0 ? void 0 : _l.value) === null || _m === void 0 ? void 0 : _m.code,
|
|
1067
1148
|
};
|
|
1149
|
+
_this.convertCodeByERPX(dto.startRange, fragment.filter);
|
|
1150
|
+
_this.convertCodeByERPX(dto.endRange, fragment.filter);
|
|
1068
1151
|
}
|
|
1069
1152
|
else if (fragment.condition === "EQUALS") {
|
|
1070
1153
|
dto.equals = fragment.dataBindings.map(function (data) {
|
|
1071
1154
|
if (fragment.filter !== FilterFieldType.TIME_SHIFT_TYPE && fragment.filter !== FilterFieldType.SALARY_TYPE) {
|
|
1072
|
-
return { id: data.value.id, label: data.value.
|
|
1155
|
+
return { id: data.value.id, label: data.value.code, code: data.value.code };
|
|
1073
1156
|
}
|
|
1074
1157
|
else {
|
|
1075
1158
|
return data.key;
|
|
1076
1159
|
}
|
|
1077
1160
|
});
|
|
1161
|
+
_this.convertCodeByERPX(dto.equals, fragment.filter);
|
|
1078
1162
|
}
|
|
1079
1163
|
return dto;
|
|
1080
1164
|
});
|
|
1081
1165
|
};
|
|
1166
|
+
AdvancedFilterDtoConverter.convertCodeByERPX = function (field, typeField) {
|
|
1167
|
+
switch (typeField) {
|
|
1168
|
+
case FilterFieldType.COMPANY:
|
|
1169
|
+
if (field.length) {
|
|
1170
|
+
field.map(function (item) { return item.codEmp = item.code; });
|
|
1171
|
+
}
|
|
1172
|
+
else {
|
|
1173
|
+
field.codEmp = field.code;
|
|
1174
|
+
}
|
|
1175
|
+
break;
|
|
1176
|
+
case FilterFieldType.COMPANY_BRANCH:
|
|
1177
|
+
if (field.length) {
|
|
1178
|
+
field.map(function (item) { return item.codFil = item.code; });
|
|
1179
|
+
}
|
|
1180
|
+
else {
|
|
1181
|
+
field.codFil = field.code;
|
|
1182
|
+
}
|
|
1183
|
+
break;
|
|
1184
|
+
case FilterFieldType.COST_CENTER:
|
|
1185
|
+
if (field.length) {
|
|
1186
|
+
field.map(function (item) { return item.codCcu = item.code; });
|
|
1187
|
+
}
|
|
1188
|
+
else {
|
|
1189
|
+
field.codCcu = field.code;
|
|
1190
|
+
}
|
|
1191
|
+
break;
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1082
1194
|
AdvancedFilterDtoConverter.toDto = function (form, isApply) {
|
|
1083
1195
|
var _this = this;
|
|
1084
1196
|
var _a;
|
|
@@ -1268,11 +1380,7 @@
|
|
|
1268
1380
|
this.visibleSidebar = false;
|
|
1269
1381
|
this.filterFields = [];
|
|
1270
1382
|
this.displayModalSave = false;
|
|
1271
|
-
this.
|
|
1272
|
-
key: "header-dialog-save",
|
|
1273
|
-
severity: "info",
|
|
1274
|
-
detail: this.translate.instant("hcm_contract.employment_contract.advanced_filter_dialog_save_detail"),
|
|
1275
|
-
}];
|
|
1383
|
+
this.actions = [];
|
|
1276
1384
|
this.advancedFilterLookupDisplayFields = ["name"];
|
|
1277
1385
|
this.timeShiftType = [
|
|
1278
1386
|
{
|
|
@@ -1337,6 +1445,7 @@
|
|
|
1337
1445
|
this.KEY_STORAGE = "AdvancedFilterComponent";
|
|
1338
1446
|
this.formGroup = this.getFormGroup();
|
|
1339
1447
|
this.getAdvancedFilterByLocalStorage();
|
|
1448
|
+
this.getActions();
|
|
1340
1449
|
}
|
|
1341
1450
|
AdvancedFilterComponent.prototype.getFormGroup = function () {
|
|
1342
1451
|
return new forms.FormGroup({
|
|
@@ -1416,7 +1525,7 @@
|
|
|
1416
1525
|
var _this = this;
|
|
1417
1526
|
this.loading = true;
|
|
1418
1527
|
FormUtils.updateAndValidateControlValues(this.formGroup);
|
|
1419
|
-
if (!this.formGroup.valid) {
|
|
1528
|
+
if (!this.formGroup.valid || !this.validateFieldsSaveAndApply()) {
|
|
1420
1529
|
this.loading = false;
|
|
1421
1530
|
return;
|
|
1422
1531
|
}
|
|
@@ -1455,24 +1564,25 @@
|
|
|
1455
1564
|
}),
|
|
1456
1565
|
];
|
|
1457
1566
|
};
|
|
1458
|
-
AdvancedFilterComponent.prototype.
|
|
1567
|
+
AdvancedFilterComponent.prototype.validateFieldsSaveAndApply = function () {
|
|
1459
1568
|
var arrFormGroup = this.formGroup.get("advancedFilterFields");
|
|
1460
1569
|
var rowInvalid = false;
|
|
1461
1570
|
arrFormGroup.controls
|
|
1462
1571
|
.forEach(function (item) {
|
|
1463
1572
|
FormUtils.updateAndValidateControlValues(item);
|
|
1464
|
-
if (!item.get("conditionType").value || !item.valid) {
|
|
1573
|
+
if (!item.get("conditionType").value || !item.valid || !Object.keys(item.get("conditionType").value).length) {
|
|
1465
1574
|
rowInvalid = true;
|
|
1466
1575
|
}
|
|
1467
1576
|
});
|
|
1468
1577
|
if (rowInvalid) {
|
|
1469
|
-
|
|
1578
|
+
this.messageService.add({
|
|
1470
1579
|
severity: "error",
|
|
1471
1580
|
summary: this.translate.instant("hcm_contract.employment_contract.error"),
|
|
1472
1581
|
detail: this.translate.instant("hcm_contract.employment_contract.advanced_filter_fields_invalid"),
|
|
1473
1582
|
});
|
|
1583
|
+
return false;
|
|
1474
1584
|
}
|
|
1475
|
-
|
|
1585
|
+
return true;
|
|
1476
1586
|
};
|
|
1477
1587
|
AdvancedFilterComponent.prototype.getLabelForMaping = function (item) {
|
|
1478
1588
|
var _this = this;
|
|
@@ -1504,6 +1614,7 @@
|
|
|
1504
1614
|
_this.convertEntityToForm(data);
|
|
1505
1615
|
_this.advancedFilterEvent.emit(data);
|
|
1506
1616
|
_this.filtersStorageService.storeFilters(_this.KEY_STORAGE, data);
|
|
1617
|
+
data.advancedFilterFields.forEach(function (f) { return _this.disableOrEnableAction(f === null || f === void 0 ? void 0 : f.name, true); });
|
|
1507
1618
|
});
|
|
1508
1619
|
}
|
|
1509
1620
|
else {
|
|
@@ -1526,6 +1637,7 @@
|
|
|
1526
1637
|
this.entityData = null;
|
|
1527
1638
|
this.advancedFilterEvent.emit(null);
|
|
1528
1639
|
this.filtersStorageService.removeFilter(this.KEY_STORAGE);
|
|
1640
|
+
this.actions.map(function (action) { return action.disabled = false; });
|
|
1529
1641
|
};
|
|
1530
1642
|
AdvancedFilterComponent.prototype.updateFormGroup = function (event) {
|
|
1531
1643
|
if (event) {
|
|
@@ -1537,6 +1649,9 @@
|
|
|
1537
1649
|
});
|
|
1538
1650
|
}
|
|
1539
1651
|
};
|
|
1652
|
+
AdvancedFilterComponent.prototype.disabledAction = function (event) {
|
|
1653
|
+
this.disableOrEnableAction(event, false);
|
|
1654
|
+
};
|
|
1540
1655
|
AdvancedFilterComponent.prototype.duplicateFilter = function () {
|
|
1541
1656
|
clearValues(this.formGroup, ["advancedFilterSideBar", "id", "name"]);
|
|
1542
1657
|
};
|
|
@@ -1581,19 +1696,24 @@
|
|
|
1581
1696
|
});
|
|
1582
1697
|
}
|
|
1583
1698
|
};
|
|
1699
|
+
AdvancedFilterComponent.prototype.convertLabelToCode = function (dynamicForm, codeName) {
|
|
1700
|
+
if (codeName === void 0) { codeName = "code"; }
|
|
1701
|
+
dynamicForm.lookupDisplayField = codeName;
|
|
1702
|
+
return dynamicForm;
|
|
1703
|
+
};
|
|
1584
1704
|
AdvancedFilterComponent.prototype.addField = function (fieldType) {
|
|
1585
1705
|
switch (fieldType) {
|
|
1586
1706
|
case FilterFieldType.JOB_POSITION:
|
|
1587
1707
|
return {
|
|
1588
1708
|
entityName: FilterFieldType.JOB_POSITION,
|
|
1589
|
-
dynamicFormField: this.jobPositionService.getFormField(false),
|
|
1709
|
+
dynamicFormField: this.convertLabelToCode(this.jobPositionService.getFormField(false)),
|
|
1590
1710
|
filterFormFields: this.jobPositionService.getJobPositionSearchFields(),
|
|
1591
1711
|
label: this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_job_position"),
|
|
1592
1712
|
};
|
|
1593
1713
|
case FilterFieldType.COST_CENTER:
|
|
1594
1714
|
return {
|
|
1595
1715
|
entityName: FilterFieldType.COST_CENTER,
|
|
1596
|
-
dynamicFormField: this.costCenterService.getFormField(false),
|
|
1716
|
+
dynamicFormField: this.convertLabelToCode(this.costCenterService.getFormField(false), "codCcu"),
|
|
1597
1717
|
filterFormFields: this.costCenterService.getCostCenterSearchFields(),
|
|
1598
1718
|
label: this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_cost_center"),
|
|
1599
1719
|
};
|
|
@@ -1601,14 +1721,14 @@
|
|
|
1601
1721
|
return {
|
|
1602
1722
|
label: this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_company"),
|
|
1603
1723
|
entityName: FilterFieldType.COMPANY,
|
|
1604
|
-
dynamicFormField: this.companyService.getFormField(false),
|
|
1724
|
+
dynamicFormField: this.convertLabelToCode(this.companyService.getFormField(false), "codEmp"),
|
|
1605
1725
|
filterFormFields: this.companyService.getCompanySearchFields(),
|
|
1606
1726
|
};
|
|
1607
1727
|
case FilterFieldType.COMPANY_BRANCH:
|
|
1608
1728
|
return {
|
|
1609
1729
|
label: this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_company_branch"),
|
|
1610
1730
|
entityName: FilterFieldType.COMPANY_BRANCH,
|
|
1611
|
-
dynamicFormField: this.companyBranchService.getFormField(false),
|
|
1731
|
+
dynamicFormField: this.convertLabelToCode(this.companyBranchService.getFormField(false), "codFil"),
|
|
1612
1732
|
filterFormFields: this.companyBranchService.getCompanyBranchSearchFields(),
|
|
1613
1733
|
};
|
|
1614
1734
|
case FilterFieldType.EMPLOYEE:
|
|
@@ -1627,35 +1747,35 @@
|
|
|
1627
1747
|
return {
|
|
1628
1748
|
label: this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_employee"),
|
|
1629
1749
|
entityName: FilterFieldType.EMPLOYEE,
|
|
1630
|
-
dynamicFormField: this.employeeService.getFormField(false),
|
|
1750
|
+
dynamicFormField: this.convertLabelToCode(this.employeeService.getFormField(false)),
|
|
1631
1751
|
filterFormFields: employeeSearchFields,
|
|
1632
1752
|
};
|
|
1633
1753
|
case FilterFieldType.WORKSHIFT:
|
|
1634
1754
|
return {
|
|
1635
1755
|
label: this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_workshift"),
|
|
1636
1756
|
entityName: FilterFieldType.WORKSHIFT,
|
|
1637
|
-
dynamicFormField: this.workshiftService.getFormField(false),
|
|
1757
|
+
dynamicFormField: this.convertLabelToCode(this.workshiftService.getFormField(false)),
|
|
1638
1758
|
filterFormFields: this.workshiftService.getWorkshiftSearchFields(),
|
|
1639
1759
|
};
|
|
1640
1760
|
case FilterFieldType.EMPLOYMENT_RELATIONSHIP:
|
|
1641
1761
|
return {
|
|
1642
1762
|
label: this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_employment_relationship"),
|
|
1643
1763
|
entityName: FilterFieldType.EMPLOYMENT_RELATIONSHIP,
|
|
1644
|
-
dynamicFormField: this.employmentRelationshipService.getFormField(false),
|
|
1764
|
+
dynamicFormField: this.convertLabelToCode(this.employmentRelationshipService.getFormField(false)),
|
|
1645
1765
|
filterFormFields: this.employmentRelationshipService.getEmploymentRelationshipSearchFields(),
|
|
1646
1766
|
};
|
|
1647
1767
|
case FilterFieldType.SYNDICATE:
|
|
1648
1768
|
return {
|
|
1649
1769
|
label: this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_syndicate"),
|
|
1650
1770
|
entityName: FilterFieldType.SYNDICATE,
|
|
1651
|
-
dynamicFormField: this.syndicateService.getFormField(false),
|
|
1771
|
+
dynamicFormField: this.convertLabelToCode(this.syndicateService.getFormField(false)),
|
|
1652
1772
|
filterFormFields: this.syndicateService.getSyndicateSearchFields(),
|
|
1653
1773
|
};
|
|
1654
1774
|
case FilterFieldType.LOCATION:
|
|
1655
1775
|
return {
|
|
1656
1776
|
label: this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_location"),
|
|
1657
1777
|
entityName: FilterFieldType.LOCATION,
|
|
1658
|
-
dynamicFormField: this.locationService.getFormField(false),
|
|
1778
|
+
dynamicFormField: this.convertLabelToCode(this.locationService.getFormField(false)),
|
|
1659
1779
|
filterFormFields: this.locationService.getLocationSearchFields(),
|
|
1660
1780
|
};
|
|
1661
1781
|
case FilterFieldType.SALARY_TYPE:
|
|
@@ -1695,16 +1815,27 @@
|
|
|
1695
1815
|
});
|
|
1696
1816
|
AdvancedFilterComponent.prototype.getActions = function () {
|
|
1697
1817
|
var _this = this;
|
|
1698
|
-
var actions = [];
|
|
1699
1818
|
Object.keys(FilterFieldType)
|
|
1700
1819
|
.forEach(function (enumeration) {
|
|
1701
|
-
actions.push({
|
|
1820
|
+
_this.actions.push({
|
|
1702
1821
|
id: enumeration,
|
|
1703
1822
|
label: _this.translate.instant("hcm_contract.employment_contract.advanced_filter_field_" + (enumeration === null || enumeration === void 0 ? void 0 : enumeration.toLowerCase())),
|
|
1704
|
-
command: function () {
|
|
1823
|
+
command: function () {
|
|
1824
|
+
_this.filterField = _this.addField(enumeration);
|
|
1825
|
+
_this.disableOrEnableAction(enumeration, true);
|
|
1826
|
+
},
|
|
1827
|
+
disabled: _this.isFilterAdded(enumeration)
|
|
1705
1828
|
});
|
|
1706
1829
|
});
|
|
1707
|
-
|
|
1830
|
+
};
|
|
1831
|
+
AdvancedFilterComponent.prototype.isFilterAdded = function (filterType) {
|
|
1832
|
+
return this.filterFields.some(function (field) { return field.entityName === filterType; });
|
|
1833
|
+
};
|
|
1834
|
+
AdvancedFilterComponent.prototype.disableOrEnableAction = function (filterType, disable) {
|
|
1835
|
+
var action = this.actions.find(function (act) { return act.id === filterType; });
|
|
1836
|
+
if (action) {
|
|
1837
|
+
action.disabled = disable;
|
|
1838
|
+
}
|
|
1708
1839
|
};
|
|
1709
1840
|
AdvancedFilterComponent.ctorParameters = function () { return [
|
|
1710
1841
|
{ type: core$1.TranslateService },
|
|
@@ -1729,8 +1860,8 @@
|
|
|
1729
1860
|
AdvancedFilterComponent = __decorate([
|
|
1730
1861
|
core.Component({
|
|
1731
1862
|
selector: "fnd-advanced-filter",
|
|
1732
|
-
template: "<!--- OVERLAY -->\n<s-loading-state [loading]=\"loading\" [blockWindow]=\"true\"></s-loading-state>\n<p-confirmDialog key=\"confirm-delete\" acceptLabel=\"{{'hcm_contract.employment_contract.delete' | translate}}\" acceptIcon=\"\" [rejectButtonStyleClass]=\"'ui-button-secondary'\"\n rejectLabel=\"{{'hcm_contract.employment_contract.cancel' | translate}}\" rejectIcon=\"\">\n\n</p-confirmDialog>\n<p-confirmDialog\n key=\"confirm-clear\"\n acceptLabel=\"{{'hcm_contract.employment_contract.yes' | translate}}\"\n [rejectButtonStyleClass]=\"'ui-button-secondary'\"\n rejectLabel=\"{{'hcm_contract.employment_contract.no' | translate}}\" rejectIcon=\"\">\n</p-confirmDialog>\n<p-toast [baseZIndex]=\"1\" key=\"toast-advanced-filter\"></p-toast>\n<!--- OVERLAY -->\n\n<div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <div class=\"row-lookup-advanced-filter\">\n <form [formGroup]=\"formGroup\">\n <label>{{ 'hcm_contract.employment_contract.advanced_filter_side_bar_title' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"advancedFilter\"\n name=\"advancedFilter\" formControlName=\"advancedFilter\"\n [formControlName]=\"'advancedFilter'\" [searchFields]=\"advancedFilterSearchFields\"\n [searchGridFields]=\"advancedFilterSearchGridFields\"\n [searchGridData]=\"advancedFilterSearchGridData\"\n [multiple]=\"false\" [lookupSuggestions]=\"advancedFilterLookupSuggestions\"\n (onLookupRequest)=\"onAdvancedFilterLookupRequest($event)\"\n (onSearchRequest)=\"onAdvancedFilterSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=advancedFilterSearchTotalRecords\n (onSelect)=\"onSelectLookup($event)\"\n (onClear)=\"resetAdvancedFilter()\"\n [searchTitle]=\"'hcm_contract.employment_contract.advanced_filter_search_title' | translate\"\n [searchEmptyTitle]=\"'hcm_contract.employment_contract.nothing_found' | translate\"\n [filterLabel]=\"'hcm_contract.employment_contract.filter' | translate\"\n [filterTitle]=\"'hcm_contract.employment_contract.filters' | translate\"\n [clearLabel]=\"'hcm_contract.employment_contract.clear' | translate\"\n [cancelLabel]=\"'hcm_contract.employment_contract.cancel' | translate\"\n [selectLabel]=\"'hcm_contract.employment_contract.select' | translate\"\n [searchTotalRecordsLabel]=\"'hcm_contract.employment_contract.total_records'\n\n | translate: {value: advancedFilterSearchTotalRecords}\"></s-lookup>\n </form>\n <s-button priority=\"secondary\" iconClass=\"fa fa-filter\"\n (onClick)=\"visibleSidebar = !visibleSidebar\"></s-button>\n </div>\n </div>\n</div>\n\n<s-sidebar [visible]=\"visibleSidebar\"\n largeSized=\"true\"\n (visibleChange)=\"visibleSidebar = !visibleSidebar\"\n [header]=\"'hcm_contract.employment_contract.advanced_filter_side_bar_title' | translate\">\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <div class=\"row-lookup-advanced-filter\">\n <form [formGroup]=\"formGroup\">\n <label>{{ 'hcm_contract.employment_contract.advanced_filter_lookup_filter_label' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"advancedFilter-sidebar\"\n name=\"advancedFilterSideBar\" formControlName=\"advancedFilterSideBar\"\n [formControlName]=\"'advancedFilterSideBar'\" [searchFields]=\"advancedFilterSearchFields\"\n [searchGridFields]=\"advancedFilterSearchGridFields\"\n [searchGridData]=\"advancedFilterSearchGridData\"\n (onSelect)=\"onSelectLookup($event)\"\n (onClear)=\"resetAdvancedFilter()\"\n [multiple]=\"false\" [lookupSuggestions]=\"advancedFilterLookupSuggestions\"\n (onLookupRequest)=\"onAdvancedFilterLookupRequest($event)\"\n (onSearchRequest)=\"onAdvancedFilterSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=advancedFilterSearchTotalRecords\n [searchTitle]=\"'hcm_contract.employment_contract.advanced_filter_search_title' | translate\"\n [searchEmptyTitle]=\"'hcm_contract.employment_contract.nothing_found' | translate\"\n [filterLabel]=\"'hcm_contract.employment_contract.filter' | translate\"\n [filterTitle]=\"'hcm_contract.employment_contract.filters' | translate\"\n [clearLabel]=\"'hcm_contract.employment_contract.clear' | translate\"\n [cancelLabel]=\"'hcm_contract.employment_contract.cancel' | translate\"\n [selectLabel]=\"'hcm_contract.employment_contract.select' | translate\"\n [searchTotalRecordsLabel]=\"'hcm_contract.employment_contract.total_records'\n | translate: {value: advancedFilterSearchTotalRecords}\"></s-lookup>\n </form>\n <s-button\n tooltip=\"{{ 'hcm_contract.employment_contract.advanced_filter_tooltip_duplicate_filter' | translate }}\"\n class=\"btn-add\"\n tooltipPosition=\"top\"\n priority=\"default\" iconClass=\"fa fa-plus\"\n [disabled]=\"!entityData\"\n (onClick)=\"duplicateFilter()\">\n </s-button>\n <s-button\n tooltip=\"{{ 'hcm_contract.employment_contract.delete' | translate }}\"\n class=\"btn-delete\"\n [disabled]=\"!entityData\"\n iconClass=\"fas fa-trash\"\n (onClick)=\"deleteFilter()\">\n </s-button>\n </div>\n </div>\n <div class=\"ui-g row-title-grid\">\n <div class=\"title-badge\">\n <span>{{ 'hcm_contract.employment_contract.advanced_filter_title_grid' | translate }}</span>\n <s-badge [text]=\"countAdvancedFilterFields\"></s-badge>\n </div>\n <div class=\"btn-actions\">\n <s-button\n label=\"{{'hcm_contract.employment_contract.advanced_filter_add_filter_label' | translate }}\"\n iconClass=\"fa fa-plus\"\n priority=\"default\"\n [model]=\"getActions()\"\n [disabled]=\"false\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n </div>\n <div class=\"ui-grid\">\n <form [formGroup]=\"formGroup\">\n <div class=\"ui-fluid required\">\n <label\n for=\"name\">{{\"hcm_contract.employment_contract.advanced_filter_name_save\" | translate}}</label>\n <input\n type=\"text\"\n id=\"name\"\n name=\"name\" pInputText\n placeholder=\"{{ 'hcm_contract.employment_contract.advanced_filter_placeholder_name' | translate }}\"\n formControlName=\"name\" autocomplete=\"off\"/>\n <s-control-errors [control]=\"formGroup?.controls['name']\"\n [errorMessages]=\"{ required: 'hcm_contract.employment_contract.error_required' | translate }\">\n </s-control-errors>\n </div>\n </form>\n <hr/>\n <s-empty-state iconClass=\"fa fa-inbox\" *ngIf=\"!countAdvancedFilterFields\"\n [title]=\"'hcm_contract.employment_contract.advanced_filter_not_result' | translate\"\n [description]=\"'hcm_contract.employment_contract.advanced_filter_empty_state' | translate\"></s-empty-state>\n \n <div class=\"ui-fluid list-filter-fields\">\n <fnd-advanced-filter-fields (updateFormGroup)=\"updateFormGroup($event)\" [addFilterFields]=\"filterField\" [listFilterFields]=\"filterFields\"\n [formGroup]=\"formGroup\"></fnd-advanced-filter-fields>\n </div>\n </div>\n </div>\n <s-footer>\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <s-button [disabled]=\"!countAdvancedFilterFields\"\n [label]=\"'hcm_contract.employment_contract.advanced_filter_btn_apply_and_save' | translate\"\n (onClick)=\"onSave()\"></s-button>\n <s-button [disabled]=\"!countAdvancedFilterFields\"\n [label]=\"'hcm_contract.employment_contract.advanced_filter_btn_apply' | translate\"\n priority=\"secondary\"\n (onClick)=\"onApply()\"></s-button>\n <s-button [disabled]=\"!countAdvancedFilterFields\"\n [label]=\"'hcm_contract.employment_contract.clear' | translate\"\n priority=\"secondary\"\n (onClick)=\"clearFilter()\"></s-button>\n <s-button [label]=\"'hcm_contract.employment_contract.advanced_filter_btn_cancel' | translate\"\n priority=\"link\" (onClick)=\"visibleSidebar=false\"></s-button>\n </div>\n </div>\n </s-footer>\n</s-sidebar>\n",
|
|
1733
|
-
styles: [".row-lookup-advanced-filter{display:flex;width:100%;align-items:flex-end}.row-lookup-advanced-filter form{width:100%}.row-lookup-advanced-filter s-button{margin-left:10px}.row-lookup-advanced-filter .btn-delete{margin-top:26px}.row-title-grid{margin:20px 0 10px}.row-title-grid .title-badge{font-family:Inter,sans-serif;font-size:16px;font-weight:700;line-height:24px;text-align:left;color:#383e4c}.row-title-grid .title-badge s-badge span{background-color:#7892a1!important;border:1px solid #7892a1!important}.row-title-grid .btn-actions{margin-left:auto}hr{margin:16px 0;border:0;height:1px;background:#dedce5}"]
|
|
1863
|
+
template: "<!--- OVERLAY -->\n<s-loading-state [loading]=\"loading\" [blockWindow]=\"true\"></s-loading-state>\n<p-confirmDialog key=\"confirm-delete\" acceptLabel=\"{{'hcm_contract.employment_contract.delete' | translate}}\" acceptIcon=\"\" [rejectButtonStyleClass]=\"'ui-button-secondary'\"\n rejectLabel=\"{{'hcm_contract.employment_contract.cancel' | translate}}\" rejectIcon=\"\">\n\n</p-confirmDialog>\n<p-confirmDialog\n key=\"confirm-clear\"\n acceptLabel=\"{{'hcm_contract.employment_contract.yes' | translate}}\"\n [rejectButtonStyleClass]=\"'ui-button-secondary'\"\n rejectLabel=\"{{'hcm_contract.employment_contract.no' | translate}}\" rejectIcon=\"\">\n</p-confirmDialog>\n<p-toast [baseZIndex]=\"1\" key=\"toast-advanced-filter\"></p-toast>\n<!--- OVERLAY -->\n\n<div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <div class=\"row-lookup-advanced-filter\">\n <form [formGroup]=\"formGroup\">\n <label>{{ 'hcm_contract.employment_contract.advanced_filter_side_bar_title' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"advancedFilter\"\n name=\"advancedFilter\" formControlName=\"advancedFilter\"\n [formControlName]=\"'advancedFilter'\" [searchFields]=\"advancedFilterSearchFields\"\n [searchGridFields]=\"advancedFilterSearchGridFields\"\n [searchGridData]=\"advancedFilterSearchGridData\"\n [multiple]=\"false\" [lookupSuggestions]=\"advancedFilterLookupSuggestions\"\n (onLookupRequest)=\"onAdvancedFilterLookupRequest($event)\"\n (onSearchRequest)=\"onAdvancedFilterSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=advancedFilterSearchTotalRecords\n (onSelect)=\"onSelectLookup($event)\"\n (onClear)=\"resetAdvancedFilter()\"\n [searchTitle]=\"'hcm_contract.employment_contract.advanced_filter_search_title' | translate\"\n [searchEmptyTitle]=\"'hcm_contract.employment_contract.nothing_found' | translate\"\n [filterLabel]=\"'hcm_contract.employment_contract.filter' | translate\"\n [filterTitle]=\"'hcm_contract.employment_contract.filters' | translate\"\n [clearLabel]=\"'hcm_contract.employment_contract.clear' | translate\"\n [cancelLabel]=\"'hcm_contract.employment_contract.cancel' | translate\"\n [selectLabel]=\"'hcm_contract.employment_contract.select' | translate\"\n [searchTotalRecordsLabel]=\"'hcm_contract.employment_contract.total_records'\n\n | translate: {value: advancedFilterSearchTotalRecords}\"></s-lookup>\n </form>\n <s-button priority=\"secondary\" iconClass=\"fa fa-filter\"\n (onClick)=\"visibleSidebar = !visibleSidebar\"></s-button>\n </div>\n </div>\n</div>\n\n<s-sidebar [visible]=\"visibleSidebar\"\n largeSized=\"true\"\n (visibleChange)=\"visibleSidebar = !visibleSidebar\"\n [header]=\"'hcm_contract.employment_contract.advanced_filter_side_bar_title' | translate\">\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <div class=\"row-lookup-advanced-filter\">\n <form [formGroup]=\"formGroup\">\n <label>{{ 'hcm_contract.employment_contract.advanced_filter_lookup_filter_label' | translate}}</label>\n <s-lookup dataKey=\"id\" id=\"advancedFilter-sidebar\"\n name=\"advancedFilterSideBar\" formControlName=\"advancedFilterSideBar\"\n [formControlName]=\"'advancedFilterSideBar'\" [searchFields]=\"advancedFilterSearchFields\"\n [searchGridFields]=\"advancedFilterSearchGridFields\"\n [searchGridData]=\"advancedFilterSearchGridData\"\n (onSelect)=\"onSelectLookup($event)\"\n (onClear)=\"resetAdvancedFilter()\"\n [multiple]=\"false\" [lookupSuggestions]=\"advancedFilterLookupSuggestions\"\n (onLookupRequest)=\"onAdvancedFilterLookupRequest($event)\"\n (onSearchRequest)=\"onAdvancedFilterSearchRequest($event)\" lookupDisplayField=\"label\"\n [searchTotalRecords]=advancedFilterSearchTotalRecords\n [searchTitle]=\"'hcm_contract.employment_contract.advanced_filter_search_title' | translate\"\n [searchEmptyTitle]=\"'hcm_contract.employment_contract.nothing_found' | translate\"\n [filterLabel]=\"'hcm_contract.employment_contract.filter' | translate\"\n [filterTitle]=\"'hcm_contract.employment_contract.filters' | translate\"\n [clearLabel]=\"'hcm_contract.employment_contract.clear' | translate\"\n [cancelLabel]=\"'hcm_contract.employment_contract.cancel' | translate\"\n [selectLabel]=\"'hcm_contract.employment_contract.select' | translate\"\n [searchTotalRecordsLabel]=\"'hcm_contract.employment_contract.total_records'\n | translate: {value: advancedFilterSearchTotalRecords}\"></s-lookup>\n </form>\n <s-button\n tooltip=\"{{ 'hcm_contract.employment_contract.advanced_filter_tooltip_duplicate_filter' | translate }}\"\n class=\"btn-add\"\n tooltipPosition=\"top\"\n priority=\"default\" iconClass=\"fa fa-plus\"\n [disabled]=\"!entityData\"\n (onClick)=\"duplicateFilter()\">\n </s-button>\n <s-button\n tooltip=\"{{ 'hcm_contract.employment_contract.delete' | translate }}\"\n class=\"btn-delete\"\n [disabled]=\"!entityData\"\n iconClass=\"fas fa-trash\"\n (onClick)=\"deleteFilter()\">\n </s-button>\n </div>\n </div>\n <div class=\"ui-g row-title-grid\">\n <div class=\"title-badge\">\n <span>{{ 'hcm_contract.employment_contract.advanced_filter_title_grid' | translate }}</span>\n <s-badge [text]=\"countAdvancedFilterFields\"></s-badge>\n </div>\n <div class=\"btn-actions\">\n <s-button\n label=\"{{'hcm_contract.employment_contract.advanced_filter_add_filter_label' | translate }}\"\n iconClass=\"fa fa-plus\"\n priority=\"default\"\n [model]=\"actions\"\n [disabled]=\"false\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n </div>\n <div class=\"ui-grid\">\n <form [formGroup]=\"formGroup\">\n <div class=\"ui-g-6 required filter-name-input\">\n <label\n for=\"name\">{{\"hcm_contract.employment_contract.advanced_filter_name_save\" | translate}}</label>\n <input\n type=\"text\"\n id=\"name\"\n name=\"name\" pInputText\n placeholder=\"{{ 'hcm_contract.employment_contract.advanced_filter_placeholder_name' | translate }}\"\n formControlName=\"name\" autocomplete=\"off\"/>\n <s-control-errors [control]=\"formGroup?.controls['name']\"\n [errorMessages]=\"{ required: 'hcm_contract.employment_contract.error_required' | translate }\">\n </s-control-errors>\n </div>\n </form>\n </div>\n <div>\n <hr/>\n <s-empty-state iconClass=\"fa fa-inbox\" *ngIf=\"!countAdvancedFilterFields\"\n [title]=\"'hcm_contract.employment_contract.advanced_filter_not_result' | translate\"\n [description]=\"'hcm_contract.employment_contract.advanced_filter_empty_state' | translate\">\n </s-empty-state>\n \n <div class=\"ui-fluid list-filter-fields\">\n <fnd-advanced-filter-fields\n (updateFormGroup)=\"updateFormGroup($event)\"\n (disabledAction)=\"disabledAction($event)\"\n [addFilterFields]=\"filterField\"\n [listFilterFields]=\"filterFields\"\n [formGroup]=\"formGroup\">\n </fnd-advanced-filter-fields>\n </div>\n </div>\n </div>\n <s-footer>\n <div class=\"ui-fluid\">\n <div class=\"ui-g\">\n <s-button [disabled]=\"!countAdvancedFilterFields\"\n [label]=\"'hcm_contract.employment_contract.advanced_filter_btn_apply_and_save' | translate\"\n (onClick)=\"onSave()\"></s-button>\n <s-button [disabled]=\"!countAdvancedFilterFields\"\n [label]=\"'hcm_contract.employment_contract.advanced_filter_btn_apply' | translate\"\n priority=\"secondary\"\n (onClick)=\"onApply()\"></s-button>\n <s-button [disabled]=\"!countAdvancedFilterFields\"\n [label]=\"'hcm_contract.employment_contract.clear' | translate\"\n priority=\"secondary\"\n (onClick)=\"clearFilter()\"></s-button>\n <s-button [label]=\"'hcm_contract.employment_contract.advanced_filter_btn_cancel' | translate\"\n priority=\"link\" (onClick)=\"visibleSidebar=false\"></s-button>\n </div>\n </div>\n </s-footer>\n</s-sidebar>\n",
|
|
1864
|
+
styles: [".row-lookup-advanced-filter{display:flex;width:100%;align-items:flex-end}.row-lookup-advanced-filter form{width:100%}.row-lookup-advanced-filter s-button{margin-left:10px}.row-lookup-advanced-filter .btn-delete{margin-top:26px}.filter-name-input{padding:.5em 0}.row-title-grid{margin:20px 0 10px}.row-title-grid .title-badge{font-family:Inter,sans-serif;font-size:16px;font-weight:700;line-height:24px;text-align:left;color:#383e4c}.row-title-grid .title-badge s-badge span{background-color:#7892a1!important;border:1px solid #7892a1!important}.row-title-grid .btn-actions{margin-left:auto}hr{margin:16px 0;border:0;height:1px;background:#dedce5}"]
|
|
1734
1865
|
})
|
|
1735
1866
|
], AdvancedFilterComponent);
|
|
1736
1867
|
return AdvancedFilterComponent;
|