@masterkeymaterial/ui 0.2.21 → 0.2.24
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/fesm2022/masterkeymaterial-ui.mjs +143 -60
- package/fesm2022/masterkeymaterial-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterkeymaterial-ui.d.ts +86 -22
- package/README.md +0 -137
package/package.json
CHANGED
|
@@ -990,7 +990,7 @@ interface IOrdenacao {
|
|
|
990
990
|
interface IPaginacao {
|
|
991
991
|
paginaAtual: number;
|
|
992
992
|
totalItens: number;
|
|
993
|
-
|
|
993
|
+
totalAgrupado: number;
|
|
994
994
|
}
|
|
995
995
|
interface IGridConfigActions {
|
|
996
996
|
inmenu?: boolean;
|
|
@@ -1022,21 +1022,56 @@ interface IActionsLineConfig extends IGridBaseActions {
|
|
|
1022
1022
|
headerClasse?: string;
|
|
1023
1023
|
}
|
|
1024
1024
|
interface IGridConfig<T> {
|
|
1025
|
+
colunas: IColuna<T>[];
|
|
1026
|
+
primarykey?: string;
|
|
1027
|
+
nameEntity?: string;
|
|
1028
|
+
actionsLine?: IGridConfigActions[];
|
|
1029
|
+
actionsLineConfig?: Partial<IActionsLineConfig>;
|
|
1030
|
+
showActionsLine?: boolean;
|
|
1031
|
+
actionsTop?: IGridConfigActions[];
|
|
1032
|
+
actionsTopConfig?: Partial<IGridBaseActions>;
|
|
1033
|
+
showActionsTop?: boolean;
|
|
1034
|
+
InativeRule?: (linha: any) => boolean;
|
|
1035
|
+
SelectionDisabledRule?: (linha: any) => boolean;
|
|
1036
|
+
backgroundHue?: (linha: any) => number;
|
|
1037
|
+
filterSearchIcon?: string;
|
|
1038
|
+
filterBarStartCollapsed?: boolean;
|
|
1039
|
+
paginations?: IKV[];
|
|
1040
|
+
paginationSize?: number;
|
|
1041
|
+
showControlBar?: boolean;
|
|
1042
|
+
showSearch?: boolean;
|
|
1043
|
+
showFilterBar?: boolean;
|
|
1044
|
+
showGridMenu?: boolean;
|
|
1045
|
+
showInfoBar?: boolean;
|
|
1046
|
+
showMenuIcon?: boolean;
|
|
1047
|
+
showPagination?: boolean;
|
|
1048
|
+
hasVerticalLine?: boolean;
|
|
1049
|
+
hasSeletor?: boolean;
|
|
1050
|
+
hasGrid?: boolean;
|
|
1051
|
+
minLineHeight?: string;
|
|
1052
|
+
isCompacted?: boolean;
|
|
1053
|
+
selectionMode?: 'single' | 'multiple' | 'none';
|
|
1054
|
+
startSelected?: any[];
|
|
1055
|
+
onSelected?: (linha: any, selecionados: any[]) => Promise<void> | void;
|
|
1056
|
+
onUnselected?: (linha: any, selecionados: any[]) => Promise<void> | void;
|
|
1057
|
+
onSelectionChanged?: (linha: any, selecionados: any[]) => Promise<void> | void;
|
|
1058
|
+
hasError?: boolean;
|
|
1059
|
+
isLoaded?: boolean;
|
|
1060
|
+
timeRequest?: number;
|
|
1061
|
+
lastGridEventAPI?: IGridEventAPI<T>;
|
|
1062
|
+
}
|
|
1063
|
+
declare const GRID_CONFIG_DEFAULTS: {
|
|
1064
|
+
primarykey: string;
|
|
1065
|
+
nameEntity: string | undefined;
|
|
1025
1066
|
actionsTop: IGridConfigActions[];
|
|
1026
1067
|
actionsTopConfig: IGridBaseActions;
|
|
1027
1068
|
actionsLine: IGridConfigActions[];
|
|
1028
1069
|
actionsLineConfig: IActionsLineConfig;
|
|
1029
|
-
InativeRule: (
|
|
1030
|
-
SelectionDisabledRule?: (linha: any) => boolean;
|
|
1031
|
-
colunas: IColuna<T>[];
|
|
1070
|
+
InativeRule: (_: any) => boolean;
|
|
1032
1071
|
filterSearchIcon: string;
|
|
1033
1072
|
filterBarStartCollapsed: boolean;
|
|
1034
|
-
screen: Signal<ScreenMode>;
|
|
1035
|
-
itensPorPagina: Signal<number>;
|
|
1036
|
-
lastGridEventAPI?: IGridEventAPI<T>;
|
|
1037
|
-
nameEntity: string | undefined;
|
|
1038
1073
|
paginations: IKV[];
|
|
1039
|
-
|
|
1074
|
+
paginationSize: number;
|
|
1040
1075
|
showControlBar: boolean;
|
|
1041
1076
|
showSearch: boolean;
|
|
1042
1077
|
showFilterBar: boolean;
|
|
@@ -1046,21 +1081,15 @@ interface IGridConfig<T> {
|
|
|
1046
1081
|
showActionsLine: boolean;
|
|
1047
1082
|
showActionsTop: boolean;
|
|
1048
1083
|
showPagination: boolean;
|
|
1049
|
-
|
|
1050
|
-
onSelected?: (linha: any, selecionados: any[]) => Promise<void> | void;
|
|
1051
|
-
onUnselected?: (linha: any, selecionados: any[]) => Promise<void> | void;
|
|
1052
|
-
onSelectionChanged?: (linha: any, selecionados: any[]) => Promise<void> | void;
|
|
1053
|
-
startSelected?: any[];
|
|
1054
|
-
selectionMode: 'single' | 'multiple' | 'none';
|
|
1084
|
+
selectionMode: "single" | "multiple" | "none";
|
|
1055
1085
|
hasError: boolean;
|
|
1056
1086
|
hasVerticalLine: boolean;
|
|
1057
1087
|
hasSeletor: boolean;
|
|
1058
1088
|
hasGrid: boolean;
|
|
1059
|
-
minLineHeight
|
|
1060
|
-
isCompacted
|
|
1089
|
+
minLineHeight: string;
|
|
1090
|
+
isCompacted: boolean;
|
|
1061
1091
|
isLoaded: boolean;
|
|
1062
|
-
|
|
1063
|
-
}
|
|
1092
|
+
};
|
|
1064
1093
|
interface IGridParam<T> {
|
|
1065
1094
|
coluna: IColuna<T>;
|
|
1066
1095
|
colunas: IColuna<T>[];
|
|
@@ -1139,6 +1168,10 @@ declare class MkGrid {
|
|
|
1139
1168
|
hasSeletor: _angular_core.ModelSignal<boolean>;
|
|
1140
1169
|
todosSelecionados: _angular_core.WritableSignal<boolean>;
|
|
1141
1170
|
isSelectingAll: _angular_core.WritableSignal<boolean>;
|
|
1171
|
+
pageSizeOptions: _angular_core.WritableSignal<IKV[] | undefined>;
|
|
1172
|
+
private windowWidth;
|
|
1173
|
+
private _resizeListener;
|
|
1174
|
+
currentDevice: _angular_core.Signal<"Mobile" | "Desktop">;
|
|
1142
1175
|
devMode: boolean;
|
|
1143
1176
|
maxActionsInLine: number;
|
|
1144
1177
|
eHost: ElementRef<any>;
|
|
@@ -1149,9 +1182,40 @@ declare class MkGrid {
|
|
|
1149
1182
|
protected gridId: string;
|
|
1150
1183
|
protected ordenacoesSignal: _angular_core.WritableSignal<IOrdenacao[]>;
|
|
1151
1184
|
protected paginacaoSignal: _angular_core.WritableSignal<IPaginacao>;
|
|
1185
|
+
protected cfg: _angular_core.Signal<{
|
|
1186
|
+
primarykey: string;
|
|
1187
|
+
nameEntity: string | undefined;
|
|
1188
|
+
actionsTop: IGridConfigActions[];
|
|
1189
|
+
actionsTopConfig: IGridBaseActions;
|
|
1190
|
+
actionsLine: IGridConfigActions[];
|
|
1191
|
+
actionsLineConfig: IActionsLineConfig;
|
|
1192
|
+
InativeRule: (_: any) => boolean;
|
|
1193
|
+
filterSearchIcon: string;
|
|
1194
|
+
filterBarStartCollapsed: boolean;
|
|
1195
|
+
paginations: IKV[];
|
|
1196
|
+
paginationSize: number;
|
|
1197
|
+
showControlBar: boolean;
|
|
1198
|
+
showSearch: boolean;
|
|
1199
|
+
showFilterBar: boolean;
|
|
1200
|
+
showGridMenu: boolean;
|
|
1201
|
+
showInfoBar: boolean;
|
|
1202
|
+
showMenuIcon: boolean;
|
|
1203
|
+
showActionsLine: boolean;
|
|
1204
|
+
showActionsTop: boolean;
|
|
1205
|
+
showPagination: boolean;
|
|
1206
|
+
selectionMode: "single" | "multiple" | "none";
|
|
1207
|
+
hasError: boolean;
|
|
1208
|
+
hasVerticalLine: boolean;
|
|
1209
|
+
hasSeletor: boolean;
|
|
1210
|
+
hasGrid: boolean;
|
|
1211
|
+
minLineHeight: string;
|
|
1212
|
+
isCompacted: boolean;
|
|
1213
|
+
isLoaded: boolean;
|
|
1214
|
+
} & IGridConfig<any>>;
|
|
1152
1215
|
performance: _angular_core.Signal<string>;
|
|
1153
|
-
itensPorPagina: _angular_core.Signal<number>;
|
|
1154
1216
|
constructor();
|
|
1217
|
+
paginationSize: _angular_core.ModelSignal<number | undefined>;
|
|
1218
|
+
paginationComputedSize: _angular_core.Signal<number>;
|
|
1155
1219
|
ngOnInit(): void;
|
|
1156
1220
|
ngOnDestroy(): void;
|
|
1157
1221
|
ngAfterViewInit(): void;
|
|
@@ -1211,7 +1275,7 @@ declare class MkGrid {
|
|
|
1211
1275
|
onResizeStart(event: MouseEvent, coluna: IColunaComLargura): void;
|
|
1212
1276
|
onDoubleClickControls(event: Event, coluna: IColunaComLargura): void;
|
|
1213
1277
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkGrid, never>;
|
|
1214
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkGrid, "lib-mk-grid", never, { "lista": { "alias": "lista"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "filtro": { "alias": "filtro"; "required": false; "isSignal": true; }; "minLineHeight": { "alias": "minLineHeight"; "required": false; "isSignal": true; }; "isCompacted": { "alias": "isCompacted"; "required": false; "isSignal": true; }; "hasGrid": { "alias": "hasGrid"; "required": false; "isSignal": true; }; "hasVerticalLine": { "alias": "hasVerticalLine"; "required": false; "isSignal": true; }; "hasSeletor": { "alias": "hasSeletor"; "required": false; "isSignal": true; }; }, { "minLineHeight": "minLineHeightChange"; "isCompacted": "isCompactedChange"; "hasGrid": "hasGridChange"; "hasVerticalLine": "hasVerticalLineChange"; "hasSeletor": "hasSeletorChange"; }, never, ["*", "[mkGridError]", "[mkGridLoading]"], true, never>;
|
|
1278
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkGrid, "lib-mk-grid", never, { "lista": { "alias": "lista"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "filtro": { "alias": "filtro"; "required": false; "isSignal": true; }; "minLineHeight": { "alias": "minLineHeight"; "required": false; "isSignal": true; }; "isCompacted": { "alias": "isCompacted"; "required": false; "isSignal": true; }; "hasGrid": { "alias": "hasGrid"; "required": false; "isSignal": true; }; "hasVerticalLine": { "alias": "hasVerticalLine"; "required": false; "isSignal": true; }; "hasSeletor": { "alias": "hasSeletor"; "required": false; "isSignal": true; }; "paginationSize": { "alias": "paginationSize"; "required": false; "isSignal": true; }; }, { "minLineHeight": "minLineHeightChange"; "isCompacted": "isCompactedChange"; "hasGrid": "hasGridChange"; "hasVerticalLine": "hasVerticalLineChange"; "hasSeletor": "hasSeletorChange"; "paginationSize": "paginationSizeChange"; }, never, ["*", "[mkGridError]", "[mkGridLoading]"], true, never>;
|
|
1215
1279
|
}
|
|
1216
1280
|
|
|
1217
1281
|
declare class GridCell {
|
|
@@ -1222,5 +1286,5 @@ declare class GridCell {
|
|
|
1222
1286
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<GridCell, "lib-grid-cell", never, {}, {}, never, never, true, never>;
|
|
1223
1287
|
}
|
|
1224
1288
|
|
|
1225
|
-
export { BaseFieldsForm, BaseFieldsValues, CampoDe, FieldsGeneric, FiltroDe, FormAction, FormFilter, FormNoAction, FormatedValues, Formulario, GRID_PARAMS_TOKEN, GridCell, IField, IGridFilterType, IRegraTipo, LibUtil, MkGrid, PAGINATION_OPTIONS, Regra, ScreenMode, SingleValues, UiButton, UiCheckBox, UiChip, UiDropZone, UiFileList, UiListErrors, UiLoading, UiMenu, UiProcurar, UiProgress, UiSelect, UiSlide };
|
|
1289
|
+
export { BaseFieldsForm, BaseFieldsValues, CampoDe, FieldsGeneric, FiltroDe, FormAction, FormFilter, FormNoAction, FormatedValues, Formulario, GRID_CONFIG_DEFAULTS, GRID_PARAMS_TOKEN, GridCell, IField, IGridFilterType, IRegraTipo, LibUtil, MkGrid, PAGINATION_OPTIONS, Regra, ScreenMode, SingleValues, UiButton, UiCheckBox, UiChip, UiDropZone, UiFileList, UiListErrors, UiLoading, UiMenu, UiProcurar, UiProgress, UiSelect, UiSlide };
|
|
1226
1290
|
export type { IActionClickEvent, IActionsDone, IActionsLineConfig, IClassOf, IColuna, IColunaImage, IDadosDaLinha, IDisplayValue, IDropOutput, IDropType, IDropZoneEvent, IFaseCampos, IFaseCamposAgrupados, IFases, IFieldComponent, IFields, IFileMetadata, IFilterFields, IFormatter, IGridBaseActions, IGridCellComponentConfig, IGridConfig, IGridConfigActions, IGridEventAPI, IGridFilter, IGridParam, IKV, IKV_ext, IMkCellService, IModeShowEntidade, IOptionValue, IOrdenacao, IPaginacao, IRegra, ISaveTasks, ITipoBotao, ITiposTema, IUiProgressMode, IUtilFormatters, MapeamentoItem };
|
package/README.md
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# @masterkeymaterial/ui
|
|
2
|
-
|
|
3
|
-
Guia de instalacao para consumidores da biblioteca.
|
|
4
|
-
|
|
5
|
-
## Instalacao
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @masterkeymaterial/ui
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Pre-requisitos
|
|
12
|
-
|
|
13
|
-
Projeto consumidor com:
|
|
14
|
-
|
|
15
|
-
```json
|
|
16
|
-
{
|
|
17
|
-
"@angular/common": "^21.2.0",
|
|
18
|
-
"@angular/core": "^21.2.0",
|
|
19
|
-
"@angular/platform-browser": "^21.2.0"
|
|
20
|
-
}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Verificacao Rapida
|
|
24
|
-
|
|
25
|
-
Depois da instalacao:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm ls @masterkeymaterial/ui
|
|
29
|
-
```
|
|
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
|
-
|
|
124
|
-
## Teste local do MkGrid
|
|
125
|
-
|
|
126
|
-
Para validar o consumo da lib em runtime dentro deste workspace:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
npm run build:lib
|
|
130
|
-
npx ng serve mk-grid-demo
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
O app de teste esta em `projects/mk-grid-demo` e renderiza o `MkGrid` com dados mockados para validar comportamento de DI e interacoes basicas.
|
|
134
|
-
|
|
135
|
-
## Licenca
|
|
136
|
-
|
|
137
|
-
MIT
|