@c80/ui 1.0.56 → 1.0.58

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.
Files changed (115) hide show
  1. package/esm2022/index.js +12 -8
  2. package/esm2022/index.js.map +1 -1
  3. package/esm2022/lib/action-list/action-list.component.js +7 -0
  4. package/esm2022/lib/action-list/action-list.component.js.map +1 -1
  5. package/esm2022/lib/action-list/action-list.types.js.map +1 -1
  6. package/esm2022/lib/card-level/card-level.component.js +3 -0
  7. package/esm2022/lib/card-level/card-level.component.js.map +1 -1
  8. package/esm2022/lib/header/header.component.js +8 -2
  9. package/esm2022/lib/header/header.component.js.map +1 -1
  10. package/esm2022/lib/header/header.types.js.map +1 -1
  11. package/esm2022/lib/icon/icon.component.js +10 -2
  12. package/esm2022/lib/icon/icon.component.js.map +1 -1
  13. package/esm2022/lib/icon/icon.definitions.js +34 -1
  14. package/esm2022/lib/icon/icon.definitions.js.map +1 -1
  15. package/esm2022/lib/icon/icon.types.js.map +1 -1
  16. package/esm2022/lib/icon/icon.utils.js +7 -0
  17. package/esm2022/lib/icon/icon.utils.js.map +1 -1
  18. package/esm2022/lib/icon/theme.service.js +17 -0
  19. package/esm2022/lib/icon/theme.service.js.map +1 -1
  20. package/esm2022/lib/info-list/info-list.component.js +3 -0
  21. package/esm2022/lib/info-list/info-list.component.js.map +1 -1
  22. package/esm2022/lib/input-field/input-field.component.js +19 -2
  23. package/esm2022/lib/input-field/input-field.component.js.map +1 -1
  24. package/esm2022/lib/input-search/c80-input-search.component.js +26 -0
  25. package/esm2022/lib/input-search/c80-input-search.component.js.map +1 -0
  26. package/esm2022/lib/input-search/index.js +2 -0
  27. package/esm2022/lib/input-search/index.js.map +1 -0
  28. package/esm2022/lib/modal/modal.component.js +59 -2
  29. package/esm2022/lib/modal/modal.component.js.map +1 -1
  30. package/esm2022/lib/modal/modal.service.js +60 -3
  31. package/esm2022/lib/modal/modal.service.js.map +1 -1
  32. package/esm2022/lib/profile-stats/profile-stats.component.js +6 -2
  33. package/esm2022/lib/profile-stats/profile-stats.component.js.map +1 -1
  34. package/esm2022/lib/profile-stats/profile-stats.types.js.map +1 -1
  35. package/esm2022/lib/rating-display/index.js +2 -0
  36. package/esm2022/lib/rating-display/index.js.map +1 -0
  37. package/esm2022/lib/rating-display/rating-display.component.js +24 -0
  38. package/esm2022/lib/rating-display/rating-display.component.js.map +1 -0
  39. package/esm2022/lib/rating-stars/index.js +2 -0
  40. package/esm2022/lib/rating-stars/index.js.map +1 -0
  41. package/esm2022/lib/rating-stars/rating-stars.component.js +33 -0
  42. package/esm2022/lib/rating-stars/rating-stars.component.js.map +1 -0
  43. package/esm2022/lib/select/select.component.js +27 -0
  44. package/esm2022/lib/select/select.component.js.map +1 -1
  45. package/esm2022/lib/snackbar/snackbar.component.js +19 -2
  46. package/esm2022/lib/snackbar/snackbar.component.js.map +1 -1
  47. package/esm2022/lib/snackbar/snackbar.service.js +9 -0
  48. package/esm2022/lib/snackbar/snackbar.service.js.map +1 -1
  49. package/esm2022/lib/spinner/index.js +2 -0
  50. package/esm2022/lib/spinner/index.js.map +1 -0
  51. package/esm2022/lib/spinner/spinner.component.js +22 -0
  52. package/esm2022/lib/spinner/spinner.component.js.map +1 -0
  53. package/esm2022/lib/stat-card/stat-card.component.js +3 -0
  54. package/esm2022/lib/stat-card/stat-card.component.js.map +1 -1
  55. package/esm2022/lib/tab/c80-tab.component.js +19 -2
  56. package/esm2022/lib/tab/c80-tab.component.js.map +1 -1
  57. package/esm2022/lib/tab/directives/c80-tab-item.directive.js +3 -0
  58. package/esm2022/lib/tab/directives/c80-tab-item.directive.js.map +1 -1
  59. package/esm2022/lib/tab/directives/c80-tab-label.directive.js +3 -0
  60. package/esm2022/lib/tab/directives/c80-tab-label.directive.js.map +1 -1
  61. package/esm2022/lib/table/table-column-visibility.service.js +27 -34
  62. package/esm2022/lib/table/table-column-visibility.service.js.map +1 -1
  63. package/esm2022/lib/table/table-crud-state.service.js +7 -7
  64. package/esm2022/lib/table/table-crud-state.service.js.map +1 -1
  65. package/esm2022/lib/table/table-data-converter.service.js +18 -10
  66. package/esm2022/lib/table/table-data-converter.service.js.map +1 -1
  67. package/esm2022/lib/table/table-data-utils.service.js +17 -1
  68. package/esm2022/lib/table/table-data-utils.service.js.map +1 -1
  69. package/esm2022/lib/table/table-selection.service.js +14 -3
  70. package/esm2022/lib/table/table-selection.service.js.map +1 -1
  71. package/esm2022/lib/table/table.component.js +60 -18
  72. package/esm2022/lib/table/table.component.js.map +1 -1
  73. package/esm2022/lib/table/table.types.js.map +1 -1
  74. package/esm2022/lib/table/table.utils.js +7 -0
  75. package/esm2022/lib/table/table.utils.js.map +1 -1
  76. package/index.d.ts +12 -8
  77. package/lib/action-list/action-list.component.d.ts +7 -0
  78. package/lib/action-list/action-list.types.d.ts +2 -1
  79. package/lib/card-level/card-level.component.d.ts +3 -0
  80. package/lib/header/header.component.d.ts +7 -1
  81. package/lib/header/header.types.d.ts +2 -0
  82. package/lib/icon/icon.component.d.ts +9 -1
  83. package/lib/icon/icon.types.d.ts +2 -0
  84. package/lib/icon/icon.utils.d.ts +7 -0
  85. package/lib/icon/theme.service.d.ts +17 -0
  86. package/lib/info-list/info-list.component.d.ts +3 -0
  87. package/lib/input-field/input-field.component.d.ts +17 -0
  88. package/lib/input-search/c80-input-search.component.d.ts +16 -0
  89. package/lib/input-search/index.d.ts +1 -0
  90. package/lib/modal/modal.component.d.ts +57 -0
  91. package/lib/modal/modal.service.d.ts +72 -3
  92. package/lib/profile-stats/profile-stats.component.d.ts +4 -0
  93. package/lib/profile-stats/profile-stats.types.d.ts +6 -2
  94. package/lib/rating-display/index.d.ts +1 -0
  95. package/lib/rating-display/rating-display.component.d.ts +12 -0
  96. package/lib/rating-stars/index.d.ts +1 -0
  97. package/lib/rating-stars/rating-stars.component.d.ts +19 -0
  98. package/lib/select/select.component.d.ts +27 -0
  99. package/lib/snackbar/snackbar.component.d.ts +18 -1
  100. package/lib/snackbar/snackbar.service.d.ts +9 -0
  101. package/lib/spinner/index.d.ts +1 -0
  102. package/lib/spinner/spinner.component.d.ts +12 -0
  103. package/lib/stat-card/stat-card.component.d.ts +3 -0
  104. package/lib/tab/c80-tab.component.d.ts +17 -0
  105. package/lib/tab/directives/c80-tab-item.directive.d.ts +3 -0
  106. package/lib/tab/directives/c80-tab-label.directive.d.ts +3 -0
  107. package/lib/table/table-column-visibility.service.d.ts +19 -6
  108. package/lib/table/table-crud-state.service.d.ts +23 -13
  109. package/lib/table/table-data-converter.service.d.ts +2 -0
  110. package/lib/table/table-data-utils.service.d.ts +7 -0
  111. package/lib/table/table-selection.service.d.ts +14 -12
  112. package/lib/table/table.component.d.ts +3 -0
  113. package/lib/table/table.types.d.ts +1 -0
  114. package/lib/table/table.utils.d.ts +2 -0
  115. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ *
