@c80/ui 1.0.58 → 1.0.62
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/esm2022/index.js +1 -0
- package/esm2022/index.js.map +1 -1
- package/esm2022/lib/action-list/action-list.types.js.map +1 -1
- package/esm2022/lib/card-level/card-level.component.js +1 -3
- package/esm2022/lib/card-level/card-level.component.js.map +1 -1
- package/esm2022/lib/card-level/card-level.interface.js.map +1 -1
- package/esm2022/lib/card-level/index.js.map +1 -1
- package/esm2022/lib/error-notification/error-notification.component.js +41 -0
- package/esm2022/lib/error-notification/error-notification.component.js.map +1 -0
- package/esm2022/lib/error-notification/error-notification.types.js +2 -0
- package/esm2022/lib/error-notification/error-notification.types.js.map +1 -0
- package/esm2022/lib/error-notification/index.js +3 -0
- package/esm2022/lib/error-notification/index.js.map +1 -0
- package/esm2022/lib/header/header.component.js +2 -2
- package/esm2022/lib/header/header.component.js.map +1 -1
- package/esm2022/lib/icon/icon.component.js +1 -3
- package/esm2022/lib/icon/icon.component.js.map +1 -1
- package/esm2022/lib/icon/icon.definitions.js +74 -1
- package/esm2022/lib/icon/icon.definitions.js.map +1 -1
- package/esm2022/lib/icon/theme.service.js +3 -0
- package/esm2022/lib/icon/theme.service.js.map +1 -1
- package/esm2022/lib/modal/index.js.map +1 -1
- package/esm2022/lib/modal/modal.component.js +2 -2
- package/esm2022/lib/modal/modal.component.js.map +1 -1
- package/esm2022/lib/modal/modal.service.js.map +1 -1
- package/esm2022/lib/modal/modal.types.js +2 -0
- package/esm2022/lib/modal/modal.types.js.map +1 -0
- package/esm2022/lib/select/index.js +1 -1
- package/esm2022/lib/select/index.js.map +1 -1
- package/esm2022/lib/select/select.component.js +4 -1
- package/esm2022/lib/select/select.component.js.map +1 -1
- package/esm2022/lib/select/select.types.js +2 -0
- package/esm2022/lib/select/select.types.js.map +1 -0
- package/esm2022/lib/snackbar/index.js.map +1 -1
- package/esm2022/lib/snackbar/snackbar.component.js +2 -2
- package/esm2022/lib/snackbar/snackbar.component.js.map +1 -1
- package/esm2022/lib/snackbar/snackbar.service.js.map +1 -1
- package/esm2022/lib/snackbar/snackbar.types.js +2 -0
- package/esm2022/lib/snackbar/{snackbar.model.js.map → snackbar.types.js.map} +1 -1
- package/esm2022/lib/stat-card/index.js.map +1 -1
- package/esm2022/lib/stat-card/stat-card.component.js.map +1 -1
- package/esm2022/lib/stat-card/stat-card.types.js +2 -0
- package/esm2022/lib/stat-card/stat-card.types.js.map +1 -0
- package/esm2022/lib/tab/c80-tab.types.js +2 -0
- package/esm2022/lib/tab/c80-tab.types.js.map +1 -0
- package/esm2022/lib/tab/index.js.map +1 -1
- package/esm2022/lib/table/index.js +2 -0
- package/esm2022/lib/table/index.js.map +1 -1
- package/esm2022/lib/table/table-data-utils.service.js +1 -3
- package/esm2022/lib/table/table-data-utils.service.js.map +1 -1
- package/esm2022/lib/table/table-dto-mapper.service.js +98 -0
- package/esm2022/lib/table/table-dto-mapper.service.js.map +1 -0
- package/esm2022/lib/table/table-pagination.service.js +79 -0
- package/esm2022/lib/table/table-pagination.service.js.map +1 -0
- package/esm2022/lib/table/table.component.js +66 -6
- package/esm2022/lib/table/table.component.js.map +1 -1
- package/esm2022/lib/table/table.types.js.map +1 -1
- package/esm2022/lib/table/table.utils.js +3 -2
- package/esm2022/lib/table/table.utils.js.map +1 -1
- package/index.d.ts +1 -0
- package/lib/action-list/action-list.types.d.ts +1 -1
- package/lib/error-notification/error-notification.component.d.ts +20 -0
- package/lib/error-notification/error-notification.types.d.ts +4 -0
- package/lib/error-notification/index.d.ts +2 -0
- package/lib/icon/icon.component.d.ts +1 -1
- package/lib/modal/index.d.ts +1 -0
- package/lib/modal/modal.component.d.ts +1 -16
- package/lib/modal/modal.service.d.ts +1 -1
- package/lib/modal/modal.types.d.ts +15 -0
- package/lib/select/index.d.ts +1 -1
- package/lib/select/select.component.d.ts +2 -1
- package/lib/snackbar/index.d.ts +1 -1
- package/lib/snackbar/snackbar.component.d.ts +1 -1
- package/lib/snackbar/snackbar.service.d.ts +1 -1
- package/lib/stat-card/index.d.ts +1 -0
- package/lib/stat-card/stat-card.component.d.ts +1 -7
- package/lib/stat-card/stat-card.types.d.ts +7 -0
- package/lib/tab/index.d.ts +1 -1
- package/lib/table/index.d.ts +2 -0
- package/lib/table/table-dto-mapper.service.d.ts +34 -0
- package/lib/table/table-pagination.service.d.ts +41 -0
- package/lib/table/table.component.d.ts +24 -3
- package/lib/table/table.types.d.ts +16 -1
- package/lib/table/table.utils.d.ts +2 -1
- package/package.json +1 -1
- package/esm2022/lib/select/select.model.js +0 -2
- package/esm2022/lib/select/select.model.js.map +0 -1
- package/esm2022/lib/snackbar/snackbar.model.js +0 -2
- package/esm2022/lib/tab/c80-tab.model.js +0 -2
- package/esm2022/lib/tab/c80-tab.model.js.map +0 -1
- /package/lib/select/{select.model.d.ts → select.types.d.ts} +0 -0
- /package/lib/snackbar/{snackbar.model.d.ts → snackbar.types.d.ts} +0 -0
- /package/lib/tab/{c80-tab.model.d.ts → c80-tab.types.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type OnInit, type OnDestroy } from '@angular/core';
|
|
2
2
|
import type { Observable } from 'rxjs';
|
|
3
|
-
import type { TableColDef, CustomTableAction } from './table.types';
|
|
3
|
+
import type { TableColDef, CustomTableAction, PaginationChangeEvent, PaginationConfig } from './table.types';
|
|
4
4
|
import { getActionTooltip } from './table.utils';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
@@ -132,6 +132,7 @@ import * as i0 from "@angular/core";
|
|
|
132
132
|
private readonly dataConverter;
|
|
133
133
|
private readonly selectionService;
|
|
134
134
|
private readonly crudService;
|
|
135
|
+
private readonly paginationService;
|
|
135
136
|
readonly data$: import("@angular/core").InputSignal<Observable<T[]>>;
|
|
136
137
|
readonly columns: import("@angular/core").InputSignal<TableColDef[]>;
|
|
137
138
|
readonly inputValues$: import("@angular/core").InputSignal<Observable<Partial<T>> | undefined>;
|
|
@@ -141,6 +142,8 @@ import * as i0 from "@angular/core";
|
|
|
141
142
|
readonly searchable: import("@angular/core").InputSignalWithTransform<boolean, string | boolean>;
|
|
142
143
|
readonly allowSelection: import("@angular/core").InputSignalWithTransform<boolean, string | boolean>;
|
|
143
144
|
readonly noConfirm: import("@angular/core").InputSignalWithTransform<boolean, string | boolean>;
|
|
145
|
+
readonly paginated: import("@angular/core").InputSignalWithTransform<boolean, string | boolean>;
|
|
146
|
+
readonly paginationConfig: import("@angular/core").InputSignal<PaginationConfig>;
|
|
144
147
|
readonly actionClick: import("@angular/core").OutputEmitterRef<{
|
|
145
148
|
action: string;
|
|
146
149
|
row: T;
|
|
@@ -148,6 +151,7 @@ import * as i0 from "@angular/core";
|
|
|
148
151
|
readonly searchTerm: import("@angular/core").OutputEmitterRef<string>;
|
|
149
152
|
readonly errorEvent: import("@angular/core").OutputEmitterRef<string>;
|
|
150
153
|
readonly selectable: import("@angular/core").OutputEmitterRef<T[]>;
|
|
154
|
+
readonly paginationChange: import("@angular/core").OutputEmitterRef<PaginationChangeEvent>;
|
|
151
155
|
readonly data: import("@angular/core").WritableSignal<T[]>;
|
|
152
156
|
readonly searchValue: import("@angular/core").WritableSignal<string>;
|
|
153
157
|
private readonly selectionState;
|
|
@@ -159,15 +163,23 @@ import * as i0 from "@angular/core";
|
|
|
159
163
|
readonly newRow: import("@angular/core").Signal<Partial<T> | null>;
|
|
160
164
|
readonly editing: import("@angular/core").Signal<string | null>;
|
|
161
165
|
readonly editRow: import("@angular/core").Signal<Partial<T> | null>;
|
|
166
|
+
private readonly paginationState;
|
|
167
|
+
readonly currentPage: import("@angular/core").Signal<number>;
|
|
168
|
+
readonly pageSize: import("@angular/core").Signal<number>;
|
|
169
|
+
readonly totalPages: import("@angular/core").Signal<number>;
|
|
170
|
+
readonly hasNextPage: import("@angular/core").Signal<boolean>;
|
|
171
|
+
readonly hasPrevPage: import("@angular/core").Signal<boolean>;
|
|
162
172
|
readonly keys: import("@angular/core").Signal<string[]>;
|
|
163
173
|
readonly hasAnyActions: import("@angular/core").Signal<boolean>;
|
|
164
174
|
readonly hasCrudCreate: import("@angular/core").Signal<boolean>;
|
|
165
175
|
readonly hasCrudUpdate: import("@angular/core").Signal<boolean>;
|
|
166
176
|
readonly hasCrudDelete: import("@angular/core").Signal<boolean>;
|
|
167
177
|
readonly hasCrudCancel: import("@angular/core").Signal<boolean>;
|
|
178
|
+
readonly shouldShowCreateButton: import("@angular/core").Signal<boolean>;
|
|
168
179
|
readonly tableMaxHeight: import("@angular/core").Signal<string | undefined>;
|
|
169
180
|
private dataSub?;
|
|
170
181
|
private inputValuesSub?;
|
|
182
|
+
constructor();
|
|
171
183
|
/**
|
|
172
184
|
* Maneja input de creación/edición de forma unificada
|
|
173
185
|
*/
|
|
@@ -203,7 +215,7 @@ import * as i0 from "@angular/core";
|
|
|
203
215
|
/**
|
|
204
216
|
* Verifica si una acción personalizada debe mostrarse para una fila específica
|
|
205
217
|
*/
|
|
206
|
-
readonly shouldShowAction: (action: CustomTableAction, row: T) => boolean;
|
|
218
|
+
readonly shouldShowAction: (action: CustomTableAction, row: T, data?: T[] | undefined) => boolean;
|
|
207
219
|
/**
|
|
208
220
|
* Obtiene el tooltip de una acción
|
|
209
221
|
*/
|
|
@@ -249,11 +261,20 @@ import * as i0 from "@angular/core";
|
|
|
249
261
|
isColumnVisible(column: TableColDef): boolean;
|
|
250
262
|
isColumnVisibleInHeader(column: TableColDef): boolean;
|
|
251
263
|
isColumnVisibleForRow(column: TableColDef, row: T): boolean;
|
|
264
|
+
onPageChange(page: number): void;
|
|
265
|
+
onNextPage(): void;
|
|
266
|
+
onPrevPage(): void;
|
|
267
|
+
private emitPaginationChange;
|
|
268
|
+
/**
|
|
269
|
+
* Actualiza el total de items para calcular páginas
|
|
270
|
+
* Debe ser llamado por el componente padre después de recibir datos
|
|
271
|
+
*/
|
|
272
|
+
updateTotalItems(total: number): void;
|
|
252
273
|
/**
|
|
253
274
|
* Obtiene el color de una acción considerando el tema actual.
|
|
254
275
|
* Si la acción tiene color explícito, lo usa. Si no, aplica color por tema.
|
|
255
276
|
*/
|
|
256
277
|
getActionColor(action: CustomTableAction): string | undefined;
|
|
257
278
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent<any>, never>;
|
|
258
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "c80-table", never, { "data$": { "alias": "data$"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "inputValues$": { "alias": "inputValues$"; "required": false; "isSignal": true; }; "customActions": { "alias": "customActions"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "allowSelection": { "alias": "allowSelection"; "required": false; "isSignal": true; }; "noConfirm": { "alias": "noConfirm"; "required": false; "isSignal": true; }; }, { "actionClick": "actionClick"; "searchTerm": "searchTerm"; "errorEvent": "errorEvent"; "selectable": "selectable"; }, never, never, true, never>;
|
|
279
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any>, "c80-table", never, { "data$": { "alias": "data$"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "inputValues$": { "alias": "inputValues$"; "required": false; "isSignal": true; }; "customActions": { "alias": "customActions"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "allowSelection": { "alias": "allowSelection"; "required": false; "isSignal": true; }; "noConfirm": { "alias": "noConfirm"; "required": false; "isSignal": true; }; "paginated": { "alias": "paginated"; "required": false; "isSignal": true; }; "paginationConfig": { "alias": "paginationConfig"; "required": false; "isSignal": true; }; }, { "actionClick": "actionClick"; "searchTerm": "searchTerm"; "errorEvent": "errorEvent"; "selectable": "selectable"; "paginationChange": "paginationChange"; }, never, never, true, never>;
|
|
259
280
|
}
|
|
@@ -34,7 +34,22 @@ export interface CustomTableAction {
|
|
|
34
34
|
name: string;
|
|
35
35
|
icon: IconType;
|
|
36
36
|
color?: string;
|
|
37
|
-
condition?: <T extends Record<string, unknown>>(row: T) => boolean;
|
|
37
|
+
condition?: <T extends Record<string, unknown>>(row: T, data?: T[]) => boolean;
|
|
38
38
|
tooltip?: string;
|
|
39
39
|
confirmation?: ActionConfirmation;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Evento emitido cuando cambia la paginación
|
|
43
|
+
*/
|
|
44
|
+
export interface PaginationChangeEvent {
|
|
45
|
+
page: number;
|
|
46
|
+
limit: number;
|
|
47
|
+
offset: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Configuración de paginación para la tabla
|
|
51
|
+
*/
|
|
52
|
+
export interface PaginationConfig {
|
|
53
|
+
pageSize?: number;
|
|
54
|
+
totalItems?: number;
|
|
55
|
+
}
|
|
@@ -33,9 +33,10 @@ export declare function trackById<T extends Record<string, unknown>>(index: numb
|
|
|
33
33
|
* CREATE se excluye porque se maneja con el botón "+" en el header
|
|
34
34
|
* @param action - Acción a verificar
|
|
35
35
|
* @param row - Fila de datos
|
|
36
|
+
* @param data - Todos los datos de la tabla (opcional)
|
|
36
37
|
* @returns true si la acción debe mostrarse
|
|
37
38
|
*/
|
|
38
|
-
export declare function shouldShowAction<T extends Record<string, unknown>>(action: CustomTableAction, row: T): boolean;
|
|
39
|
+
export declare function shouldShowAction<T extends Record<string, unknown>>(action: CustomTableAction, row: T, data?: T[]): boolean;
|
|
39
40
|
/**
|
|
40
41
|
* Obtiene el tooltip de una acción (usa tooltip personalizado o name por defecto)
|
|
41
42
|
* @param action - Acción
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"select.model.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/select/select.model.ts"],"names":[],"mappings":"","sourcesContent":["export interface SelectOption<T = string> {\n value: T;\n label: string;\n disabled?: boolean;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"c80-tab.model.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/tab/c80-tab.model.ts"],"names":[],"mappings":"","sourcesContent":["export interface C80Tab {\n readonly label: string;\n readonly icon?: string;\n}\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|