ng-firebase-table-kxp 1.2.6 → 1.2.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.
Files changed (34) hide show
  1. package/README.md +602 -602
  2. package/esm2020/lib/components/table/table.component.mjs +1559 -1557
  3. package/esm2020/lib/components/table-tabs/table-tabs.component.mjs +129 -129
  4. package/esm2020/lib/components/table-tooltip/table-tooltip.component.mjs +49 -49
  5. package/esm2020/lib/ng-firebase-table-kxp.component.mjs +14 -14
  6. package/esm2020/lib/ng-firebase-table-kxp.module.mjs +102 -102
  7. package/esm2020/lib/ng-firebase-table-kxp.service.mjs +14 -14
  8. package/esm2020/lib/services/filter.service.mjs +419 -416
  9. package/esm2020/lib/services/pagination.service.mjs +115 -115
  10. package/esm2020/lib/services/table.service.mjs +1140 -1140
  11. package/esm2020/lib/services/tooltip.service.mjs +141 -141
  12. package/esm2020/lib/types/Table.mjs +9 -9
  13. package/esm2020/lib/utils/table.utils.mjs +75 -75
  14. package/esm2020/ng-firebase-table-kxp.mjs +4 -4
  15. package/esm2020/public-api.mjs +22 -22
  16. package/fesm2015/ng-firebase-table-kxp.mjs +3966 -3960
  17. package/fesm2015/ng-firebase-table-kxp.mjs.map +1 -1
  18. package/fesm2020/ng-firebase-table-kxp.mjs +3668 -3663
  19. package/fesm2020/ng-firebase-table-kxp.mjs.map +1 -1
  20. package/index.d.ts +5 -5
  21. package/lib/components/table/table.component.d.ts +135 -135
  22. package/lib/components/table-tabs/table-tabs.component.d.ts +34 -34
  23. package/lib/components/table-tooltip/table-tooltip.component.d.ts +18 -18
  24. package/lib/ng-firebase-table-kxp.component.d.ts +5 -5
  25. package/lib/ng-firebase-table-kxp.module.d.ts +24 -24
  26. package/lib/ng-firebase-table-kxp.service.d.ts +6 -6
  27. package/lib/services/filter.service.d.ts +88 -88
  28. package/lib/services/pagination.service.d.ts +34 -34
  29. package/lib/services/table.service.d.ts +80 -80
  30. package/lib/services/tooltip.service.d.ts +73 -73
  31. package/lib/types/Table.d.ts +162 -162
  32. package/lib/utils/table.utils.d.ts +25 -25
  33. package/package.json +1 -1
  34. package/public-api.d.ts +12 -12