4
+ */
5
+ export declare class SpinnerComponent {
6
+ readonly size: import("@angular/core").InputSignal<number>;
7
+ readonly borderWidth: import("@angular/core").InputSignal<number>;
8
+ readonly color: import("@angular/core").InputSignal<string>;
9
+ readonly message: import("@angular/core").InputSignal<string>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpinnerComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpinnerComponent, "c80-spinner", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "borderWidth": { "alias": "borderWidth"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
12
+ }
@@ -6,6 +6,9 @@ export interface CardDef {
6
6
  text: string;
7
7
  count: number;
8
8
  }
9
+ /**
10
+ *
11
+ */
9
12
  export declare class StatCardComponent {
10
13
  readonly cards: import("@angular/core").InputSignal<CardDef[]>;
11
14
  static ɵfac: i0.ɵɵFactoryDeclaration<StatCardComponent, never>;
@@ -2,13 +2,30 @@ import { type TemplateRef } from '@angular/core';
2
2
  import { C80TabItemDirective } from './directives/c80-tab-item.directive';
3
3
  import { C80TabLabelDirective } from './directives/c80-tab-label.directive';
4
4
  import * as i0 from "@angular/core";
5
+ /**
6
+ *
7
+ */
5
8
  export declare class TabComponent {
6
9
  readonly tabs: import("@angular/core").Signal<readonly C80TabItemDirective[]>;
7
10
  readonly labels: import("@angular/core").Signal<readonly C80TabLabelDirective[]>;
8
11
  readonly selectedIndex: import("@angular/core").ModelSignal<number>;
9
12
  readonly selectedIndexChange: import("@angular/core").OutputEmitterRef<number>;
13
+ /**
14
+ *
15
+ * @param index
16
+ */
10
17
  onTabClick(index: number): void;
18
+ /**
19
+ *
20
+ * @param index
21
+ * @returns Template del contenido del tab o null
22
+ */
11
23
  getTabContent(index: number): TemplateRef<unknown> | null;
24
+ /**
25
+ *
26
+ * @param index
27
+ * @returns Template de la etiqueta del tab o null
28
+ */
12
29
  getTabLabel(index: number): TemplateRef<unknown> | null;
13
30
  static ɵfac: i0.ɵɵFactoryDeclaration<TabComponent, never>;
14
31
  static ɵcmp: i0.ɵɵComponentDeclaration<TabComponent, "c80-tab", never, { "selectedIndex": { "alias": "selectedIndex"; "required": false; "isSignal": true; }; }, { "selectedIndex": "selectedIndexChange"; "selectedIndexChange": "selectedIndexChange"; }, ["tabs", "labels"], never, true, never>;
@@ -1,5 +1,8 @@
1
1
  import { TemplateRef } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
+ /**
4
+ *
5
+ */
3
6
  export declare class C80TabItemDirective {
4
7
  readonly content: TemplateRef<any>;
5
8
  static ɵfac: i0.ɵɵFactoryDeclaration<C80TabItemDirective, never>;
@@ -1,5 +1,8 @@
1
1
  import { TemplateRef } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
+ /**
4
+ *
5
+ */
3
6
  export declare class C80TabLabelDirective {
4
7
  readonly template: TemplateRef<any>;
5
8
  static ɵfac: i0.ɵɵFactoryDeclaration<C80TabLabelDirective, never>;
@@ -14,12 +14,14 @@ export declare class TableColumnVisibilityService {
14
14
  /**
15
15
  * Actualiza las keys de columnas visibles basándose en el estado actual
16
16
  * @param columns - Definiciones de columnas
17
- * @param data - Datos actuales de la tabla
18
- * @param creating - Si está en modo creación
19
- * @param editing - ID de fila en edición (null si no hay edición)
17
+ * @param context - Contexto con datos, estado de creación y edición
20
18
  * @returns Array de accessors de columnas visibles
21
19
  */
22
- updateVisibleKeys<T extends Record<string, unknown>>(columns: TableColDef[], data: T[], creating: boolean, editing: string | null): string[];
20
+ updateVisibleKeys<T extends Record<string, unknown>>(columns: TableColDef[], context: {
21
+ data: T[];
22
+ creating: boolean;
23
+ editing: string | null;
24
+ }): string[];
23
25
  /**
24
26
  * Determina si una columna debe ser visible basándose en su configuración y datos
25
27
  * Método unificado que maneja todos los casos de visibilidad
@@ -34,16 +36,27 @@ export declare class TableColumnVisibilityService {
34
36
  editing?: string | null;
35
37
  row?: T;
36
38
  }): boolean;
39
+ private checkColumnVisibilityByContext;
40
+ private isVisibleInCreation;
41
+ private isVisibleInEditing;
37
42
  /**
38
43
  * Determina si una columna debe ser visible en los headers
39
44
  * Wrapper para mantener compatibilidad con API existente
40
45
  */
41
- isColumnVisibleInHeader<T extends Record<string, unknown>>(column: TableColDef, data: T[], creating: boolean, editing: string | null): boolean;
46
+ isColumnVisibleInHeader<T extends Record<string, unknown>>(column: TableColDef, context: {
47
+ data: T[];
48
+ creating: boolean;
49
+ editing: string | null;
50
+ }): boolean;
42
51
  /**
43
52
  * Determina si una columna debe ser visible en una fila específica
44
53
  * Wrapper para mantener compatibilidad con API existente
45
54
  */
46
- isColumnVisibleForRow<T extends Record<string, unknown>>(column: TableColDef, row: T, data: T[], editing: string | null): boolean;
55
+ isColumnVisibleForRow<T extends Record<string, unknown>>(column: TableColDef, context: {
56
+ row: T;
57
+ data: T[];
58
+ editing: string | null;
59
+ }): boolean;
47
60
  /**
48
61
  * Verifica si todos los valores de una columna están vacíos/nulos
49
62
  */
@@ -1,5 +1,26 @@
1
+ import { type Signal } from '@angular/core';
1
2
  import type { TableColDef } from './table.types';
2
3
  import * as i0 from "@angular/core";
4
+ interface CrudState<T extends Record<string, unknown>> {
5
+ creating: Signal<boolean>;
6
+ newRow: Signal<Partial<T> | null>;
7
+ editing: Signal<string | null>;
8
+ editRow: Signal<Partial<T> | null>;
9
+ startCreate: (context: {
10
+ columns: TableColDef[];
11
+ data: T[];
12
+ }) => void;
13
+ cancelCreate: () => void;
14
+ updateNewRow: (key: string, value: unknown) => void;
15
+ startEdit: (context: {
16
+ row: T;
17
+ columns: TableColDef[];
18
+ data: T[];
19
+ }) => void;
20
+ cancelEdit: () => void;
21
+ updateEditRow: (key: string, value: unknown) => void;
22
+ applyInputValues: (partialValues: Partial<T>) => void;
23
+ }
3
24
  /**
4
25
  * Servicio para gestionar el estado CRUD (Crear, Leer, Actualizar, Eliminar) en tablas C80
5
26
  *
@@ -28,19 +49,7 @@ export declare class TableCrudStateService {
28
49
  * Inicializa el estado CRUD para una nueva tabla
29
50
  * @returns Objeto con signals y métodos para gestión CRUD
30
51
  */
31
- createCrudState<T extends Record<string, unknown>>(): {
32
- creating: import("@angular/core").Signal<boolean>;
33
- newRow: import("@angular/core").Signal<Partial<T> | null>;
34
- editing: import("@angular/core").Signal<string | null>;
35
- editRow: import("@angular/core").Signal<Partial<T> | null>;
36
- startCreate: (columns: TableColDef[], data: T[]) => void;
37
- cancelCreate: () => void;
38
- updateNewRow: (key: string, value: unknown) => void;
39
- startEdit: (row: T, columns: TableColDef[], data: T[]) => void;
40
- cancelEdit: () => void;
41
- updateEditRow: (key: string, value: unknown) => void;
42
- applyInputValues: (partialValues: Partial<T>) => void;
43
- };
52
+ createCrudState<T extends Record<string, unknown>>(): CrudState<T>;
44
53
  private startCreate;
45
54
  private cancelCreate;
46
55
  private updateRow;
@@ -50,3 +59,4 @@ export declare class TableCrudStateService {
50
59
  static ɵfac: i0.ɵɵFactoryDeclaration<TableCrudStateService, never>;
51
60
  static ɵprov: i0.ɵɵInjectableDeclaration<TableCrudStateService>;
52
61
  }
62
+ export {};
@@ -15,6 +15,8 @@ export declare class TableDataConverterService {
15
15
  * @returns Valor convertido al tipo apropiado
16
16
  */
17
17
  convertCellValue(value: unknown, col: TableColDef, sampleValue?: unknown): unknown;
18
+ private convertByColumnType;
19
+ private convertBySampleValue;
18
20
  /**
19
21
  * Convierte un valor a boolean usando mejores prácticas
20
22
  * @param value - Valor a convertir
@@ -31,6 +31,13 @@ export declare class TableDataUtilsService {
31
31
  * @returns Cadena formateada para display
32
32
  */
33
33
  getDisplayValue(value: unknown, col?: TableColDef): string;
34
+ /**
35
+ * Trunca un texto a N caracteres y agrega '...' si es necesario
36
+ * @param value - Texto a truncar
37
+ * @param maxLength - Longitud máxima
38
+ * @returns Texto truncado
39
+ */
40
+ private truncateText;
34
41
  private formatValueByType;
35
42
  private formatPrimitiveValue;
36
43
  /**
@@ -1,5 +1,16 @@
1
- import { type OutputEmitterRef } from '@angular/core';
1
+ import { type OutputEmitterRef, type Signal } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
+ interface SelectionState<T extends Record<string, unknown>> {
4
+ selectedItems: Signal<Set<string>>;
5
+ selectAllChecked: Signal<boolean>;
6
+ selectAllIndeterminate: Signal<boolean>;
7
+ clearSelection: () => void;
8
+ toggleSelectAll: (allItems: T[]) => void;
9
+ toggleItemSelection: (item: T, multiple: boolean) => void;
10
+ isItemSelected: (item: T) => boolean;
11
+ preserveSelection: (newData: T[]) => void;
12
+ getSelectedItems: (allData: T[]) => T[];
13
+ }
3
14
  /**
4
15
  * Servicio para gestionar la selección de elementos en tablas C80
5
16
  *
@@ -14,17 +25,7 @@ export declare class TableSelectionService {
14
25
  * Inicializa el estado de selección para una nueva tabla
15
26
  * @returns Objeto con signals y métodos de selección
16
27
  */
17
- createSelectionState<T extends Record<string, unknown>>(): {
18
- selectedItems: import("@angular/core").Signal<Set<string>>;
19
- selectAllChecked: import("@angular/core").Signal<boolean>;
20
- selectAllIndeterminate: import("@angular/core").Signal<boolean>;
21
- clearSelection: () => void;
22
- toggleSelectAll: (allItems: T[]) => void;
23
- toggleItemSelection: (item: T, multiple: boolean) => void;
24
- isItemSelected: (item: T) => boolean;
25
- preserveSelection: (newData: T[]) => void;
26
- getSelectedItems: (allData: T[]) => T[];
27
- };
28
+ createSelectionState<T extends Record<string, unknown>>(): SelectionState<T>;
28
29
  private clearSelection;
29
30
  private toggleSelectAll;
30
31
  private toggleItemSelection;
@@ -44,3 +45,4 @@ export declare class TableSelectionService {
44
45
  static ɵfac: i0.ɵɵFactoryDeclaration<TableSelectionService, never>;
45
46
  static ɵprov: i0.ɵɵInjectableDeclaration<TableSelectionService>;
46
47
  }
48
+ export {};
@@ -189,6 +189,9 @@ import * as i0 from "@angular/core";
189
189
  cancelEdit(): void;
190
190
  saveEdit(row: T): void;
191
191
  /**
192
+ * Filtra los campos readOnly de los cambios para evitar enviarlos en las actualizaciones
193
+ */
194
+ private filterReadOnlyFields; /**
192
195
  * Convierte todos los valores de una fila según los tipos definidos en las columnas
193
196
  * Asegura que los datos emitidos tengan el tipo correcto (integer, number, boolean, etc.)
194
197
  */
@@ -15,6 +15,7 @@ export interface TableColDef {
15
15
  default?: unknown;
16
16
  min?: number;
17
17
  max?: number;
18
+ truncate?: number;
18
19
  }
19
20
  /**
20
21
  * Configuración de confirmación para acciones de tabla
@@ -2,6 +2,8 @@ import type { TableColDef, CustomTableAction } from './table.types';
2
2
  /**
3
3
  * Transform function para convertir valores string/boolean a boolean
4
4
  * Usado en @Input() con transform para habilitar sintaxis de atributos booleanos
5
+ * @param value
6
+ * @returns Valor convertido a boolean
5
7
  * @example [searchable]="true" o simplemente searchable
6
8
  */
7
9
  export declare function booleanAttribute(value: boolean | string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c80/ui",
3
- "version": "1.0.56",
3
+ "version": "1.0.58",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^20.3.9",
6
6
  "rxjs": "~7.8.0",