ngx-eiffage-material 0.7.3 → 0.8.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/index.d.ts CHANGED
@@ -7,12 +7,12 @@ import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-
7
7
  import { MatSelect, MatSelectChange } from '@angular/material/select';
8
8
  import { Observable, Subject } from 'rxjs';
9
9
  import { MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
10
+ import jsPDF from 'jspdf';
11
+ import { SortDirection, Sort } from '@angular/material/sort';
10
12
  import { DateRange } from '@angular/material/datepicker';
13
+ import moment from 'moment';
11
14
  import { MatMenuTrigger } from '@angular/material/menu';
12
15
  import { PageEvent, MatPaginator } from '@angular/material/paginator';
13
- import { SortDirection, Sort } from '@angular/material/sort';
14
- import jsPDF from 'jspdf';
15
- import moment from 'moment';
16
16
  import { MatTableDataSource } from '@angular/material/table';
17
17
  import { MatChipEvent } from '@angular/material/chips';
18
18
 
@@ -99,12 +99,18 @@ interface PaginatedTableConfig<T> {
99
99
  columns: PaginatedTableColumn<T>[];
100
100
  showQueryFilter?: boolean;
101
101
  queryFilterPlaceholder?: string;
102
- create?: TableBasicAction<T>;
102
+ create?: TableCreateAction<T>;
103
103
  update?: TableBasicAction<T>;
104
104
  clickOnRowForUpdate?: boolean;
105
105
  delete?: TableBasicAction<T>;
106
106
  deleteConfirm?: DeleteConfirm<T>;
107
107
  rowActions?: TableRowAction<T>[];
108
+ /**
109
+ * Máximo de botones de acción por fila (sin contar el de expandir). Si una fila tiene más, se
110
+ * quedan a la vista los primeros y el resto pasa a un menú «⋯», que ocupa el último hueco.
111
+ * Orden de las acciones: rowActions, editar y eliminar. Sin valor, se ven todas.
112
+ */
113
+ maxVisibleRowActions?: number;
108
114
  showAdvancedFilters?: boolean;
109
115
  expandableDetail?: boolean;
110
116
  expandableDetailTemplateRef?: () => TemplateRef<{
@@ -149,6 +155,15 @@ interface TableBasicAction<T> {
149
155
  disabled?: (row?: T) => boolean;
150
156
  tooltip?: (row?: T) => string;
151
157
  }
158
+ /**
159
+ * Botón de crear de la cabecera. Sin `label` es un icono (con `tooltip`); con `label` es un botón
160
+ * con contorno, icono y texto, al final de la barra: la acción principal de la pantalla.
161
+ */
162
+ interface TableCreateAction<T> extends TableBasicAction<T> {
163
+ label?: () => string;
164
+ /** Icono del botón con texto (por defecto `add`). */
165
+ icon?: string;
166
+ }
152
167
  interface TableRowAction<T> {
153
168
  id: string;
154
169
  show?: (row: T) => boolean;
@@ -523,6 +538,8 @@ interface NgxEiffageTexts {
523
538
  collapseRow: string;
524
539
  /** Nombre del filtro de columna en la opción «Sin …» de los selects de filtro. */
525
540
  columnFilter: string;
541
+ /** Botón «⋯» con las acciones de fila que no caben (maxVisibleRowActions). */
542
+ moreActions: string;
526
543
  };
527
544
  /** Diálogo de ordenar y mostrar columnas de las tablas. */
528
545
  columnsDialog: {
@@ -760,12 +777,14 @@ interface BasicTableConfig<T> {
760
777
  title: () => string;
761
778
  columns: BasicTableColumn<T>[];
762
779
  queryFilterPlaceholder?: string;
763
- create?: TableBasicAction<T>;
780
+ create?: TableCreateAction<T>;
764
781
  update?: TableBasicAction<T>;
765
782
  clickOnRowForUpdate?: boolean;
766
783
  delete?: TableBasicAction<T>;
767
784
  deleteConfirm?: DeleteConfirm<T>;
768
785
  rowActions?: TableRowAction<T>[];
786
+ /** Máximo de botones de acción por fila; el resto, en un menú «⋯» (ver PaginatedTableConfig). */
787
+ maxVisibleRowActions?: number;
769
788
  expandableDetail?: boolean;
770
789
  expandableDetailTemplateRef?: () => TemplateRef<{
771
790
  $implicit: T;
@@ -1252,6 +1271,23 @@ declare class NgxConfirmDialogComponent {
1252
1271
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxConfirmDialogComponent, "ngx-confirm-dialog", never, {}, {}, never, never, true, never>;
1253
1272
  }
1254
1273
 
1274
+ /** Un botón de acción de una fila, ya resuelto para pintarlo en línea o en el menú «⋯». */
1275
+ interface RowActionItem<T> {
1276
+ kind: 'custom' | 'update' | 'delete';
1277
+ /** La acción de rowActions (solo en las propias). */
1278
+ action?: TableRowAction<T>;
1279
+ icon: string;
1280
+ /** Tooltip y aria-label en línea; texto de la opción en el menú. */
1281
+ label: string;
1282
+ disabled: boolean;
1283
+ /** Clase del color del icono (contrato público: editButtonIcon, deleteButtonIcon, rowActionIconColor*). */
1284
+ colorClass: string;
1285
+ }
1286
+ interface RowActionsLayout<T> {
1287
+ inline: RowActionItem<T>[];
1288
+ menu: RowActionItem<T>[];
1289
+ }
1290
+
1255
1291
  declare class NgxPaginatedTable<T, U extends PaginatedFilter<T>> implements OnDestroy {
1256
1292
  private readonly columnConfigService;
1257
1293
  private readonly advancedFilterService;
@@ -1293,6 +1329,16 @@ declare class NgxPaginatedTable<T, U extends PaginatedFilter<T>> implements OnDe
1293
1329
  protected readonly queryText: WritableSignal<string>;
1294
1330
  /** Texto de cada celda de la página (sin componente ni plantilla), calculado una vez. */
1295
1331
  protected readonly cellTexts: Signal<Map<T, Record<keyof T, string>>>;
1332
+ /**
1333
+ * Acciones de cada fila de la página (propias, editar y eliminar), en línea y en el menú «⋯».
1334
+ * show, disabled y tooltip se recalculan al cambiar los datos, la config, los textos o los
1335
+ * signals que lean.
1336
+ */
1337
+ protected readonly rowActionLayouts: Signal<Map<T, RowActionsLayout<T>>>;
1338
+ /** Filas de relleno mientras se carga una página sin datos que enseñar. */
1339
+ protected readonly skeletonRows: number[];
1340
+ /** Anchos de las barras del relleno, para que no parezcan una rejilla. */
1341
+ protected readonly skeletonWidths: string[];
1296
1342
  /** Total por página (de lo cargado) y general (lo da el consumidor con getTotalGeneral), ya formateados. */
1297
1343
  protected readonly pageTotals: Signal<Record<string, string>>;
1298
1344
  protected readonly generalTotals: Signal<Record<string, string>>;
@@ -1326,6 +1372,8 @@ declare class NgxPaginatedTable<T, U extends PaginatedFilter<T>> implements OnDe
1326
1372
  protected isRowEnabled(row: T): boolean | undefined;
1327
1373
  protected onDeleteClick(row: T, event: Event): void;
1328
1374
  protected onRowActionClick(row: T, rowAction: TableRowAction<T>, event: Event): void;
1375
+ /** Un botón de acción de fila, en línea o en el menú «⋯». */
1376
+ protected onRowActionItemClick(row: T, item: RowActionItem<T>, event: Event): void;
1329
1377
  protected onTextFilterColumnChange(column: PaginatedTableColumn<T>, event: Event): void;
1330
1378
  protected onPaginatedOptionFilterColumnChange(column: PaginatedTableColumn<T>, option?: FilterOption | FilterOption[]): void;
1331
1379
  protected onOptionFilterColumnChange(column: PaginatedTableColumn<T>, value?: string | string[]): void;
@@ -1417,6 +1465,16 @@ declare class NgxBasicTable<T, U extends BasicFilter<T>> {
1417
1465
  protected readonly queryText: WritableSignal<string>;
1418
1466
  /** Texto de cada celda de la página (sin componente ni plantilla), calculado una vez. */
1419
1467
  protected readonly cellTexts: _angular_core.Signal<Map<T, Record<keyof T, string>>>;
1468
+ /**
1469
+ * Acciones de cada fila de la página visible (propias, editar y eliminar), en línea y en el menú «⋯».
1470
+ * show, disabled y tooltip se recalculan al cambiar los datos, la página, la config, los textos o
1471
+ * los signals que lean.
1472
+ */
1473
+ protected readonly rowActionLayouts: _angular_core.Signal<Map<T, RowActionsLayout<T>>>;
1474
+ /** Filas de relleno mientras se carga sin datos que enseñar. */
1475
+ protected readonly skeletonRows: number[];
1476
+ /** Anchos de las barras del relleno, para que no parezcan una rejilla. */
1477
+ protected readonly skeletonWidths: string[];
1420
1478
  /** Totales por página y generales ya formateados, por clave de columna. */
1421
1479
  protected readonly pageTotals: _angular_core.Signal<Record<string, string>>;
1422
1480
  protected readonly generalTotals: _angular_core.Signal<Record<string, string>>;
@@ -1452,6 +1510,8 @@ declare class NgxBasicTable<T, U extends BasicFilter<T>> {
1452
1510
  protected isRowEnabled(row: T): boolean | undefined;
1453
1511
  protected onDeleteClick(row: T, event: Event): void;
1454
1512
  protected onRowActionClick(row: T, rowAction: TableRowAction<T>, event: Event): void;
1513
+ /** Un botón de acción de fila, en línea o en el menú «⋯». */
1514
+ protected onRowActionItemClick(row: T, item: RowActionItem<T>, event: Event): void;
1455
1515
  protected onEditColumns(): void;
1456
1516
  protected getRowSelectionAction(): RowSelectionAction<T>[];
1457
1517
  protected uncheckAllSelection(): void;
@@ -2270,4 +2330,4 @@ declare class NgxHighlightPipe implements PipeTransform {
2270
2330
  }
2271
2331
 
2272
2332
  export { AdvancedFilterService, AdvancedFilterUtils, ColumnConfigService, DatosPantallaService, DialogBodyType, DynamicHostDirective, NGX_EIFFAGE_DEFAULT_TEXTS, NGX_EIFFAGE_TEXTS, NgxAlert, NgxBasicSelect, NgxBasicTable, NgxConfirmDialogComponent, NgxDialog, NgxDialogContext, NgxDialogHeader, NgxDialogService, NgxFileInput, NgxHighlightPipe, NgxInputFile, NgxLoadingButton, NgxPaginatedSelect, NgxPaginatedSelectBottomSheetComponent, NgxPaginatedTable, NgxSkeleton, NgxTablesIntl, NgxTexts, OPERATOR_BY_FILTER_TYPE, PaginatedSearchableSelectComponent, SearchableSelectComponent, USER_ID_FACTORY, base64ToUtf8, includeNoSensible, isFilterOption, provideNgxEiffageTexts };
2273
- export type { AdvancedFilter, AlertAppearance, AlertType, BasicFilter, BasicSelectConfig, BasicTableColumn, BasicTableConfig, ColumnConfig, ColumnPipe, ColumnValue, ConfigureTableColumnData, ConfirmDialogData, DeleteConfirm, DialogBodyConfig, DialogConfig, DynamicFilter, FilterConnector, FilterGroup, FilterOperator, FilterOption, FilterRule, FilterType, LoadingButtonAppearance, LoadingButtonColor, NgxDialogTemplateContext, NgxEiffageTexts, NgxEiffageTextsOverrides, NgxEiffageTextsSource, NgxFileError, NgxFileErrorCode, NgxFileInputVariant, NgxFileItem, NgxPaginatedSelectBottomSheetData, NgxPaginatedSelectPageCache, PaginatedFilter, PaginatedItems, PaginatedSelectConfig, PaginatedSelectOptionContext, PaginatedTableColumn, PaginatedTableConfig, Pantalla, RowActionClickEvent, RowActionIconColor, RowSelectionAction, SelectionActionEvent, SendType, SkeletonAnimation, SkeletonVariant, SortBy, SortType, TableBasicAction, TableRowAction, TipoPantalla };
2333
+ export type { AdvancedFilter, AlertAppearance, AlertType, BasicFilter, BasicSelectConfig, BasicTableColumn, BasicTableConfig, ColumnConfig, ColumnPipe, ColumnValue, ConfigureTableColumnData, ConfirmDialogData, DeleteConfirm, DialogBodyConfig, DialogConfig, DynamicFilter, FilterConnector, FilterGroup, FilterOperator, FilterOption, FilterRule, FilterType, LoadingButtonAppearance, LoadingButtonColor, NgxDialogTemplateContext, NgxEiffageTexts, NgxEiffageTextsOverrides, NgxEiffageTextsSource, NgxFileError, NgxFileErrorCode, NgxFileInputVariant, NgxFileItem, NgxPaginatedSelectBottomSheetData, NgxPaginatedSelectPageCache, PaginatedFilter, PaginatedItems, PaginatedSelectConfig, PaginatedSelectOptionContext, PaginatedTableColumn, PaginatedTableConfig, Pantalla, RowActionClickEvent, RowActionIconColor, RowSelectionAction, SelectionActionEvent, SendType, SkeletonAnimation, SkeletonVariant, SortBy, SortType, TableBasicAction, TableCreateAction, TableRowAction, TipoPantalla };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-eiffage-material",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/cdk": "^20.0.0 || ^21.0.0 || ^22.0.0",