@@ -1,34 +1,34 @@
1
- import { PageEvent } from '@angular/material/paginator';
2
- import * as i0 from "@angular/core";
3
- export interface PaginationState {
4
- currentPageNumber: number;
5
- currentClientPageIndex: number;
6
- pageSize: number;
7
- totalItems: number;
8
- hasNextPage: boolean;
9
- }
10
- export interface NavigationResult {
11
- direction: 'forward' | 'backward' | 'reload';
12
- resetDocs: boolean;
13
- originalPageSize: number | null;
14
- shouldNavigate: boolean;
15
- newClientPageIndex: number;
16
- newPageNumber: number;
17
- }
18
- export declare class PaginationService {
19
- calculateNavigation(event: PageEvent, currentState: PaginationState): NavigationResult;
20
- /**
21
- * Calcula o número de itens esperados na última página
22
- */
23
- calculateLastPageItemCount(totalItems: number, pageSize: number): number;
24
- /**
25
- * Calcula o índice da última página
26
- */
27
- calculateLastPageIndex(totalItems: number, pageSize: number): number;
28
- /**
29
- * Verifica se deve mostrar o botão de próxima página
30
- */
31
- shouldShowNextButton(hasNextPage: boolean, isPaginated: boolean): boolean;
32
- static ɵfac: i0.ɵɵFactoryDeclaration<PaginationService, never>;
33
- static ɵprov: i0.ɵɵInjectableDeclaration<PaginationService>;
34
- }
1
+ import { PageEvent } from '@angular/material/paginator';
2
+ import * as i0 from "@angular/core";
3
+ export interface PaginationState {
4
+ currentPageNumber: number;
5
+ currentClientPageIndex: number;
6
+ pageSize: number;
7
+ totalItems: number;
8
+ hasNextPage: boolean;
9
+ }
10
+ export interface NavigationResult {
11
+ direction: 'forward' | 'backward' | 'reload';
12
+ resetDocs: boolean;
13
+ originalPageSize: number | null;
14
+ shouldNavigate: boolean;
15
+ newClientPageIndex: number;
16
+ newPageNumber: number;
17
+ }
18
+ export declare class PaginationService {
19
+ calculateNavigation(event: PageEvent, currentState: PaginationState): NavigationResult;
20
+ /**
21
+ * Calcula o número de itens esperados na última página
22
+ */
23
+ calculateLastPageItemCount(totalItems: number, pageSize: number): number;
24
+ /**
25
+ * Calcula o índice da última página
26
+ */
27
+ calculateLastPageIndex(totalItems: number, pageSize: number): number;
28
+ /**
29
+ * Verifica se deve mostrar o botão de próxima página
30
+ */
31
+ shouldShowNextButton(hasNextPage: boolean, isPaginated: boolean): boolean;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaginationService, never>;
33
+ static ɵprov: i0.ɵɵInjectableDeclaration<PaginationService>;
34
+ }
@@ -1,80 +1,80 @@
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: Array<Record<string, unknown> & {
10
- id: string;
11
- }>;
12
- filterLength: number | null;
13
- firstDoc: firebase.firestore.QueryDocumentSnapshot<unknown> | null;
14
- lastDoc: firebase.firestore.QueryDocumentSnapshot<unknown> | null;
15
- hasNextPage: boolean;
16
- hasPreviousPage?: boolean;
17
- currentClientPageIndex?: number;
18
- totalPages?: number;
19
- }
20
- export declare class TableService {
21
- private ngFire;
22
- private dialog;
23
- private toastr;
24
- constructor(ngFire: AngularFirestore, dialog: MatDialog, toastr: ToastrService);
25
- getItems(collection: CollectionReference<unknown>): Promise<Array<Record<string, unknown> & {
26
- id: string;
27
- }>>;
28
- private executeQuery;
29
- applyFilters(query: firebase.firestore.Query<unknown>, arrange: Arrange, conditions: Condition[] | undefined): firebase.firestore.Query<unknown>;
30
- private getIdFilter;
31
- private getDocumentById;
32
- private searchByIdPartial;
33
- private shouldUseClientSideFallback;
34
- getPaginated(params: Pagination): Promise<PaginationResult>;
35
- executeClientSideQuery(params: Pagination): Promise<PaginationResult>;
36
- getItemsData(collection: string, arrange: Arrange, conditions?: Condition[] | undefined): Promise<Array<Record<string, unknown> & {
37
- id: string;
38
- }>>;
39
- operators: {
40
- '==': (a: unknown, b: unknown) => boolean;
41
- '!=': (a: unknown, b: unknown) => boolean;
42
- '>': (a: unknown, b: unknown) => boolean;
43
- '<': (a: unknown, b: unknown) => boolean;
44
- '>=': (a: unknown, b: unknown) => boolean;
45
- '<=': (a: unknown, b: unknown) => boolean;
46
- in: (a: unknown, b: unknown) => boolean;
47
- 'not-in': (a: unknown, b: unknown) => boolean;
48
- 'array-contains': (a: unknown, b: unknown) => boolean;
49
- 'array-contains-any': (a: unknown, b: unknown) => boolean;
50
- includes: (a: unknown, b: unknown) => boolean;
51
- };
52
- deleteIndex(id: string, col: string): Promise<boolean>;
53
- reindex(index: number, col: string, batch: firebase.firestore.WriteBatch): Promise<void>;
54
- dateFormatValidator(): ValidatorFn;
55
- updateIndex(index: number, id: string, col: string): Promise<void>;
56
- /**
57
- * Extrai o link de criação de índice da mensagem de erro do Firestore
58
- */
59
- private extractIndexLink;
60
- /**
61
- * Rastreia índices ausentes ao usar fallback preventivo
62
- */
63
- private trackMissingIndexPreventive;
64
- /**
65
- * Gera uma assinatura única para uma query
66
- */
67
- private generateQuerySignature;
68
- /**
69
- * Gera instruções claras para criar o índice manualmente
70
- */
71
- private generateIndexInstructions;
72
- /**
73
- * Gera um link de índice baseado na estrutura da query
74
- */
75
- private generateIndexLink;
76
- private trackMissingIndex;
77
- static ɵfac: i0.ɵɵFactoryDeclaration<TableService, [{ optional: true; }, { optional: true; }, { optional: true; }]>;
78
- static ɵprov: i0.ɵɵInjectableDeclaration<TableService>;
79
- }
80
- 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: Array<Record<string, unknown> & {
10
+ id: string;
11
+ }>;
12
+ filterLength: number | null;
13
+ firstDoc: firebase.firestore.QueryDocumentSnapshot<unknown> | null;
14
+ lastDoc: firebase.firestore.QueryDocumentSnapshot<unknown> | null;
15
+ hasNextPage: boolean;
16
+ hasPreviousPage?: boolean;
17
+ currentClientPageIndex?: number;
18
+ totalPages?: number;
19
+ }
20
+ export declare class TableService {
21
+ private ngFire;
22
+ private dialog;
23
+ private toastr;
24
+ constructor(ngFire: AngularFirestore, dialog: MatDialog, toastr: ToastrService);
25
+ getItems(collection: CollectionReference<unknown>): Promise<Array<Record<string, unknown> & {
26
+ id: string;
27
+ }>>;
28
+ private executeQuery;
29
+ applyFilters(query: firebase.firestore.Query<unknown>, arrange: Arrange, conditions: Condition[] | undefined): firebase.firestore.Query<unknown>;
30
+ private getIdFilter;
31
+ private getDocumentById;
32
+ private searchByIdPartial;
33
+ private shouldUseClientSideFallback;
34
+ getPaginated(params: Pagination): Promise<PaginationResult>;
35
+ executeClientSideQuery(params: Pagination): Promise<PaginationResult>;
36
+ getItemsData(collection: string, arrange: Arrange, conditions?: Condition[] | undefined): Promise<Array<Record<string, unknown> & {
37
+ id: string;
38
+ }>>;
39
+ operators: {
40
+ '==': (a: unknown, b: unknown) => boolean;
41
+ '!=': (a: unknown, b: unknown) => boolean;
42
+ '>': (a: unknown, b: unknown) => boolean;
43
+ '<': (a: unknown, b: unknown) => boolean;
44
+ '>=': (a: unknown, b: unknown) => boolean;
45
+ '<=': (a: unknown, b: unknown) => boolean;
46
+ in: (a: unknown, b: unknown) => boolean;
47
+ 'not-in': (a: unknown, b: unknown) => boolean;
48
+ 'array-contains': (a: unknown, b: unknown) => boolean;
49
+ 'array-contains-any': (a: unknown, b: unknown) => boolean;
50
+ includes: (a: unknown, b: unknown) => boolean;
51
+ };
52
+ deleteIndex(id: string, col: string): Promise<boolean>;
53
+ reindex(index: number, col: string, batch: firebase.firestore.WriteBatch): Promise<void>;
54
+ dateFormatValidator(): ValidatorFn;
55
+ updateIndex(index: number, id: string, col: string): Promise<void>;
56
+ /**
57
+ * Extrai o link de criação de índice da mensagem de erro do Firestore
58
+ */
59
+ private extractIndexLink;
60
+ /**
61
+ * Rastreia índices ausentes ao usar fallback preventivo
62
+ */
63
+ private trackMissingIndexPreventive;
64
+ /**
65
+ * Gera uma assinatura única para uma query
66
+ */
67
+ private generateQuerySignature;
68
+ /**
69
+ * Gera instruções claras para criar o índice manualmente
70
+ */
71
+ private generateIndexInstructions;
72
+ /**
73
+ * Gera um link de índice baseado na estrutura da query
74
+ */
75
+ private generateIndexLink;
76
+ private trackMissingIndex;
77
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableService, [{ optional: true; }, { optional: true; }, { optional: true; }]>;
78
+ static ɵprov: i0.ɵɵInjectableDeclaration<TableService>;
79
+ }
80
+ export {};
@@ -1,73 +1,73 @@
1
- import { Column } from '../types/Table';
2
- import * as i0 from "@angular/core";
3
- export interface TooltipState {
4
- hoveredCell: {
5
- row: any;
6
- col: any;
7
- } | null;
8
- showTooltip: boolean;
9
- tooltipContent: string;
10
- tooltipPosition: {
11
- x: number;
12
- y: number;
13
- };
14
- tooltipBgColor: string;
15
- tooltipBgStyle: {
16
- [key: string]: string;
17
- } | null;
18
- tooltipTextColor: string;
19
- tooltipTextStyle: {
20
- [key: string]: string;
21
- } | null;
22
- }
23
- export interface TooltipConfig {
24
- color?: string;
25
- text?: string;
26
- }
27
- export declare class TooltipService {
28
- private tooltipTimeout;
29
- /**
30
- * Cria um estado inicial para o tooltip
31
- */
32
- createInitialState(): TooltipState;
33
- /**
34
- * Processa as cores do tooltip
35
- */
36
- processTooltipColors(config?: TooltipConfig): {
37
- bgColor: string;
38
- bgStyle: {
39
- [key: string]: string;
40
- } | null;
41
- textColor: string;
42
- textStyle: {
43
- [key: string]: string;
44
- } | null;
45
- };
46
- /**
47
- * Manipula o evento de mouse enter na célula
48
- */
49
- handleMouseEnter(event: MouseEvent, row: any, col: Column, getDisplayValue: (col: Column, row: any, withinLimit: boolean) => string, onShow: (state: Partial<TooltipState>) => void): void;
50
- /**
51
- * Manipula o evento de mouse leave na célula
52
- */
53
- handleMouseLeave(onHide: (state: TooltipState) => void): void;
54
- /**
55
- * Manipula o movimento do mouse
56
- */
57
- handleMouseMove(event: MouseEvent, showTooltip: boolean, onMove: (position: {
58
- x: number;
59
- y: number;
60
- }) => void): void;
61
- /**
62
- * Combina estilos do tooltip para aplicação
63
- */
64
- getTooltipStyles(state: TooltipState): {
65
- [key: string]: string;
66
- };
67
- /**
68
- * Limpa recursos ao destruir
69
- */
70
- destroy(): void;
71
- static ɵfac: i0.ɵɵFactoryDeclaration<TooltipService, never>;
72
- static ɵprov: i0.ɵɵInjectableDeclaration<TooltipService>;
73
- }
1
+ import { Column } from '../types/Table';
2
+ import * as i0 from "@angular/core";
3
+ export interface TooltipState {
4
+ hoveredCell: {
5
+ row: any;
6
+ col: any;
7
+ } | null;
8
+ showTooltip: boolean;
9
+ tooltipContent: string;
10
+ tooltipPosition: {
11
+ x: number;
12
+ y: number;
13
+ };
14
+ tooltipBgColor: string;
15
+ tooltipBgStyle: {
16
+ [key: string]: string;
17
+ } | null;
18
+ tooltipTextColor: string;
19
+ tooltipTextStyle: {
20
+ [key: string]: string;
21
+ } | null;
22
+ }
23
+ export interface TooltipConfig {
24
+ color?: string;
25
+ text?: string;
26
+ }
27
+ export declare class TooltipService {
28
+ private tooltipTimeout;
29
+ /**
30
+ * Cria um estado inicial para o tooltip
31
+ */
32
+ createInitialState(): TooltipState;
33
+ /**
34
+ * Processa as cores do tooltip
35
+ */
36
+ processTooltipColors(config?: TooltipConfig): {
37
+ bgColor: string;
38
+ bgStyle: {
39
+ [key: string]: string;
40
+ } | null;
41
+ textColor: string;
42
+ textStyle: {
43
+ [key: string]: string;
44
+ } | null;
45
+ };
46
+ /**
47
+ * Manipula o evento de mouse enter na célula
48
+ */
49
+ handleMouseEnter(event: MouseEvent, row: any, col: Column, getDisplayValue: (col: Column, row: any, withinLimit: boolean) => string, onShow: (state: Partial<TooltipState>) => void): void;
50
+ /**
51
+ * Manipula o evento de mouse leave na célula
52
+ */
53
+ handleMouseLeave(onHide: (state: TooltipState) => void): void;
54
+ /**
55
+ * Manipula o movimento do mouse
56
+ */
57
+ handleMouseMove(event: MouseEvent, showTooltip: boolean, onMove: (position: {
58
+ x: number;
59
+ y: number;
60
+ }) => void): void;
61
+ /**
62
+ * Combina estilos do tooltip para aplicação
63
+ */
64
+ getTooltipStyles(state: TooltipState): {
65
+ [key: string]: string;
66
+ };
67
+ /**
68
+ * Limpa recursos ao destruir
69
+ */
70
+ destroy(): void;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipService, never>;
72
+ static ɵprov: i0.ɵɵInjectableDeclaration<TooltipService>;
73
+ }