ng-firebase-table-kxp 1.0.0 → 1.0.2
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 +500 -381
- package/esm2020/lib/components/table/table.component.mjs +776 -0
- package/esm2020/lib/firebase-table-kxp-lib.component.mjs +19 -0
- package/esm2020/lib/firebase-table-kxp-lib.module.mjs +74 -0
- package/esm2020/lib/firebase-table-kxp-lib.service.mjs +14 -0
- package/esm2020/lib/services/table.service.mjs +908 -0
- package/esm2020/lib/types/Table.mjs +2 -0
- package/esm2020/ng-firebase-table-kxp.mjs +5 -0
- package/esm2020/public-api.mjs +15 -0
- package/fesm2015/ng-firebase-table-kxp.mjs +1811 -0
- package/fesm2015/ng-firebase-table-kxp.mjs.map +1 -0
- package/fesm2020/ng-firebase-table-kxp.mjs +1784 -0
- package/fesm2020/ng-firebase-table-kxp.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/table/table.component.d.ts +111 -0
- package/lib/firebase-table-kxp-lib.component.d.ts +5 -0
- package/lib/firebase-table-kxp-lib.module.d.ts +21 -0
- package/lib/firebase-table-kxp-lib.service.d.ts +6 -0
- package/lib/services/table.service.d.ts +70 -0
- package/{src/lib/types/Table.ts → lib/types/Table.d.ts} +28 -31
- package/package.json +23 -3
- package/{src/public-api.ts → public-api.d.ts} +0 -13
- package/CHANGELOG.md +0 -88
- package/ng-package.json +0 -7
- package/src/lib/components/table/table.component.html +0 -555
- package/src/lib/components/table/table.component.scss +0 -22
- package/src/lib/components/table/table.component.spec.ts +0 -24
- package/src/lib/components/table/table.component.ts +0 -917
- package/src/lib/firebase-table-kxp-lib.component.spec.ts +0 -23
- package/src/lib/firebase-table-kxp-lib.component.ts +0 -15
- package/src/lib/firebase-table-kxp-lib.module.ts +0 -45
- package/src/lib/firebase-table-kxp-lib.service.spec.ts +0 -16
- package/src/lib/firebase-table-kxp-lib.service.ts +0 -9
- package/src/lib/services/table.service.spec.ts +0 -16
- package/src/lib/services/table.service.ts +0 -1235
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
DocumentReference,
|
|
4
|
-
QueryDocumentSnapshot
|
|
5
|
-
} from '@angular/fire/compat/firestore';
|
|
6
|
-
import {PipeTransform} from '@angular/core';
|
|
1
|
+
import { CollectionReference, DocumentReference, QueryDocumentSnapshot } from '@angular/fire/compat/firestore';
|
|
2
|
+
import { PipeTransform } from '@angular/core';
|
|
7
3
|
import firebase from 'firebase/compat';
|
|
8
4
|
import WhereFilterOp = firebase.firestore.WhereFilterOp;
|
|
9
|
-
import {OrderByDirection} from 'firebase/firestore';
|
|
10
|
-
|
|
5
|
+
import { OrderByDirection } from 'firebase/firestore';
|
|
11
6
|
export interface TableData {
|
|
12
7
|
displayedColumns: Column[];
|
|
13
8
|
filterableOptions?: FilterableOption[];
|
|
14
9
|
collectionRef: CollectionReference<unknown>;
|
|
15
10
|
collection: string;
|
|
16
11
|
name: string;
|
|
17
|
-
totalRef?: {
|
|
12
|
+
totalRef?: {
|
|
13
|
+
ref: DocumentReference<unknown>;
|
|
14
|
+
field: string;
|
|
15
|
+
}[];
|
|
18
16
|
download: boolean;
|
|
19
17
|
pagination: boolean;
|
|
20
18
|
isNotClickable?: boolean;
|
|
21
19
|
url?: string;
|
|
22
|
-
sortBy?: {
|
|
20
|
+
sortBy?: {
|
|
21
|
+
field: string;
|
|
22
|
+
order: OrderByDirection;
|
|
23
|
+
};
|
|
23
24
|
conditions?: {
|
|
24
25
|
operator: WhereFilterOp;
|
|
25
26
|
firestoreProperty: string;
|
|
26
27
|
dashProperty: string | string[];
|
|
27
28
|
}[];
|
|
28
29
|
filterFn?: (item: any) => boolean;
|
|
29
|
-
color?: {
|
|
30
|
+
color?: {
|
|
31
|
+
bg: string;
|
|
32
|
+
text: string;
|
|
33
|
+
};
|
|
30
34
|
actionButton?: {
|
|
31
35
|
label: string;
|
|
32
36
|
routerLink: string;
|
|
@@ -37,18 +41,15 @@ export interface TableData {
|
|
|
37
41
|
};
|
|
38
42
|
tabs?: Tab;
|
|
39
43
|
}
|
|
40
|
-
|
|
41
44
|
export interface Tab {
|
|
42
45
|
method: (tab: any, event?: any) => any;
|
|
43
46
|
tabsData: TabData[];
|
|
44
47
|
}
|
|
45
|
-
|
|
46
48
|
export interface TabData {
|
|
47
49
|
label: string;
|
|
48
50
|
counter?: number;
|
|
49
51
|
counterClass?: string;
|
|
50
52
|
}
|
|
51
|
-
|
|
52
53
|
export interface Column {
|
|
53
54
|
property: string;
|
|
54
55
|
title?: string;
|
|
@@ -82,14 +83,12 @@ export interface Column {
|
|
|
82
83
|
calculateValue?: (row: any) => any;
|
|
83
84
|
arrayField?: string;
|
|
84
85
|
}
|
|
85
|
-
|
|
86
86
|
export interface Image {
|
|
87
87
|
class: string;
|
|
88
88
|
path?: string;
|
|
89
89
|
url?: boolean;
|
|
90
90
|
default?: string;
|
|
91
91
|
}
|
|
92
|
-
|
|
93
92
|
export interface FilterableOption {
|
|
94
93
|
title: string;
|
|
95
94
|
items: {
|
|
@@ -98,7 +97,6 @@ export interface FilterableOption {
|
|
|
98
97
|
label: string;
|
|
99
98
|
}[];
|
|
100
99
|
}
|
|
101
|
-
|
|
102
100
|
export interface Pagination {
|
|
103
101
|
batchSize: number;
|
|
104
102
|
collection: string;
|
|
@@ -113,30 +111,29 @@ export interface Pagination {
|
|
|
113
111
|
size?: number;
|
|
114
112
|
clientPageIndex?: number;
|
|
115
113
|
}
|
|
116
|
-
|
|
117
114
|
export interface Condition {
|
|
118
115
|
operator: WhereFilterOp;
|
|
119
116
|
firestoreProperty: string;
|
|
120
117
|
dashProperty: string | string[];
|
|
121
118
|
}
|
|
122
|
-
|
|
123
119
|
export interface Arrange {
|
|
124
120
|
filters: {
|
|
125
|
-
arrange:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
| 'equals'
|
|
131
|
-
| '';
|
|
132
|
-
filter?: {property: string; filtering: string} | null;
|
|
121
|
+
arrange: 'ascending' | 'descending' | 'filter' | 'filterByDate' | 'equals' | '';
|
|
122
|
+
filter?: {
|
|
123
|
+
property: string;
|
|
124
|
+
filtering: string;
|
|
125
|
+
} | null;
|
|
133
126
|
dateFilter?: {
|
|
134
127
|
initial: Date;
|
|
135
128
|
final: Date;
|
|
136
129
|
};
|
|
137
130
|
}[];
|
|
138
|
-
sortBy: {
|
|
139
|
-
|
|
131
|
+
sortBy: {
|
|
132
|
+
field: string;
|
|
133
|
+
order: OrderByDirection;
|
|
134
|
+
};
|
|
135
|
+
elementId?: {
|
|
136
|
+
property: string;
|
|
137
|
+
value: string;
|
|
138
|
+
};
|
|
140
139
|
}
|
|
141
|
-
|
|
142
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng-firebase-table-kxp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Uma biblioteca Angular poderosa para criar tabelas dinâmicas com integração completa ao Firebase Firestore",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "https://github.com/
|
|
18
|
+
"url": "https://github.com/kxptech/ng-firebase-table-kxp"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@angular/common": "^15.0.0",
|
|
@@ -32,5 +32,25 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"tslib": "^2.3.0"
|
|
35
|
-
}
|
|
35
|
+
},
|
|
36
|
+
"module": "fesm2015/ng-firebase-table-kxp.mjs",
|
|
37
|
+
"es2020": "fesm2020/ng-firebase-table-kxp.mjs",
|
|
38
|
+
"esm2020": "esm2020/ng-firebase-table-kxp.mjs",
|
|
39
|
+
"fesm2020": "fesm2020/ng-firebase-table-kxp.mjs",
|
|
40
|
+
"fesm2015": "fesm2015/ng-firebase-table-kxp.mjs",
|
|
41
|
+
"typings": "index.d.ts",
|
|
42
|
+
"exports": {
|
|
43
|
+
"./package.json": {
|
|
44
|
+
"default": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
".": {
|
|
47
|
+
"types": "./index.d.ts",
|
|
48
|
+
"esm2020": "./esm2020/ng-firebase-table-kxp.mjs",
|
|
49
|
+
"es2020": "./fesm2020/ng-firebase-table-kxp.mjs",
|
|
50
|
+
"es2015": "./fesm2015/ng-firebase-table-kxp.mjs",
|
|
51
|
+
"node": "./fesm2015/ng-firebase-table-kxp.mjs",
|
|
52
|
+
"default": "./fesm2020/ng-firebase-table-kxp.mjs"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"sideEffects": false
|
|
36
56
|
}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of firebase-table-kxp-lib
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// Main module
|
|
6
1
|
export * from './lib/firebase-table-kxp-lib.module';
|
|
7
|
-
|
|
8
|
-
// Legacy components (se existirem)
|
|
9
2
|
export * from './lib/firebase-table-kxp-lib.service';
|
|
10
3
|
export * from './lib/firebase-table-kxp-lib.component';
|
|
11
|
-
|
|
12
|
-
// Components
|
|
13
4
|
export * from './lib/components/table/table.component';
|
|
14
|
-
|
|
15
|
-
// Services
|
|
16
5
|
export * from './lib/services/table.service';
|
|
17
|
-
|
|
18
|
-
// Types
|
|
19
6
|
export * from './lib/types/Table';
|
package/CHANGELOG.md
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
Todas as mudanças notáveis neste projeto serão documentadas neste arquivo.
|
|
4
|
-
|
|
5
|
-
O formato é baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.0.0/),
|
|
6
|
-
e este projeto adere ao [Versionamento Semântico](https://semver.org/lang/pt-BR/).
|
|
7
|
-
|
|
8
|
-
## [Unreleased]
|
|
9
|
-
|
|
10
|
-
## [0.0.1] - 2024-11-03
|
|
11
|
-
|
|
12
|
-
### Adicionado
|
|
13
|
-
- ✨ Componente principal de tabela (`TableComponent`)
|
|
14
|
-
- 🔥 Integração completa com Firebase Firestore
|
|
15
|
-
- 📊 Sistema de paginação avançado (client-side e server-side)
|
|
16
|
-
- 🔍 Sistema de filtros:
|
|
17
|
-
- Filtro por texto
|
|
18
|
-
- Filtro por data
|
|
19
|
-
- Filtro por igualdade (equals)
|
|
20
|
-
- Filtros personalizados com dropdown
|
|
21
|
-
- Função de filtro customizada (filterFn)
|
|
22
|
-
- ⚡ Fallback automático client-side quando índices compostos não existem
|
|
23
|
-
- 📈 Rastreamento automático de índices ausentes
|
|
24
|
-
- 🔗 Suporte a relações entre collections
|
|
25
|
-
- 🖼️ Suporte a exibição de imagens
|
|
26
|
-
- 🎯 Botões de ação customizáveis
|
|
27
|
-
- 📥 Sistema de exportação de dados
|
|
28
|
-
- 🎨 Interface Material Design responsiva
|
|
29
|
-
- 📝 Suporte a valores calculados
|
|
30
|
-
- 🔢 Suporte a arrays e propriedades aninhadas
|
|
31
|
-
- 💬 Tooltips para valores longos com charLimit
|
|
32
|
-
- 🎨 Customização de cores e estilos
|
|
33
|
-
- 📑 Sistema de tabs
|
|
34
|
-
- 🔄 Método público `reloadTable()` para atualização manual
|
|
35
|
-
- 📊 Query lengths para contar documentos relacionados
|
|
36
|
-
|
|
37
|
-
### Serviços
|
|
38
|
-
- `TableService` com métodos:
|
|
39
|
-
- `getPaginated()` - Paginação otimizada
|
|
40
|
-
- `getItems()` - Buscar todos os itens
|
|
41
|
-
- `getItemsData()` - Buscar itens com filtros
|
|
42
|
-
- `executeClientSideQuery()` - Fallback client-side
|
|
43
|
-
- `deleteIndex()` - Deletar com reindexação
|
|
44
|
-
- `dateFormatValidator()` - Validador de data
|
|
45
|
-
- `operators` - Operadores de comparação
|
|
46
|
-
|
|
47
|
-
### Tipos
|
|
48
|
-
- `TableData` - Interface principal de configuração
|
|
49
|
-
- `Column` - Interface de configuração de colunas
|
|
50
|
-
- `Arrange` - Interface de arranjo (filtros e ordenação)
|
|
51
|
-
- `Condition` - Interface de condições where
|
|
52
|
-
- `Pagination` - Interface de paginação
|
|
53
|
-
- `FilterableOption` - Interface de opções filtráveis
|
|
54
|
-
- `Tab` e `TabData` - Interfaces para tabs
|
|
55
|
-
- `Image` - Interface para imagens
|
|
56
|
-
|
|
57
|
-
### Documentação
|
|
58
|
-
- README.md completo com exemplos
|
|
59
|
-
- USAGE_EXAMPLE.md com casos de uso detalhados
|
|
60
|
-
- BUILD.md com guia de publicação
|
|
61
|
-
- CHANGELOG.md
|
|
62
|
-
|
|
63
|
-
### Dependências Peer
|
|
64
|
-
- @angular/common ^15.0.0
|
|
65
|
-
- @angular/core ^15.0.0
|
|
66
|
-
- @angular/forms ^15.0.0
|
|
67
|
-
- @angular/router ^15.0.0
|
|
68
|
-
- @angular/material ^15.0.0
|
|
69
|
-
- @angular/cdk ^15.0.0
|
|
70
|
-
- @angular/fire ^7.0.0
|
|
71
|
-
- firebase ^9.0.0
|
|
72
|
-
- ngx-toastr ^16.0.0
|
|
73
|
-
- moment ^2.29.0
|
|
74
|
-
- ngx-mask ^15.0.0
|
|
75
|
-
|
|
76
|
-
## Tipos de Mudanças
|
|
77
|
-
|
|
78
|
-
- `Added` - para novas funcionalidades
|
|
79
|
-
- `Changed` - para mudanças em funcionalidades existentes
|
|
80
|
-
- `Deprecated` - para funcionalidades que serão removidas
|
|
81
|
-
- `Removed` - para funcionalidades removidas
|
|
82
|
-
- `Fixed` - para correção de bugs
|
|
83
|
-
- `Security` - para vulnerabilidades de segurança
|
|
84
|
-
|
|
85
|
-
[Unreleased]: https://github.com/adryanmmm/firebase-table-kxp-lib/compare/v0.0.1...HEAD
|
|
86
|
-
[0.0.1]: https://github.com/adryanmmm/firebase-table-kxp-lib/releases/tag/v0.0.1
|
|
87
|
-
|
|
88
|
-
|