ng-firebase-table-kxp 1.0.7 → 1.0.8
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/README.md +602 -602
- package/esm2020/lib/components/table/table.component.mjs +804 -801
- package/esm2020/lib/ng-firebase-table-kxp.component.mjs +11 -11
- package/esm2020/lib/ng-firebase-table-kxp.module.mjs +81 -74
- package/esm2020/lib/ng-firebase-table-kxp.service.mjs +14 -14
- package/esm2020/lib/services/table.service.mjs +1113 -905
- package/esm2020/lib/types/Table.mjs +2 -2
- package/esm2020/ng-firebase-table-kxp.mjs +4 -4
- package/esm2020/public-api.mjs +15 -15
- package/fesm2015/ng-firebase-table-kxp.mjs +1992 -1774
- package/fesm2015/ng-firebase-table-kxp.mjs.map +1 -1
- package/fesm2020/ng-firebase-table-kxp.mjs +1964 -1747
- package/fesm2020/ng-firebase-table-kxp.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/components/table/table.component.d.ts +112 -112
- package/lib/ng-firebase-table-kxp.component.d.ts +5 -5
- package/lib/ng-firebase-table-kxp.module.d.ts +22 -21
- package/lib/ng-firebase-table-kxp.service.d.ts +6 -6
- package/lib/services/table.service.d.ts +74 -74
- package/lib/types/Table.d.ts +139 -139
- package/package.json +1 -1
- package/public-api.d.ts +6 -6
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
/// <amd-module name="ng-firebase-table-kxp" />
|
|
5
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="ng-firebase-table-kxp" />
|
|
5
|
+
export * from './public-api';
|
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
import { Arrange, Condition, TableData } from '../../types/Table';
|
|
2
|
-
import { OnInit } from '@angular/core';
|
|
3
|
-
import { AngularFirestore } from '@angular/fire/compat/firestore';
|
|
4
|
-
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
|
5
|
-
import { MatSort } from '@angular/material/sort';
|
|
6
|
-
import { MatTableDataSource } from '@angular/material/table';
|
|
7
|
-
import { Router } from '@angular/router';
|
|
8
|
-
import { TableService } from '../../services/table.service';
|
|
9
|
-
import firebase from 'firebase/compat';
|
|
10
|
-
import WhereFilterOp = firebase.firestore.WhereFilterOp;
|
|
11
|
-
import { FormControl, FormArray, FormGroup } from '@angular/forms';
|
|
12
|
-
import * as i0 from "@angular/core";
|
|
13
|
-
export declare class TableComponent implements OnInit {
|
|
14
|
-
private router;
|
|
15
|
-
private tableService;
|
|
16
|
-
private firestore;
|
|
17
|
-
data: TableData;
|
|
18
|
-
downloadTable?: (arrange: Arrange, conditions: Condition[]) => void;
|
|
19
|
-
arrange: Arrange | null;
|
|
20
|
-
dataSource: MatTableDataSource<any>;
|
|
21
|
-
currentPageNumber: number;
|
|
22
|
-
currentClientPageIndex: number;
|
|
23
|
-
items: any[];
|
|
24
|
-
isLoading: boolean;
|
|
25
|
-
private lastDoc;
|
|
26
|
-
private firstDoc;
|
|
27
|
-
private sortBy;
|
|
28
|
-
columnProperties: string[];
|
|
29
|
-
filtersForm: FormArray;
|
|
30
|
-
selectSort: FormControl;
|
|
31
|
-
currentArrange: string;
|
|
32
|
-
hasNextPage: boolean;
|
|
33
|
-
dropdownItems: any[];
|
|
34
|
-
sortableDropdownItems: any[];
|
|
35
|
-
pageSize: number;
|
|
36
|
-
totalItems: number;
|
|
37
|
-
pageEvent?: PageEvent;
|
|
38
|
-
filterValue: string | null;
|
|
39
|
-
hasFilterableColumn: boolean;
|
|
40
|
-
hasSortableColumn: boolean;
|
|
41
|
-
filterPredicate: ((data: any, filter: string) => boolean) | undefined;
|
|
42
|
-
private filterSubject;
|
|
43
|
-
private readonly debounceTimeMs;
|
|
44
|
-
selectedTab: number;
|
|
45
|
-
paginator: MatPaginator;
|
|
46
|
-
sort: MatSort;
|
|
47
|
-
hoveredCell: {
|
|
48
|
-
row: any;
|
|
49
|
-
col: any;
|
|
50
|
-
} | null;
|
|
51
|
-
showTooltip: boolean;
|
|
52
|
-
tooltipTimeout: any;
|
|
53
|
-
tooltipContent: string;
|
|
54
|
-
tooltipPosition: {
|
|
55
|
-
x: number;
|
|
56
|
-
y: number;
|
|
57
|
-
};
|
|
58
|
-
constructor(router: Router, tableService: TableService, firestore: AngularFirestore);
|
|
59
|
-
createFilterGroup(): FormGroup;
|
|
60
|
-
addFilter(filterData?: {
|
|
61
|
-
selectFilter: any;
|
|
62
|
-
typeFilter?: string;
|
|
63
|
-
selectItem?: any[];
|
|
64
|
-
initialDate?: string;
|
|
65
|
-
finalDate?: string;
|
|
66
|
-
}): void;
|
|
67
|
-
onSelectFilterChange(): void;
|
|
68
|
-
removeFilter(index: number): void;
|
|
69
|
-
removeAllFilters(): void;
|
|
70
|
-
ngOnInit(): Promise<void>;
|
|
71
|
-
getDisplayValue(col: any, row: any, withinLimit?: boolean): string;
|
|
72
|
-
getNestedValue(obj: any, path: string): any;
|
|
73
|
-
private formatArrayValue;
|
|
74
|
-
private loadItems;
|
|
75
|
-
private loadItemsPaginated;
|
|
76
|
-
onPageChange(event?: PageEvent): Promise<void>;
|
|
77
|
-
applyFilter(value: string): void;
|
|
78
|
-
goToDetails(row: any): void;
|
|
79
|
-
getRelation(params: {
|
|
80
|
-
id: any;
|
|
81
|
-
collection: string;
|
|
82
|
-
newProperty: string;
|
|
83
|
-
}): Promise<string>;
|
|
84
|
-
private loadRelations;
|
|
85
|
-
getQueryLength(params: {
|
|
86
|
-
item: any;
|
|
87
|
-
relation: {
|
|
88
|
-
collection: string;
|
|
89
|
-
property: string;
|
|
90
|
-
operator: WhereFilterOp;
|
|
91
|
-
value: string;
|
|
92
|
-
};
|
|
93
|
-
}): Promise<number>;
|
|
94
|
-
private loadQueryLengths;
|
|
95
|
-
private filterItems;
|
|
96
|
-
search(): Promise<void>;
|
|
97
|
-
resetFilter(): Promise<void>;
|
|
98
|
-
reloadTable(): Promise<void>;
|
|
99
|
-
updateDisplayedColumns(): void;
|
|
100
|
-
isString(value: any): boolean;
|
|
101
|
-
onCellMouseEnter(event: MouseEvent, row: any, col: any): void;
|
|
102
|
-
onCellMouseLeave(): void;
|
|
103
|
-
onCellMouseMove(event: MouseEvent): void;
|
|
104
|
-
getTabGroups(tabs: any[]): number[];
|
|
105
|
-
getTabGroup(tabs: any[], groupIndex: number): any[];
|
|
106
|
-
getRealTabIndex(groupIndex: number, tabIndexInGroup: number): number;
|
|
107
|
-
onTableSelected(i: number, j: number): void;
|
|
108
|
-
isTabSelected(originalIndex: number): boolean;
|
|
109
|
-
shouldShowActionButton(): boolean;
|
|
110
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
111
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "lib-table", never, { "data": "data"; "downloadTable": "downloadTable"; }, {}, never, never, false, never>;
|
|
112
|
-
}
|
|
1
|
+
import { Arrange, Condition, TableData } from '../../types/Table';
|
|
2
|
+
import { OnInit } from '@angular/core';
|
|
3
|
+
import { AngularFirestore } from '@angular/fire/compat/firestore';
|
|
4
|
+
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
|
5
|
+
import { MatSort } from '@angular/material/sort';
|
|
6
|
+
import { MatTableDataSource } from '@angular/material/table';
|
|
7
|
+
import { Router } from '@angular/router';
|
|
8
|
+
import { TableService } from '../../services/table.service';
|
|
9
|
+
import firebase from 'firebase/compat';
|
|
10
|
+
import WhereFilterOp = firebase.firestore.WhereFilterOp;
|
|
11
|
+
import { FormControl, FormArray, FormGroup } from '@angular/forms';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
export declare class TableComponent implements OnInit {
|
|
14
|
+
private router;
|
|
15
|
+
private tableService;
|
|
16
|
+
private firestore;
|
|
17
|
+
data: TableData;
|
|
18
|
+
downloadTable?: (arrange: Arrange, conditions: Condition[]) => void;
|
|
19
|
+
arrange: Arrange | null;
|
|
20
|
+
dataSource: MatTableDataSource<any>;
|
|
21
|
+
currentPageNumber: number;
|
|
22
|
+
currentClientPageIndex: number;
|
|
23
|
+
items: any[];
|
|
24
|
+
isLoading: boolean;
|
|
25
|
+
private lastDoc;
|
|
26
|
+
private firstDoc;
|
|
27
|
+
private sortBy;
|
|
28
|
+
columnProperties: string[];
|
|
29
|
+
filtersForm: FormArray;
|
|
30
|
+
selectSort: FormControl;
|
|
31
|
+
currentArrange: string;
|
|
32
|
+
hasNextPage: boolean;
|
|
33
|
+
dropdownItems: any[];
|
|
34
|
+
sortableDropdownItems: any[];
|
|
35
|
+
pageSize: number;
|
|
36
|
+
totalItems: number;
|
|
37
|
+
pageEvent?: PageEvent;
|
|
38
|
+
filterValue: string | null;
|
|
39
|
+
hasFilterableColumn: boolean;
|
|
40
|
+
hasSortableColumn: boolean;
|
|
41
|
+
filterPredicate: ((data: any, filter: string) => boolean) | undefined;
|
|
42
|
+
private filterSubject;
|
|
43
|
+
private readonly debounceTimeMs;
|
|
44
|
+
selectedTab: number;
|
|
45
|
+
paginator: MatPaginator;
|
|
46
|
+
sort: MatSort;
|
|
47
|
+
hoveredCell: {
|
|
48
|
+
row: any;
|
|
49
|
+
col: any;
|
|
50
|
+
} | null;
|
|
51
|
+
showTooltip: boolean;
|
|
52
|
+
tooltipTimeout: any;
|
|
53
|
+
tooltipContent: string;
|
|
54
|
+
tooltipPosition: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
};
|
|
58
|
+
constructor(router: Router, tableService: TableService, firestore: AngularFirestore);
|
|
59
|
+
createFilterGroup(): FormGroup;
|
|
60
|
+
addFilter(filterData?: {
|
|
61
|
+
selectFilter: any;
|
|
62
|
+
typeFilter?: string;
|
|
63
|
+
selectItem?: any[];
|
|
64
|
+
initialDate?: string;
|
|
65
|
+
finalDate?: string;
|
|
66
|
+
}): void;
|
|
67
|
+
onSelectFilterChange(): void;
|
|
68
|
+
removeFilter(index: number): void;
|
|
69
|
+
removeAllFilters(): void;
|
|
70
|
+
ngOnInit(): Promise<void>;
|
|
71
|
+
getDisplayValue(col: any, row: any, withinLimit?: boolean): string;
|
|
72
|
+
getNestedValue(obj: any, path: string): any;
|
|
73
|
+
private formatArrayValue;
|
|
74
|
+
private loadItems;
|
|
75
|
+
private loadItemsPaginated;
|
|
76
|
+
onPageChange(event?: PageEvent): Promise<void>;
|
|
77
|
+
applyFilter(value: string): void;
|
|
78
|
+
goToDetails(row: any): void;
|
|
79
|
+
getRelation(params: {
|
|
80
|
+
id: any;
|
|
81
|
+
collection: string;
|
|
82
|
+
newProperty: string;
|
|
83
|
+
}): Promise<string>;
|
|
84
|
+
private loadRelations;
|
|
85
|
+
getQueryLength(params: {
|
|
86
|
+
item: any;
|
|
87
|
+
relation: {
|
|
88
|
+
collection: string;
|
|
89
|
+
property: string;
|
|
90
|
+
operator: WhereFilterOp;
|
|
91
|
+
value: string;
|
|
92
|
+
};
|
|
93
|
+
}): Promise<number>;
|
|
94
|
+
private loadQueryLengths;
|
|
95
|
+
private filterItems;
|
|
96
|
+
search(): Promise<void>;
|
|
97
|
+
resetFilter(): Promise<void>;
|
|
98
|
+
reloadTable(): Promise<void>;
|
|
99
|
+
updateDisplayedColumns(): void;
|
|
100
|
+
isString(value: any): boolean;
|
|
101
|
+
onCellMouseEnter(event: MouseEvent, row: any, col: any): void;
|
|
102
|
+
onCellMouseLeave(): void;
|
|
103
|
+
onCellMouseMove(event: MouseEvent): void;
|
|
104
|
+
getTabGroups(tabs: any[]): number[];
|
|
105
|
+
getTabGroup(tabs: any[], groupIndex: number): any[];
|
|
106
|
+
getRealTabIndex(groupIndex: number, tabIndexInGroup: number): number;
|
|
107
|
+
onTableSelected(i: number, j: number): void;
|
|
108
|
+
isTabSelected(originalIndex: number): boolean;
|
|
109
|
+
shouldShowActionButton(): boolean;
|
|
110
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
111
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "lib-table", never, { "data": "data"; "downloadTable": "downloadTable"; }, {}, never, never, false, never>;
|
|
112
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class NgFirebaseTableKxpComponent {
|
|
3
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgFirebaseTableKxpComponent, never>;
|
|
4
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NgFirebaseTableKxpComponent, "lib-ng-firebase-table-kxp", never, {}, {}, never, never, false, never>;
|
|
5
|
-
}
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class NgFirebaseTableKxpComponent {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgFirebaseTableKxpComponent, never>;
|
|
4
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgFirebaseTableKxpComponent, "lib-ng-firebase-table-kxp", never, {}, {}, never, never, false, never>;
|
|
5
|
+
}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./ng-firebase-table-kxp.component";
|
|
3
|
-
import * as i2 from "./components/table/table.component";
|
|
4
|
-
import * as i3 from "@angular/common";
|
|
5
|
-
import * as i4 from "@angular/forms";
|
|
6
|
-
import * as i5 from "@angular/router";
|
|
7
|
-
import * as i6 from "@angular/material/table";
|
|
8
|
-
import * as i7 from "@angular/material/paginator";
|
|
9
|
-
import * as i8 from "@angular/material/sort";
|
|
10
|
-
import * as i9 from "@angular/material/form-field";
|
|
11
|
-
import * as i10 from "@angular/material/input";
|
|
12
|
-
import * as i11 from "@angular/material/select";
|
|
13
|
-
import * as i12 from "@angular/material/tooltip";
|
|
14
|
-
import * as i13 from "@angular/material/progress-spinner";
|
|
15
|
-
import * as i14 from "@angular/material/icon";
|
|
16
|
-
import * as i15 from "@angular/material/dialog";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
static
|
|
20
|
-
static
|
|
21
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./ng-firebase-table-kxp.component";
|
|
3
|
+
import * as i2 from "./components/table/table.component";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@angular/forms";
|
|
6
|
+
import * as i5 from "@angular/router";
|
|
7
|
+
import * as i6 from "@angular/material/table";
|
|
8
|
+
import * as i7 from "@angular/material/paginator";
|
|
9
|
+
import * as i8 from "@angular/material/sort";
|
|
10
|
+
import * as i9 from "@angular/material/form-field";
|
|
11
|
+
import * as i10 from "@angular/material/input";
|
|
12
|
+
import * as i11 from "@angular/material/select";
|
|
13
|
+
import * as i12 from "@angular/material/tooltip";
|
|
14
|
+
import * as i13 from "@angular/material/progress-spinner";
|
|
15
|
+
import * as i14 from "@angular/material/icon";
|
|
16
|
+
import * as i15 from "@angular/material/dialog";
|
|
17
|
+
import * as i16 from "ngx-mask";
|
|
18
|
+
export declare class NgFirebaseTableKxpModule {
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgFirebaseTableKxpModule, never>;
|
|
20
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgFirebaseTableKxpModule, [typeof i1.NgFirebaseTableKxpComponent, typeof i2.TableComponent], [typeof i3.CommonModule, typeof i4.ReactiveFormsModule, typeof i4.FormsModule, typeof i5.RouterModule, typeof i6.MatTableModule, typeof i7.MatPaginatorModule, typeof i8.MatSortModule, typeof i9.MatFormFieldModule, typeof i10.MatInputModule, typeof i11.MatSelectModule, typeof i12.MatTooltipModule, typeof i13.MatProgressSpinnerModule, typeof i14.MatIconModule, typeof i15.MatDialogModule, typeof i16.NgxMaskDirective, typeof i16.NgxMaskPipe], [typeof i1.NgFirebaseTableKxpComponent, typeof i2.TableComponent]>;
|
|
21
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgFirebaseTableKxpModule>;
|
|
22
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class NgFirebaseTableKxpService {
|
|
3
|
-
constructor();
|
|
4
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgFirebaseTableKxpService, never>;
|
|
5
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<NgFirebaseTableKxpService>;
|
|
6
|
-
}
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class NgFirebaseTableKxpService {
|
|
3
|
+
constructor();
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgFirebaseTableKxpService, never>;
|
|
5
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgFirebaseTableKxpService>;
|
|
6
|
+
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { AngularFirestore, CollectionReference } from '@angular/fire/compat/firestore';
|
|
2
|
-
import firebase from 'firebase/compat/app';
|
|
3
|
-
import { Arrange, Condition, Pagination } from '../types/Table';
|
|
4
|
-
import { MatDialog } from '@angular/material/dialog';
|
|
5
|
-
import { ToastrService } from 'ngx-toastr';
|
|
6
|
-
import { ValidatorFn } from '@angular/forms';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
interface PaginationResult {
|
|
9
|
-
items: any[];
|
|
10
|
-
filterLength: number | null;
|
|
11
|
-
firstDoc: firebase.firestore.QueryDocumentSnapshot<unknown> | null;
|
|
12
|
-
lastDoc: firebase.firestore.QueryDocumentSnapshot<unknown> | null;
|
|
13
|
-
hasNextPage: boolean;
|
|
14
|
-
hasPreviousPage?: boolean;
|
|
15
|
-
currentClientPageIndex?: number;
|
|
16
|
-
totalPages?: number;
|
|
17
|
-
}
|
|
18
|
-
export declare class TableService {
|
|
19
|
-
private ngFire;
|
|
20
|
-
private dialog;
|
|
21
|
-
private toastr;
|
|
22
|
-
constructor(ngFire: AngularFirestore, dialog: MatDialog, toastr: ToastrService);
|
|
23
|
-
getItems(collection: CollectionReference<unknown>): Promise<any[]>;
|
|
24
|
-
private executeQuery;
|
|
25
|
-
applyFilters(query: firebase.firestore.Query<unknown>, arrange: Arrange, conditions: Condition[] | undefined): firebase.firestore.Query<unknown>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
private shouldUseClientSideFallback;
|
|
30
|
-
getPaginated(params: Pagination): Promise<PaginationResult>;
|
|
31
|
-
executeClientSideQuery(params: Pagination): Promise<PaginationResult>;
|
|
32
|
-
getItemsData(collection: string, arrange: Arrange, conditions?: Condition[] | undefined): Promise<any[]>;
|
|
33
|
-
operators: {
|
|
34
|
-
'==': (a: any, b: any) => boolean;
|
|
35
|
-
'!=': (a: any, b: any) => boolean;
|
|
36
|
-
'>': (a: any, b: any) => boolean;
|
|
37
|
-
'<': (a: any, b: any) => boolean;
|
|
38
|
-
'>=': (a: any, b: any) => boolean;
|
|
39
|
-
'<=': (a: any, b: any) => boolean;
|
|
40
|
-
in: (a: any, b: any) => boolean;
|
|
41
|
-
'not-in': (a: any, b: any) => boolean;
|
|
42
|
-
'array-contains': (a: any, b: any) => boolean;
|
|
43
|
-
'array-contains-any': (a: any, b: any) => boolean;
|
|
44
|
-
includes: (a: any, b: any) => any;
|
|
45
|
-
};
|
|
46
|
-
deleteIndex(id: string, col: string): Promise<boolean>;
|
|
47
|
-
reindex(index: number, col: string, batch: firebase.firestore.WriteBatch): Promise<void>;
|
|
48
|
-
dateFormatValidator(): ValidatorFn;
|
|
49
|
-
updateIndex(index: number, id: string, col: string): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Extrai o link de criação de índice da mensagem de erro do Firestore
|
|
52
|
-
*/
|
|
53
|
-
private extractIndexLink;
|
|
54
|
-
/**
|
|
55
|
-
* Rastreia índices ausentes ao usar fallback preventivo
|
|
56
|
-
*/
|
|
57
|
-
private trackMissingIndexPreventive;
|
|
58
|
-
/**
|
|
59
|
-
* Gera uma assinatura única para uma query
|
|
60
|
-
*/
|
|
61
|
-
private generateQuerySignature;
|
|
62
|
-
/**
|
|
63
|
-
* Gera instruções claras para criar o índice manualmente
|
|
64
|
-
*/
|
|
65
|
-
private generateIndexInstructions;
|
|
66
|
-
/**
|
|
67
|
-
* Gera um link de índice baseado na estrutura da query
|
|
68
|
-
*/
|
|
69
|
-
private generateIndexLink;
|
|
70
|
-
private trackMissingIndex;
|
|
71
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TableService, [{ optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
72
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<TableService>;
|
|
73
|
-
}
|
|
74
|
-
export {};
|
|
1
|
+
import { AngularFirestore, CollectionReference } from '@angular/fire/compat/firestore';
|
|
2
|
+
import firebase from 'firebase/compat/app';
|
|
3
|
+
import { Arrange, Condition, Pagination } from '../types/Table';
|
|
4
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
5
|
+
import { ToastrService } from 'ngx-toastr';
|
|
6
|
+
import { ValidatorFn } from '@angular/forms';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
interface PaginationResult {
|
|
9
|
+
items: any[];
|
|
10
|
+
filterLength: number | null;
|
|
11
|
+
firstDoc: firebase.firestore.QueryDocumentSnapshot<unknown> | null;
|
|
12
|
+
lastDoc: firebase.firestore.QueryDocumentSnapshot<unknown> | null;
|
|
13
|
+
hasNextPage: boolean;
|
|
14
|
+
hasPreviousPage?: boolean;
|
|
15
|
+
currentClientPageIndex?: number;
|
|
16
|
+
totalPages?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class TableService {
|
|
19
|
+
private ngFire;
|
|
20
|
+
private dialog;
|
|
21
|
+
private toastr;
|
|
22
|
+
constructor(ngFire: AngularFirestore, dialog: MatDialog, toastr: ToastrService);
|
|
23
|
+
getItems(collection: CollectionReference<unknown>): Promise<any[]>;
|
|
24
|
+
private executeQuery;
|
|
25
|
+
applyFilters(query: firebase.firestore.Query<unknown>, arrange: Arrange, conditions: Condition[] | undefined): firebase.firestore.Query<unknown>;
|
|
26
|
+
private getIdFilter;
|
|
27
|
+
private getDocumentById;
|
|
28
|
+
private searchByIdPartial;
|
|
29
|
+
private shouldUseClientSideFallback;
|
|
30
|
+
getPaginated(params: Pagination): Promise<PaginationResult>;
|
|
31
|
+
executeClientSideQuery(params: Pagination): Promise<PaginationResult>;
|
|
32
|
+
getItemsData(collection: string, arrange: Arrange, conditions?: Condition[] | undefined): Promise<any[]>;
|
|
33
|
+
operators: {
|
|
34
|
+
'==': (a: any, b: any) => boolean;
|
|
35
|
+
'!=': (a: any, b: any) => boolean;
|
|
36
|
+
'>': (a: any, b: any) => boolean;
|
|
37
|
+
'<': (a: any, b: any) => boolean;
|
|
38
|
+
'>=': (a: any, b: any) => boolean;
|
|
39
|
+
'<=': (a: any, b: any) => boolean;
|
|
40
|
+
in: (a: any, b: any) => boolean;
|
|
41
|
+
'not-in': (a: any, b: any) => boolean;
|
|
42
|
+
'array-contains': (a: any, b: any) => boolean;
|
|
43
|
+
'array-contains-any': (a: any, b: any) => boolean;
|
|
44
|
+
includes: (a: any, b: any) => any;
|
|
45
|
+
};
|
|
46
|
+
deleteIndex(id: string, col: string): Promise<boolean>;
|
|
47
|
+
reindex(index: number, col: string, batch: firebase.firestore.WriteBatch): Promise<void>;
|
|
48
|
+
dateFormatValidator(): ValidatorFn;
|
|
49
|
+
updateIndex(index: number, id: string, col: string): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Extrai o link de criação de índice da mensagem de erro do Firestore
|
|
52
|
+
*/
|
|
53
|
+
private extractIndexLink;
|
|
54
|
+
/**
|
|
55
|
+
* Rastreia índices ausentes ao usar fallback preventivo
|
|
56
|
+
*/
|
|
57
|
+
private trackMissingIndexPreventive;
|
|
58
|
+
/**
|
|
59
|
+
* Gera uma assinatura única para uma query
|
|
60
|
+
*/
|
|
61
|
+
private generateQuerySignature;
|
|
62
|
+
/**
|
|
63
|
+
* Gera instruções claras para criar o índice manualmente
|
|
64
|
+
*/
|
|
65
|
+
private generateIndexInstructions;
|
|
66
|
+
/**
|
|
67
|
+
* Gera um link de índice baseado na estrutura da query
|
|
68
|
+
*/
|
|
69
|
+
private generateIndexLink;
|
|
70
|
+
private trackMissingIndex;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableService, [{ optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
72
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TableService>;
|
|
73
|
+
}
|
|
74
|
+
export {};
|