@c80/ui 1.0.34 → 1.0.35
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/lib/icon/icon.component.mjs +66 -71
- package/esm2022/lib/table/table-column-visibility.service.mjs +1 -1
- package/esm2022/lib/table/table-crud-state.service.mjs +97 -76
- package/esm2022/lib/table/table-data-converter.service.mjs +9 -13
- package/esm2022/lib/table/table-data-utils.service.mjs +4 -4
- package/esm2022/lib/table/table-selection.service.mjs +53 -66
- package/esm2022/lib/table/table.component.mjs +23 -6
- package/lib/icon/icon.component.d.ts +10 -3
- package/lib/table/table-crud-state.service.d.ts +25 -0
- package/lib/table/table-data-utils.service.d.ts +1 -1
- package/lib/table/table-selection.service.d.ts +14 -8
- package/lib/table/table.component.d.ts +10 -1
- package/package.json +1 -1
|
@@ -13,6 +13,22 @@ import * as i0 from "@angular/core";
|
|
|
13
13
|
export declare class TableCrudStateService {
|
|
14
14
|
private readonly visibilityService;
|
|
15
15
|
private readonly dataConverter;
|
|
16
|
+
/**
|
|
17
|
+
* Filtra columnas visibles y editables
|
|
18
|
+
*/
|
|
19
|
+
private getEditableColumns;
|
|
20
|
+
/**
|
|
21
|
+
* Convierte valores de row según definición de columnas
|
|
22
|
+
*/
|
|
23
|
+
private convertRowValues;
|
|
24
|
+
/**
|
|
25
|
+
* Inicializa row para creación con valores por defecto
|
|
26
|
+
*/
|
|
27
|
+
private initializeNewRow;
|
|
28
|
+
/**
|
|
29
|
+
* Inicializa row para edición con valores actuales
|
|
30
|
+
*/
|
|
31
|
+
private initializeEditRow;
|
|
16
32
|
/**
|
|
17
33
|
* Inicializa el estado CRUD para una nueva tabla
|
|
18
34
|
* @returns Objeto con signals y métodos para gestión CRUD
|
|
@@ -39,6 +55,15 @@ export declare class TableCrudStateService {
|
|
|
39
55
|
}>) => void;
|
|
40
56
|
applyInputValues: (partialValues: Partial<T>) => void;
|
|
41
57
|
};
|
|
58
|
+
private createStartCreateFn;
|
|
59
|
+
private createCancelCreateFn;
|
|
60
|
+
private createUpdateNewRowFn;
|
|
61
|
+
private createSaveCreateFn;
|
|
62
|
+
private createStartEditFn;
|
|
63
|
+
private createCancelEditFn;
|
|
64
|
+
private createUpdateEditRowFn;
|
|
65
|
+
private createSaveEditFn;
|
|
66
|
+
private createApplyInputValuesFn;
|
|
42
67
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableCrudStateService, never>;
|
|
43
68
|
static ɵprov: i0.ɵɵInjectableDeclaration<TableCrudStateService>;
|
|
44
69
|
}
|
|
@@ -23,7 +23,7 @@ export declare class TableDataUtilsService {
|
|
|
23
23
|
* @param accessor - Ruta de acceso usando notación de punto
|
|
24
24
|
* @returns El valor anidado o undefined
|
|
25
25
|
*/
|
|
26
|
-
getNestedValue(obj:
|
|
26
|
+
getNestedValue(obj: Record<string, unknown>, accessor: string): unknown;
|
|
27
27
|
/**
|
|
28
28
|
* Devuelve el valor de display para una celda, mostrando '-' para valores falsy excepto 0, false y objetos/arrays vacíos
|
|
29
29
|
* @param value - Valor a formatear
|
|
@@ -15,25 +15,31 @@ export declare class TableSelectionService {
|
|
|
15
15
|
* Inicializa el estado de selección para una nueva tabla
|
|
16
16
|
* @returns Objeto con signals y métodos de selección
|
|
17
17
|
*/
|
|
18
|
-
createSelectionState<
|
|
18
|
+
createSelectionState<_T extends Record<string, unknown>>(): {
|
|
19
19
|
selectedItems: import("@angular/core").Signal<Set<ID>>;
|
|
20
20
|
selectAllChecked: import("@angular/core").Signal<boolean>;
|
|
21
21
|
selectAllIndeterminate: import("@angular/core").Signal<boolean>;
|
|
22
22
|
clearSelection: () => void;
|
|
23
|
-
toggleSelectAll: (allItems:
|
|
24
|
-
toggleItemSelection: (item:
|
|
25
|
-
isItemSelected: (item:
|
|
26
|
-
preserveSelection: (newData:
|
|
27
|
-
getSelectedItems: (allData:
|
|
28
|
-
updateSelectAllState: (allItems?: T[]) => void;
|
|
23
|
+
toggleSelectAll: (allItems: Record<string, unknown>[]) => void;
|
|
24
|
+
toggleItemSelection: (item: Record<string, unknown>, multiple: boolean) => void;
|
|
25
|
+
isItemSelected: (item: Record<string, unknown>) => boolean;
|
|
26
|
+
preserveSelection: (newData: Record<string, unknown>[]) => void;
|
|
27
|
+
getSelectedItems: (allData: Record<string, unknown>[]) => Record<string, unknown>[];
|
|
29
28
|
};
|
|
29
|
+
private createClearSelectionFn;
|
|
30
|
+
private createToggleSelectAllFn;
|
|
31
|
+
private createToggleItemSelectionFn;
|
|
32
|
+
private createIsItemSelectedFn;
|
|
33
|
+
private createPreserveSelectionFn;
|
|
34
|
+
private createGetSelectedItemsFn;
|
|
35
|
+
private updateSelectAllState;
|
|
30
36
|
/**
|
|
31
37
|
* Emite los elementos seleccionados a través del EventEmitter proporcionado
|
|
32
38
|
* @param selectionState - Estado de selección
|
|
33
39
|
* @param allData - Todos los datos de la tabla
|
|
34
40
|
* @param selectableEmitter - EventEmitter para emitir la selección
|
|
35
41
|
*/
|
|
36
|
-
emitSelection<T extends Record<string, unknown>>(selectionState: ReturnType<typeof this.createSelectionState
|
|
42
|
+
emitSelection<T extends Record<string, unknown>>(selectionState: ReturnType<typeof this.createSelectionState>, allData: T[], selectableEmitter: EventEmitter<T[]>): void;
|
|
37
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableSelectionService, never>;
|
|
38
44
|
static ɵprov: i0.ɵɵInjectableDeclaration<TableSelectionService>;
|
|
39
45
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { Icon } from '../icon/icon.component';
|
|
3
4
|
import { C80TableColDef, ID } from './table.types';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
/**
|
|
@@ -69,6 +70,8 @@ import * as i0 from "@angular/core";
|
|
|
69
70
|
size: number;
|
|
70
71
|
multiple: boolean;
|
|
71
72
|
noConfirm: boolean;
|
|
73
|
+
customActionIcon: Icon;
|
|
74
|
+
customActionTooltip: string;
|
|
72
75
|
createAction: EventEmitter<{
|
|
73
76
|
row: Partial<T>;
|
|
74
77
|
done: (result: boolean) => void;
|
|
@@ -89,6 +92,7 @@ import * as i0 from "@angular/core";
|
|
|
89
92
|
viewAction: EventEmitter<T>;
|
|
90
93
|
uploadAction: EventEmitter<T>;
|
|
91
94
|
getRowButtonAction: EventEmitter<T>;
|
|
95
|
+
customAction: EventEmitter<T>;
|
|
92
96
|
moveUpAction: EventEmitter<{
|
|
93
97
|
id: ID;
|
|
94
98
|
done: (result: boolean) => void;
|
|
@@ -124,6 +128,7 @@ import * as i0 from "@angular/core";
|
|
|
124
128
|
readonly hasViewActionListener: import("@angular/core").WritableSignal<boolean>;
|
|
125
129
|
readonly hasUploadActionListener: import("@angular/core").WritableSignal<boolean>;
|
|
126
130
|
readonly hasGetRowButtonListener: import("@angular/core").WritableSignal<boolean>;
|
|
131
|
+
readonly hasCustomActionListener: import("@angular/core").WritableSignal<boolean>;
|
|
127
132
|
readonly hasMoveUpActionListener: import("@angular/core").WritableSignal<boolean>;
|
|
128
133
|
readonly hasMoveDownActionListener: import("@angular/core").WritableSignal<boolean>;
|
|
129
134
|
readonly hasEnableActionListener: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -166,6 +171,10 @@ import * as i0 from "@angular/core";
|
|
|
166
171
|
* Emits the getRowButtonAction event with the entire row data
|
|
167
172
|
*/
|
|
168
173
|
onGetRowButton(row: T): void;
|
|
174
|
+
/**
|
|
175
|
+
* Emits the customAction event with the entire row data
|
|
176
|
+
*/
|
|
177
|
+
onCustomAction(row: T): void;
|
|
169
178
|
/**
|
|
170
179
|
* Emits the moveUpAction event with the row id
|
|
171
180
|
*/
|
|
@@ -212,6 +221,6 @@ import * as i0 from "@angular/core";
|
|
|
212
221
|
isColumnVisibleForRow(column: C80TableColDef, row: T): boolean;
|
|
213
222
|
onUpload(row: T): void;
|
|
214
223
|
static ɵfac: i0.ɵɵFactoryDeclaration<C80TableComponent<any>, never>;
|
|
215
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<C80TableComponent<any>, "c80-table", never, { "data$": { "alias": "data$"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "inputValues$": { "alias": "inputValues$"; "required": false; }; "size": { "alias": "size"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "noConfirm": { "alias": "noConfirm"; "required": false; }; }, { "createAction": "createAction"; "updateAction": "updateAction"; "deleteAction": "deleteAction"; "cancelAction": "cancelAction"; "viewAction": "viewAction"; "uploadAction": "uploadAction"; "getRowButtonAction": "getRowButtonAction"; "moveUpAction": "moveUpAction"; "moveDownAction": "moveDownAction"; "enableAction": "enableAction"; "searchTerm": "searchTerm"; "errorEvent": "errorEvent"; "selectable": "selectable"; }, never, never, true, never>;
|
|
224
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<C80TableComponent<any>, "c80-table", never, { "data$": { "alias": "data$"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "inputValues$": { "alias": "inputValues$"; "required": false; }; "size": { "alias": "size"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "noConfirm": { "alias": "noConfirm"; "required": false; }; "customActionIcon": { "alias": "customActionIcon"; "required": false; }; "customActionTooltip": { "alias": "customActionTooltip"; "required": false; }; }, { "createAction": "createAction"; "updateAction": "updateAction"; "deleteAction": "deleteAction"; "cancelAction": "cancelAction"; "viewAction": "viewAction"; "uploadAction": "uploadAction"; "getRowButtonAction": "getRowButtonAction"; "customAction": "customAction"; "moveUpAction": "moveUpAction"; "moveDownAction": "moveDownAction"; "enableAction": "enableAction"; "searchTerm": "searchTerm"; "errorEvent": "errorEvent"; "selectable": "selectable"; }, never, never, true, never>;
|
|
216
225
|
static ngAcceptInputType_noConfirm: boolean | string;
|
|
217
226
|
}
|