@masterkeymaterial/ui 0.0.8 → 0.1.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/README.md CHANGED
@@ -28,6 +28,99 @@ Depois da instalacao:
28
28
  npm ls @masterkeymaterial/ui
29
29
  ```
30
30
 
31
+ ## MkGrid (uso rapido)
32
+
33
+ O componente `MkGrid` ja esta disponivel na superficie publica da lib junto com os tipos de configuracao.
34
+
35
+ Exemplo minimo:
36
+
37
+ ```ts
38
+ import { Component, computed, signal } from '@angular/core';
39
+ import { IGridConfig, IGridFilterType, MkGrid, ScreenMode } from '@masterkeymaterial/ui';
40
+
41
+ interface IPessoa {
42
+ id: number;
43
+ nome: string;
44
+ email: string;
45
+ }
46
+
47
+ @Component({
48
+ selector: 'app-grid-demo',
49
+ standalone: true,
50
+ imports: [MkGrid],
51
+ template: `<lib-mk-grid [lista]="dados()" [config]="config()"></lib-mk-grid>`
52
+ })
53
+ export class GridDemoComponent {
54
+ dados = signal<IPessoa[]>([
55
+ { id: 1, nome: 'Ana', email: 'ana@mk.com' },
56
+ { id: 2, nome: 'Bruno', email: 'bruno@mk.com' },
57
+ ]);
58
+
59
+ itensPorPagina = signal(10);
60
+ isSelected = signal(false);
61
+ screen = computed(() => ScreenMode.Desktop);
62
+
63
+ config = signal<IGridConfig<IPessoa>>({
64
+ actionsTop: [],
65
+ actionsTopConfig: {
66
+ menuDisplay: 'Acoes',
67
+ menuIcon: 'more_vert',
68
+ showMenuIcon: true,
69
+ width: '120px',
70
+ widthMax: '120px',
71
+ widthMin: '80px',
72
+ aloneAlwaysOutside: false,
73
+ },
74
+ actionsLine: [],
75
+ actionsLineConfig: {
76
+ menuDisplay: 'Mais',
77
+ menuIcon: 'more_vert',
78
+ showMenuIcon: true,
79
+ width: '120px',
80
+ widthMax: '120px',
81
+ widthMin: '80px',
82
+ aloneAlwaysOutside: false,
83
+ headerDisplayMore: 'Acoes',
84
+ },
85
+ InativeRule: () => false,
86
+ colunas: [
87
+ { prop: 'nome', titulo: 'Nome', sortable: true },
88
+ { prop: 'email', titulo: 'E-mail', sortable: true },
89
+ ],
90
+ filterSearchIcon: 'search',
91
+ filterBarStartCollapsed: false,
92
+ screen: this.screen,
93
+ itensPorPagina: this.itensPorPagina,
94
+ nameEntity: 'Pessoa',
95
+ paginations: [
96
+ { k: 10, v: '10' },
97
+ { k: 25, v: '25' },
98
+ ],
99
+ primarykey: 'id',
100
+ showControlBar: true,
101
+ showSearch: true,
102
+ showFilterBar: true,
103
+ showGridMenu: true,
104
+ showInfoBar: true,
105
+ showMenuIcon: true,
106
+ showActionsLine: false,
107
+ showActionsTop: false,
108
+ showPagination: true,
109
+ isSelected: this.isSelected,
110
+ selectionMode: 'none',
111
+ hasError: false,
112
+ hasVerticalLine: true,
113
+ hasSeletor: false,
114
+ hasGrid: true,
115
+ isLoaded: true,
116
+ });
117
+ }
118
+ ```
119
+
120
+ Guia completo de uso e customizacao:
121
+
122
+ - `docs/08-mk-grid-guia-consumidor.md`
123
+
31
124
  ## Licenca
32
125
 
33
126
  MIT