@c10t/nice-component-library 0.0.3-beta → 0.0.5-beta
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/components/base/base-search.component.d.ts +6 -6
- package/fesm2022/c10t-nice-component-library.mjs +211 -197
- package/fesm2022/c10t-nice-component-library.mjs.map +1 -1
- package/models/components/table-paging-response.model.d.ts +6 -3
- package/package.json +1 -1
- package/services/utils.service.d.ts +14 -14
|
@@ -27,15 +27,15 @@ export declare class BaseSearchComponent extends BaseTableComponent implements O
|
|
|
27
27
|
protected activatedRoute: ActivatedRoute;
|
|
28
28
|
protected authoritiesService: AuthoritiesService;
|
|
29
29
|
protected formGroup: FormGroup;
|
|
30
|
-
protected moduleName: string;
|
|
31
|
-
protected unsubscribe$: Subject<void>;
|
|
32
|
-
protected isResetPaging: boolean;
|
|
33
30
|
isAdvancedSearch: boolean;
|
|
34
31
|
searchForm: FormGroup;
|
|
35
32
|
paging: TablePagingRequestModel;
|
|
36
33
|
results: MatTableDataSource<BaseModel>;
|
|
37
34
|
columns: ColumnModel[];
|
|
38
35
|
config: NiceComponentLibraryConfig;
|
|
36
|
+
protected moduleName: string;
|
|
37
|
+
protected unsubscribe$: Subject<void>;
|
|
38
|
+
protected isResetPaging: boolean;
|
|
39
39
|
constructor(router: Router, apiService: ApiService, utilsService: UtilsService, formStateService: FormStateService, translateService: TranslateService, injector: Injector, activatedRoute: ActivatedRoute, authoritiesService: AuthoritiesService, formGroup: FormGroup);
|
|
40
40
|
ngOnInit(): void;
|
|
41
41
|
ngAfterViewInit(): void;
|
|
@@ -43,9 +43,6 @@ export declare class BaseSearchComponent extends BaseTableComponent implements O
|
|
|
43
43
|
onSubmit(): void;
|
|
44
44
|
search(): void;
|
|
45
45
|
afterSearch: (data: TablePagingResponseModel) => void;
|
|
46
|
-
private afterFillData;
|
|
47
|
-
private removeEmptyParams;
|
|
48
|
-
private updateHttpParams;
|
|
49
46
|
_fillData(nativeUrl: string, params: HttpParams, baseUrl?: string): void;
|
|
50
47
|
_fillDataByPostMethod(nativeUrl: string, obj: any, options: {
|
|
51
48
|
headers?: HttpHeaders;
|
|
@@ -57,6 +54,9 @@ export declare class BaseSearchComponent extends BaseTableComponent implements O
|
|
|
57
54
|
resetSearchFormValue(): void;
|
|
58
55
|
toggleAdvancedSearch(): void;
|
|
59
56
|
params2Object(params: HttpParams): Object;
|
|
57
|
+
private afterFillData;
|
|
58
|
+
private removeEmptyParams;
|
|
59
|
+
private updateHttpParams;
|
|
60
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseSearchComponent, never>;
|
|
61
61
|
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseSearchComponent, "BaseSearchComponent", never, {}, {}, never, never, false, never>;
|
|
62
62
|
}
|
|
@@ -241,9 +241,12 @@ class Authority {
|
|
|
241
241
|
|
|
242
242
|
class TablePagingResponseModel {
|
|
243
243
|
content = [];
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
page = {
|
|
245
|
+
size: null,
|
|
246
|
+
number: null,
|
|
247
|
+
totalElements: null,
|
|
248
|
+
totalPages: null,
|
|
249
|
+
};
|
|
247
250
|
}
|
|
248
251
|
|
|
249
252
|
class TablePagingRequestModel {
|
|
@@ -726,6 +729,134 @@ class UtilsService {
|
|
|
726
729
|
this.transService = transService;
|
|
727
730
|
this.toastr = toastr;
|
|
728
731
|
}
|
|
732
|
+
static getEnumValue(o, value) {
|
|
733
|
+
return o['_' + value]; // No type safety here unfrotunately
|
|
734
|
+
}
|
|
735
|
+
static calcPosition(e, results, paging) {
|
|
736
|
+
return (paging ? ((paging.pageNumber - 1) * paging.pageSize) : 0) + (results.data.indexOf(e) + 1);
|
|
737
|
+
}
|
|
738
|
+
static reduceEntityAttributeForFormControl(formGroup, e, dateRangeConfigList) {
|
|
739
|
+
return Object.keys(formGroup.controls).reduce(reduceEntityAttributeForFormControlByControlName, {});
|
|
740
|
+
function reduceEntityAttributeForFormControlByControlName(formControl, ctrlName) {
|
|
741
|
+
if (e) {
|
|
742
|
+
let includesOfDateRangeConfig = false;
|
|
743
|
+
if (dateRangeConfigList) {
|
|
744
|
+
for (const dateRangeConfig of dateRangeConfigList) {
|
|
745
|
+
if (dateRangeConfig
|
|
746
|
+
&& [dateRangeConfig.dateRangeControlName,
|
|
747
|
+
dateRangeConfig.fromDateControlName, dateRangeConfig.toDateControlName].includes(ctrlName)) {
|
|
748
|
+
includesOfDateRangeConfig = true;
|
|
749
|
+
switch (ctrlName) {
|
|
750
|
+
case dateRangeConfig.dateRangeControlName:
|
|
751
|
+
formControl[ctrlName] = {
|
|
752
|
+
fromDate: e[dateRangeConfig.fromDateControlName] ? e[dateRangeConfig.fromDateControlName] : null,
|
|
753
|
+
toDate: e[dateRangeConfig.toDateControlName] ? e[dateRangeConfig.toDateControlName] : null,
|
|
754
|
+
};
|
|
755
|
+
break;
|
|
756
|
+
case dateRangeConfig.fromDateControlName:
|
|
757
|
+
formControl[ctrlName] = e[ctrlName];
|
|
758
|
+
if (formControl[dateRangeConfig.dateRangeControlName]
|
|
759
|
+
&& typeof (formControl[dateRangeConfig.dateRangeControlName]) === 'object') {
|
|
760
|
+
formControl[dateRangeConfig.dateRangeControlName].fromDate = e[ctrlName];
|
|
761
|
+
}
|
|
762
|
+
break;
|
|
763
|
+
case dateRangeConfig.toDateControlName:
|
|
764
|
+
formControl[ctrlName] = e[ctrlName];
|
|
765
|
+
if (formControl[dateRangeConfig.dateRangeControlName]
|
|
766
|
+
&& typeof (formControl[dateRangeConfig.dateRangeControlName]) === 'object') {
|
|
767
|
+
formControl[dateRangeConfig.dateRangeControlName].toDate = e[ctrlName];
|
|
768
|
+
}
|
|
769
|
+
break;
|
|
770
|
+
default:
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
if (!includesOfDateRangeConfig) {
|
|
777
|
+
if (typeof (e[ctrlName]) === 'boolean') {
|
|
778
|
+
formControl[ctrlName] = e[ctrlName] ? '1' : '0';
|
|
779
|
+
}
|
|
780
|
+
else if (e[ctrlName] instanceof Array) {
|
|
781
|
+
formControl[ctrlName] = e[ctrlName];
|
|
782
|
+
}
|
|
783
|
+
else if (typeof (e[ctrlName]) === 'object') {
|
|
784
|
+
formControl[ctrlName] = e[ctrlName]
|
|
785
|
+
? (e[ctrlName].id
|
|
786
|
+
? e[ctrlName].id
|
|
787
|
+
: (e[ctrlName].code ? e[ctrlName].code : ''))
|
|
788
|
+
: null;
|
|
789
|
+
}
|
|
790
|
+
else {
|
|
791
|
+
formControl[ctrlName] = (e[ctrlName] != null && e[ctrlName] != undefined) ? e[ctrlName] : '';
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
else {
|
|
796
|
+
formControl[ctrlName] = '';
|
|
797
|
+
}
|
|
798
|
+
return formControl;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
static cloneAbstractControl(control) {
|
|
802
|
+
let newControl;
|
|
803
|
+
if (control instanceof FormGroup) {
|
|
804
|
+
const formGroup = new FormGroup({}, control.validator, control.asyncValidator);
|
|
805
|
+
const controls = control.controls;
|
|
806
|
+
if (controls) {
|
|
807
|
+
Object.keys(controls).forEach(key => {
|
|
808
|
+
const tempControl = UtilsService.cloneAbstractControl(controls[key]);
|
|
809
|
+
if (tempControl) {
|
|
810
|
+
formGroup.addControl(key, tempControl);
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
newControl = formGroup;
|
|
815
|
+
}
|
|
816
|
+
else if (control instanceof FormArray) {
|
|
817
|
+
const formArray = new FormArray([], control.validator, control.asyncValidator);
|
|
818
|
+
const controls = control.controls;
|
|
819
|
+
if (controls) {
|
|
820
|
+
controls.forEach((formControl) => {
|
|
821
|
+
const tempControl = UtilsService.cloneAbstractControl(formControl);
|
|
822
|
+
if (tempControl) {
|
|
823
|
+
formArray.push(tempControl);
|
|
824
|
+
}
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
newControl = formArray;
|
|
828
|
+
}
|
|
829
|
+
else if (control instanceof FormControl || this.isNgControl(control)) {
|
|
830
|
+
newControl = new FormControl(control.value, control.validator, control.asyncValidator);
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
console.error('Error: unexpected formControl value', control);
|
|
834
|
+
}
|
|
835
|
+
if (control.disabled && newControl)
|
|
836
|
+
newControl.disable({ emitEvent: false });
|
|
837
|
+
return newControl;
|
|
838
|
+
}
|
|
839
|
+
static isNgControl(control) {
|
|
840
|
+
return control && 'control' in control;
|
|
841
|
+
}
|
|
842
|
+
static convertTreeDataToAutocompleteData(treeFields, symbol, hasChildFn, nodes, prefixDisplayValue) {
|
|
843
|
+
let result = [];
|
|
844
|
+
if (treeFields) {
|
|
845
|
+
for (const node of nodes) {
|
|
846
|
+
const value = treeFields.value(node).toString();
|
|
847
|
+
const displayValue = prefixDisplayValue ? prefixDisplayValue + symbol + treeFields.display(node) : treeFields.display(node);
|
|
848
|
+
const hasChild = hasChildFn(0, node);
|
|
849
|
+
if (hasChild) {
|
|
850
|
+
const childen = treeFields.children(node);
|
|
851
|
+
result.push(...this.convertTreeDataToAutocompleteData(treeFields, symbol, hasChildFn, childen, displayValue));
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
result.push(new SelectModel(value, displayValue, hasChild, node));
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
return result;
|
|
859
|
+
}
|
|
729
860
|
strFormat(str, replacement) {
|
|
730
861
|
let a = this.transService.instant(str);
|
|
731
862
|
if (replacement === null || replacement === undefined || replacement.length === 0) {
|
|
@@ -828,7 +959,7 @@ class UtilsService {
|
|
|
828
959
|
const strOk = this.transService.instant(strOkText);
|
|
829
960
|
const strCancel = this.transService.instant(strCancelTex);
|
|
830
961
|
const re = /\./gi;
|
|
831
|
-
const customClass = (strCustomClass ? strCustomClass : strTitle).replace(re,
|
|
962
|
+
const customClass = (strCustomClass ? strCustomClass : strTitle).replace(re, '-');
|
|
832
963
|
return this.dialog.open(CvaCustomDialogComponent, confirmDialogConfig ? confirmDialogConfig : {
|
|
833
964
|
width: '500px',
|
|
834
965
|
data: {
|
|
@@ -846,7 +977,7 @@ class UtilsService {
|
|
|
846
977
|
const strOk = this.transService.instant(strOkText);
|
|
847
978
|
const strCancel = this.transService.instant(strCancelTex);
|
|
848
979
|
const re = /\./gi;
|
|
849
|
-
const customClass = (strCustomClass ? strCustomClass : str1).replace(re,
|
|
980
|
+
const customClass = (strCustomClass ? strCustomClass : str1).replace(re, '-');
|
|
850
981
|
return this.dialog.open(CvaCustomDialogComponent, confirmInputDialogConfig ? confirmInputDialogConfig : {
|
|
851
982
|
width: '500px',
|
|
852
983
|
data: {
|
|
@@ -867,139 +998,12 @@ class UtilsService {
|
|
|
867
998
|
type: 'application/json',
|
|
868
999
|
});
|
|
869
1000
|
}
|
|
870
|
-
static getEnumValue(o, value) {
|
|
871
|
-
return o['_' + value]; // No type safety here unfrotunately
|
|
872
|
-
}
|
|
873
|
-
static calcPosition(e, results, paging) {
|
|
874
|
-
return (paging ? ((paging.pageNumber - 1) * paging.pageSize) : 0) + (results.data.indexOf(e) + 1);
|
|
875
|
-
}
|
|
876
|
-
static reduceEntityAttributeForFormControl(formGroup, e, dateRangeConfigList) {
|
|
877
|
-
return Object.keys(formGroup.controls).reduce(reduceEntityAttributeForFormControlByControlName, {});
|
|
878
|
-
function reduceEntityAttributeForFormControlByControlName(formControl, ctrlName) {
|
|
879
|
-
if (e) {
|
|
880
|
-
let includesOfDateRangeConfig = false;
|
|
881
|
-
if (dateRangeConfigList) {
|
|
882
|
-
for (const dateRangeConfig of dateRangeConfigList) {
|
|
883
|
-
if (dateRangeConfig
|
|
884
|
-
&& [dateRangeConfig.dateRangeControlName,
|
|
885
|
-
dateRangeConfig.fromDateControlName, dateRangeConfig.toDateControlName].includes(ctrlName)) {
|
|
886
|
-
includesOfDateRangeConfig = true;
|
|
887
|
-
switch (ctrlName) {
|
|
888
|
-
case dateRangeConfig.dateRangeControlName:
|
|
889
|
-
formControl[ctrlName] = {
|
|
890
|
-
fromDate: e[dateRangeConfig.fromDateControlName] ? e[dateRangeConfig.fromDateControlName] : null,
|
|
891
|
-
toDate: e[dateRangeConfig.toDateControlName] ? e[dateRangeConfig.toDateControlName] : null
|
|
892
|
-
};
|
|
893
|
-
break;
|
|
894
|
-
case dateRangeConfig.fromDateControlName:
|
|
895
|
-
formControl[ctrlName] = e[ctrlName];
|
|
896
|
-
if (formControl[dateRangeConfig.dateRangeControlName]
|
|
897
|
-
&& typeof (formControl[dateRangeConfig.dateRangeControlName]) === 'object') {
|
|
898
|
-
formControl[dateRangeConfig.dateRangeControlName].fromDate = e[ctrlName];
|
|
899
|
-
}
|
|
900
|
-
break;
|
|
901
|
-
case dateRangeConfig.toDateControlName:
|
|
902
|
-
formControl[ctrlName] = e[ctrlName];
|
|
903
|
-
if (formControl[dateRangeConfig.dateRangeControlName]
|
|
904
|
-
&& typeof (formControl[dateRangeConfig.dateRangeControlName]) === 'object') {
|
|
905
|
-
formControl[dateRangeConfig.dateRangeControlName].toDate = e[ctrlName];
|
|
906
|
-
}
|
|
907
|
-
break;
|
|
908
|
-
default:
|
|
909
|
-
break;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
if (!includesOfDateRangeConfig) {
|
|
915
|
-
if (typeof (e[ctrlName]) === 'boolean') {
|
|
916
|
-
formControl[ctrlName] = e[ctrlName] ? '1' : '0';
|
|
917
|
-
}
|
|
918
|
-
else if (e[ctrlName] instanceof Array) {
|
|
919
|
-
formControl[ctrlName] = e[ctrlName];
|
|
920
|
-
}
|
|
921
|
-
else if (typeof (e[ctrlName]) === 'object') {
|
|
922
|
-
formControl[ctrlName] = e[ctrlName]
|
|
923
|
-
? (e[ctrlName].id
|
|
924
|
-
? e[ctrlName].id
|
|
925
|
-
: (e[ctrlName].code ? e[ctrlName].code : ''))
|
|
926
|
-
: null;
|
|
927
|
-
}
|
|
928
|
-
else {
|
|
929
|
-
formControl[ctrlName] = (e[ctrlName] != null && e[ctrlName] != undefined) ? e[ctrlName] : '';
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
else {
|
|
934
|
-
formControl[ctrlName] = '';
|
|
935
|
-
}
|
|
936
|
-
return formControl;
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
static cloneAbstractControl(control) {
|
|
940
|
-
let newControl;
|
|
941
|
-
if (control instanceof FormGroup) {
|
|
942
|
-
const formGroup = new FormGroup({}, control.validator, control.asyncValidator);
|
|
943
|
-
const controls = control.controls;
|
|
944
|
-
if (controls) {
|
|
945
|
-
Object.keys(controls).forEach(key => {
|
|
946
|
-
const tempControl = UtilsService.cloneAbstractControl(controls[key]);
|
|
947
|
-
if (tempControl) {
|
|
948
|
-
formGroup.addControl(key, tempControl);
|
|
949
|
-
}
|
|
950
|
-
});
|
|
951
|
-
}
|
|
952
|
-
newControl = formGroup;
|
|
953
|
-
}
|
|
954
|
-
else if (control instanceof FormArray) {
|
|
955
|
-
const formArray = new FormArray([], control.validator, control.asyncValidator);
|
|
956
|
-
const controls = control.controls;
|
|
957
|
-
if (controls) {
|
|
958
|
-
controls.forEach((formControl) => {
|
|
959
|
-
const tempControl = UtilsService.cloneAbstractControl(formControl);
|
|
960
|
-
if (tempControl) {
|
|
961
|
-
formArray.push(tempControl);
|
|
962
|
-
}
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
newControl = formArray;
|
|
966
|
-
}
|
|
967
|
-
else if (control instanceof FormControl || this.isNgControl(control)) {
|
|
968
|
-
newControl = new FormControl(control.value, control.validator, control.asyncValidator);
|
|
969
|
-
}
|
|
970
|
-
else {
|
|
971
|
-
console.error('Error: unexpected formControl value', control);
|
|
972
|
-
}
|
|
973
|
-
if (control.disabled && newControl)
|
|
974
|
-
newControl.disable({ emitEvent: false });
|
|
975
|
-
return newControl;
|
|
976
|
-
}
|
|
977
|
-
static isNgControl(control) {
|
|
978
|
-
return control && 'control' in control;
|
|
979
|
-
}
|
|
980
|
-
static convertTreeDataToAutocompleteData(treeFields, symbol, hasChildFn, nodes, prefixDisplayValue) {
|
|
981
|
-
let result = [];
|
|
982
|
-
if (treeFields) {
|
|
983
|
-
for (const node of nodes) {
|
|
984
|
-
const value = treeFields.value(node).toString();
|
|
985
|
-
const displayValue = prefixDisplayValue ? prefixDisplayValue + symbol + treeFields.display(node) : treeFields.display(node);
|
|
986
|
-
const hasChild = hasChildFn(0, node);
|
|
987
|
-
if (hasChild) {
|
|
988
|
-
const childen = treeFields.children(node);
|
|
989
|
-
result.push(...this.convertTreeDataToAutocompleteData(treeFields, symbol, hasChildFn, childen, displayValue));
|
|
990
|
-
}
|
|
991
|
-
else {
|
|
992
|
-
result.push(new SelectModel(value, displayValue, hasChild, node));
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
return result;
|
|
997
|
-
}
|
|
998
1001
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: UtilsService, deps: [{ token: i1$1.MatDialog }, { token: i1.TranslateService }, { token: i3$1.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
999
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: UtilsService });
|
|
1002
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: UtilsService, providedIn: 'root' });
|
|
1000
1003
|
}
|
|
1001
1004
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: UtilsService, decorators: [{
|
|
1002
|
-
type: Injectable
|
|
1005
|
+
type: Injectable,
|
|
1006
|
+
args: [{ providedIn: 'root' }]
|
|
1003
1007
|
}], ctorParameters: () => [{ type: i1$1.MatDialog }, { type: i1.TranslateService }, { type: i3$1.ToastrService }] });
|
|
1004
1008
|
|
|
1005
1009
|
class ApiService {
|
|
@@ -1045,7 +1049,7 @@ class ApiService {
|
|
|
1045
1049
|
delete(nativeUrl, options, baseUrl) {
|
|
1046
1050
|
return this.http.delete(baseUrl ? (baseUrl + nativeUrl) : this.getFullUrl(nativeUrl), options ? {
|
|
1047
1051
|
headers: options.headers,
|
|
1048
|
-
params: options.params
|
|
1052
|
+
params: options.params,
|
|
1049
1053
|
} : {});
|
|
1050
1054
|
}
|
|
1051
1055
|
saveFile(nativeUrl, obj, options, baseUrl, onErrorFunc) {
|
|
@@ -1076,10 +1080,11 @@ class ApiService {
|
|
|
1076
1080
|
});
|
|
1077
1081
|
}
|
|
1078
1082
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ApiService, deps: [{ token: i1$3.HttpClient }, { token: i2$1.FileSaverService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1079
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ApiService });
|
|
1083
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ApiService, providedIn: 'root' });
|
|
1080
1084
|
}
|
|
1081
1085
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ApiService, decorators: [{
|
|
1082
|
-
type: Injectable
|
|
1086
|
+
type: Injectable,
|
|
1087
|
+
args: [{ providedIn: 'root' }]
|
|
1083
1088
|
}], ctorParameters: () => [{ type: i1$3.HttpClient }, { type: i2$1.FileSaverService }, { type: i0.Injector }] });
|
|
1084
1089
|
|
|
1085
1090
|
class FormStateService {
|
|
@@ -1089,10 +1094,11 @@ class FormStateService {
|
|
|
1089
1094
|
this.subject.next(mapState);
|
|
1090
1095
|
}
|
|
1091
1096
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: FormStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1092
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: FormStateService });
|
|
1097
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: FormStateService, providedIn: 'root' });
|
|
1093
1098
|
}
|
|
1094
1099
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: FormStateService, decorators: [{
|
|
1095
|
-
type: Injectable
|
|
1100
|
+
type: Injectable,
|
|
1101
|
+
args: [{ providedIn: 'root' }]
|
|
1096
1102
|
}] });
|
|
1097
1103
|
|
|
1098
1104
|
class AuthoritiesService {
|
|
@@ -1119,10 +1125,11 @@ class AuthoritiesService {
|
|
|
1119
1125
|
return this.me.authorities.map(x => x.authority.toString().toLowerCase()).includes(authority.toLowerCase());
|
|
1120
1126
|
}
|
|
1121
1127
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: AuthoritiesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1122
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: AuthoritiesService });
|
|
1128
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: AuthoritiesService, providedIn: 'root' });
|
|
1123
1129
|
}
|
|
1124
1130
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: AuthoritiesService, decorators: [{
|
|
1125
|
-
type: Injectable
|
|
1131
|
+
type: Injectable,
|
|
1132
|
+
args: [{ providedIn: 'root' }]
|
|
1126
1133
|
}] });
|
|
1127
1134
|
|
|
1128
1135
|
class BaseSearchComponent extends BaseTableComponent {
|
|
@@ -1135,15 +1142,15 @@ class BaseSearchComponent extends BaseTableComponent {
|
|
|
1135
1142
|
activatedRoute;
|
|
1136
1143
|
authoritiesService;
|
|
1137
1144
|
formGroup;
|
|
1138
|
-
moduleName = '';
|
|
1139
|
-
unsubscribe$ = new Subject();
|
|
1140
|
-
isResetPaging = true;
|
|
1141
1145
|
isAdvancedSearch = false;
|
|
1142
1146
|
searchForm;
|
|
1143
1147
|
paging;
|
|
1144
1148
|
results = new MatTableDataSource([]);
|
|
1145
1149
|
columns = [];
|
|
1146
1150
|
config;
|
|
1151
|
+
moduleName = '';
|
|
1152
|
+
unsubscribe$ = new Subject();
|
|
1153
|
+
isResetPaging = true;
|
|
1147
1154
|
constructor(router, apiService, utilsService, formStateService, translateService, injector, activatedRoute, authoritiesService, formGroup) {
|
|
1148
1155
|
super(activatedRoute, authoritiesService);
|
|
1149
1156
|
this.router = router;
|
|
@@ -1219,41 +1226,6 @@ class BaseSearchComponent extends BaseTableComponent {
|
|
|
1219
1226
|
afterSearch = (data) => {
|
|
1220
1227
|
// Form extends will be override custom by business
|
|
1221
1228
|
};
|
|
1222
|
-
afterFillData = (data) => {
|
|
1223
|
-
this.isResetPaging = false;
|
|
1224
|
-
if (data.content && data.content.length > 0) {
|
|
1225
|
-
this.columns.forEach((column) => {
|
|
1226
|
-
column.isShowHeader = false;
|
|
1227
|
-
});
|
|
1228
|
-
}
|
|
1229
|
-
this.afterSearch(data);
|
|
1230
|
-
this.results = new MatTableDataSource(data.content);
|
|
1231
|
-
this.paging = new TablePagingRequestModel();
|
|
1232
|
-
this.paging.pageSize = data.size ? data.size : 0;
|
|
1233
|
-
this.paging.pageNumber = (data.number ? data.number : 0) + 1;
|
|
1234
|
-
this.paging.totalElements = data.totalElements ? data.totalElements : 0;
|
|
1235
|
-
};
|
|
1236
|
-
removeEmptyParams(params) {
|
|
1237
|
-
params.keys().forEach(key => {
|
|
1238
|
-
const value = params.get(key) ? params.get(key) + '' : '';
|
|
1239
|
-
if (value) {
|
|
1240
|
-
params = params.set(key, value.trim());
|
|
1241
|
-
}
|
|
1242
|
-
});
|
|
1243
|
-
const emptyValuesKey = params.keys().filter(key => !params.get(key));
|
|
1244
|
-
emptyValuesKey.forEach(key => {
|
|
1245
|
-
params = params.delete(key);
|
|
1246
|
-
});
|
|
1247
|
-
return params;
|
|
1248
|
-
}
|
|
1249
|
-
updateHttpParams(params) {
|
|
1250
|
-
params = this.removeEmptyParams(params);
|
|
1251
|
-
if (!params.keys().includes('pageNumber')) {
|
|
1252
|
-
params = params.append('pageNumber', this.isResetPaging ? '1' : (this.paging ? this.paging.pageNumber.toString() : '1'))
|
|
1253
|
-
.append('pageSize', this.paging ? this.paging.pageSize.toString() : this.config.PAGE_SIZE.toString());
|
|
1254
|
-
}
|
|
1255
|
-
return params;
|
|
1256
|
-
}
|
|
1257
1229
|
_fillData(nativeUrl, params, baseUrl) {
|
|
1258
1230
|
params = this.updateHttpParams(params);
|
|
1259
1231
|
this.apiService.get(nativeUrl, params, baseUrl).subscribe(this.afterFillData);
|
|
@@ -1303,6 +1275,41 @@ class BaseSearchComponent extends BaseTableComponent {
|
|
|
1303
1275
|
});
|
|
1304
1276
|
return result;
|
|
1305
1277
|
}
|
|
1278
|
+
afterFillData = (data) => {
|
|
1279
|
+
this.isResetPaging = false;
|
|
1280
|
+
if (data.content && data.content.length > 0) {
|
|
1281
|
+
this.columns.forEach((column) => {
|
|
1282
|
+
column.isShowHeader = false;
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
this.afterSearch(data);
|
|
1286
|
+
this.results = new MatTableDataSource(data.content);
|
|
1287
|
+
this.paging = new TablePagingRequestModel();
|
|
1288
|
+
this.paging.pageSize = data.page.size ? data.page.size : 0;
|
|
1289
|
+
this.paging.pageNumber = (data.page.number ? data.page.number : 0) + 1;
|
|
1290
|
+
this.paging.totalElements = data.page.totalElements ? data.page.totalElements : 0;
|
|
1291
|
+
};
|
|
1292
|
+
removeEmptyParams(params) {
|
|
1293
|
+
params.keys().forEach(key => {
|
|
1294
|
+
const value = params.get(key) ? params.get(key) + '' : '';
|
|
1295
|
+
if (value) {
|
|
1296
|
+
params = params.set(key, value.trim());
|
|
1297
|
+
}
|
|
1298
|
+
});
|
|
1299
|
+
const emptyValuesKey = params.keys().filter(key => !params.get(key));
|
|
1300
|
+
emptyValuesKey.forEach(key => {
|
|
1301
|
+
params = params.delete(key);
|
|
1302
|
+
});
|
|
1303
|
+
return params;
|
|
1304
|
+
}
|
|
1305
|
+
updateHttpParams(params) {
|
|
1306
|
+
params = this.removeEmptyParams(params);
|
|
1307
|
+
if (!params.keys().includes('pageNumber')) {
|
|
1308
|
+
params = params.append('pageNumber', this.isResetPaging ? '1' : (this.paging ? this.paging.pageNumber.toString() : '1'))
|
|
1309
|
+
.append('pageSize', this.paging ? this.paging.pageSize.toString() : this.config.PAGE_SIZE.toString());
|
|
1310
|
+
}
|
|
1311
|
+
return params;
|
|
1312
|
+
}
|
|
1306
1313
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: BaseSearchComponent, deps: [{ token: i1$4.Router }, { token: ApiService }, { token: UtilsService }, { token: FormStateService }, { token: i1.TranslateService }, { token: i0.Injector }, { token: i1$4.ActivatedRoute }, { token: AuthoritiesService }, { token: i1$2.FormGroup }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1307
1314
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.5", type: BaseSearchComponent, isStandalone: false, selector: "BaseSearchComponent", usesInheritance: true, ngImport: i0 });
|
|
1308
1315
|
}
|
|
@@ -1524,10 +1531,11 @@ class TableService {
|
|
|
1524
1531
|
class LoaderService {
|
|
1525
1532
|
isLoading = new BehaviorSubject(false);
|
|
1526
1533
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: LoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1527
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: LoaderService });
|
|
1534
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: LoaderService, providedIn: 'root' });
|
|
1528
1535
|
}
|
|
1529
1536
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: LoaderService, decorators: [{
|
|
1530
|
-
type: Injectable
|
|
1537
|
+
type: Injectable,
|
|
1538
|
+
args: [{ providedIn: 'root' }]
|
|
1531
1539
|
}] });
|
|
1532
1540
|
|
|
1533
1541
|
class ValidatorService {
|
|
@@ -1745,7 +1753,7 @@ class ValidatorService {
|
|
|
1745
1753
|
required: ValidatorService.getRequired(column),
|
|
1746
1754
|
maxLength: column.max ? column.max(row) : undefined,
|
|
1747
1755
|
minLength: column.min ? column.min(row) : undefined,
|
|
1748
|
-
pattern: undefined
|
|
1756
|
+
pattern: undefined,
|
|
1749
1757
|
}));
|
|
1750
1758
|
}
|
|
1751
1759
|
tempControl.updateValueAndValidity();
|
|
@@ -1790,10 +1798,11 @@ class ValidatorService {
|
|
|
1790
1798
|
return validator;
|
|
1791
1799
|
}
|
|
1792
1800
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ValidatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1793
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ValidatorService });
|
|
1801
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ValidatorService, providedIn: 'root' });
|
|
1794
1802
|
}
|
|
1795
1803
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: ValidatorService, decorators: [{
|
|
1796
|
-
type: Injectable
|
|
1804
|
+
type: Injectable,
|
|
1805
|
+
args: [{ providedIn: 'root' }]
|
|
1797
1806
|
}] });
|
|
1798
1807
|
|
|
1799
1808
|
class CvaCounterInputComponent {
|
|
@@ -3574,7 +3583,7 @@ class DateUtilService {
|
|
|
3574
3583
|
}
|
|
3575
3584
|
convertToDateIgnoreTimeZone(dateStr) {
|
|
3576
3585
|
if (dateStr != null) {
|
|
3577
|
-
return new Date(dateStr.replace(
|
|
3586
|
+
return new Date(dateStr.replace('Z', ''));
|
|
3578
3587
|
}
|
|
3579
3588
|
else {
|
|
3580
3589
|
return null;
|
|
@@ -3584,10 +3593,11 @@ class DateUtilService {
|
|
|
3584
3593
|
return date ? new Date(date.replace(' ', 'T')) : new Date(1900, 1, 1);
|
|
3585
3594
|
}
|
|
3586
3595
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DateUtilService, deps: [{ token: i2.DatePipe }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3587
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DateUtilService });
|
|
3596
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DateUtilService, providedIn: 'root' });
|
|
3588
3597
|
}
|
|
3589
3598
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: DateUtilService, decorators: [{
|
|
3590
|
-
type: Injectable
|
|
3599
|
+
type: Injectable,
|
|
3600
|
+
args: [{ providedIn: 'root' }]
|
|
3591
3601
|
}], ctorParameters: () => [{ type: i2.DatePipe }, { type: i0.Injector }] });
|
|
3592
3602
|
|
|
3593
3603
|
class CvaDatePickerComponent {
|
|
@@ -8597,10 +8607,11 @@ class JsogHttpInterceptor {
|
|
|
8597
8607
|
}));
|
|
8598
8608
|
}
|
|
8599
8609
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: JsogHttpInterceptor, deps: [{ token: i1$6.JsogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8600
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: JsogHttpInterceptor });
|
|
8610
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: JsogHttpInterceptor, providedIn: 'root' });
|
|
8601
8611
|
}
|
|
8602
8612
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: JsogHttpInterceptor, decorators: [{
|
|
8603
|
-
type: Injectable
|
|
8613
|
+
type: Injectable,
|
|
8614
|
+
args: [{ providedIn: 'root' }]
|
|
8604
8615
|
}], ctorParameters: () => [{ type: i1$6.JsogService }] });
|
|
8605
8616
|
|
|
8606
8617
|
class LoaderInterceptor {
|
|
@@ -8624,7 +8635,7 @@ class LoaderInterceptor {
|
|
|
8624
8635
|
}
|
|
8625
8636
|
else {
|
|
8626
8637
|
request = request.clone({
|
|
8627
|
-
headers: request.headers.delete('is_image')
|
|
8638
|
+
headers: request.headers.delete('is_image'),
|
|
8628
8639
|
});
|
|
8629
8640
|
}
|
|
8630
8641
|
return next.handle(request).pipe(map((event) => {
|
|
@@ -8643,10 +8654,11 @@ class LoaderInterceptor {
|
|
|
8643
8654
|
}));
|
|
8644
8655
|
}
|
|
8645
8656
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: LoaderInterceptor, deps: [{ token: LoaderService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8646
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: LoaderInterceptor });
|
|
8657
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: LoaderInterceptor, providedIn: 'root' });
|
|
8647
8658
|
}
|
|
8648
8659
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: LoaderInterceptor, decorators: [{
|
|
8649
|
-
type: Injectable
|
|
8660
|
+
type: Injectable,
|
|
8661
|
+
args: [{ providedIn: 'root' }]
|
|
8650
8662
|
}], ctorParameters: () => [{ type: LoaderService }] });
|
|
8651
8663
|
|
|
8652
8664
|
class AuthoritiesResolverService {
|
|
@@ -8665,20 +8677,22 @@ class AuthoritiesResolverService {
|
|
|
8665
8677
|
: this.apiService.get('/user/me', new HttpParams(), this.config.BASE_AUTHORIZATION_URL);
|
|
8666
8678
|
}
|
|
8667
8679
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: AuthoritiesResolverService, deps: [{ token: AuthoritiesService }, { token: i0.Injector }, { token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8668
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: AuthoritiesResolverService });
|
|
8680
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: AuthoritiesResolverService, providedIn: 'root' });
|
|
8669
8681
|
}
|
|
8670
8682
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: AuthoritiesResolverService, decorators: [{
|
|
8671
|
-
type: Injectable
|
|
8683
|
+
type: Injectable,
|
|
8684
|
+
args: [{ providedIn: 'root' }]
|
|
8672
8685
|
}], ctorParameters: () => [{ type: AuthoritiesService }, { type: i0.Injector }, { type: ApiService }] });
|
|
8673
8686
|
|
|
8674
8687
|
class SingletonTranslateService {
|
|
8675
8688
|
currentLanguage = new BehaviorSubject('');
|
|
8676
8689
|
currentLanguage$ = this.currentLanguage.asObservable();
|
|
8677
8690
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: SingletonTranslateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8678
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: SingletonTranslateService });
|
|
8691
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: SingletonTranslateService, providedIn: 'root' });
|
|
8679
8692
|
}
|
|
8680
8693
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: SingletonTranslateService, decorators: [{
|
|
8681
|
-
type: Injectable
|
|
8694
|
+
type: Injectable,
|
|
8695
|
+
args: [{ providedIn: 'root' }]
|
|
8682
8696
|
}] });
|
|
8683
8697
|
|
|
8684
8698
|
const MATERIAL_MODULES = [
|