@oneteme/jquery-table 0.0.2 → 0.0.5

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.
@@ -150,6 +150,8 @@ export declare class TableComponent<T = any> implements OnChanges, AfterContentI
150
150
  /** Vrai si une configuration est sauvegardée pour ce tableau. */
151
151
  _hasSavedConfig: boolean;
152
152
  private _preferencesManager;
153
+ /** true une fois que le group-by par défaut a été initialisé (évite de reconfigurer GroupByManager à chaque changement de données). */
154
+ private _defaultGroupByApplied;
153
155
  private _resizeState;
154
156
  /** Dynamic slice keys à restaurer après ngAfterViewInit (slicePanelRef pas encore dispo). */
155
157
  private _pendingDynamicSliceKeys;
@@ -309,6 +311,7 @@ export declare class TableComponent<T = any> implements OnChanges, AfterContentI
309
311
  private _executeRender;
310
312
  private _projectCurrentPage;
311
313
  private buildEffectiveConfig;
314
+ private static _hashColumns;
312
315
  private resolveData;
313
316
  private resolveColumnsFromCompat;
314
317
  private getCategoryFilteredData;
@@ -10,6 +10,7 @@ export interface ViewFieldState {
10
10
  }
11
11
  export interface ViewGroupByState {
12
12
  activeKey: string | null;
13
+ userCustomized: boolean;
13
14
  }
14
15
  export interface ViewSliceByState {
15
16
  activeDynamicColumns: TableColumnProvider<any>[];
@@ -25,7 +26,8 @@ export interface ViewPanelConfig {
25
26
  /** Slices statiques */
26
27
  sliceConfigs: SliceConfig<any>[];
27
28
  /** Label utilisé quand aucun groupe / aucune slice n’est actif. Défaut : 'Aucun'. */
28
- noneLabel?: string;
29
+ noneLabel?: string; /** Clé de colonne utilisée comme group-by par défaut au chargement. */
30
+ defaultGroupBy?: string | null;
29
31
  }
30
32
  /**
31
33
  * Centralise l'état et les actions du panneau View (Champs / Group by / Slice by).
@@ -67,7 +69,7 @@ export declare class ViewFacade<T = any> {
67
69
  update(panelConfig: ViewPanelConfig): void;
68
70
  setActiveColumns(columns: TableColumnProvider<T>[]): void;
69
71
  setUserCustomized(value: boolean): void;
70
- /** Remet la vue dans son état initial : colonnes par défaut, pas de groupBy, pas de dynamic slices. */
72
+ /** Remet la vue dans son état initial : colonnes par défaut, groupBy par défaut, pas de dynamic slices. */
71
73
  resetToDefaults(): void;
72
74
  addColumn(column: TableColumnProvider<T>): void;
73
75
  removeColumn(columnKey: string): boolean;
@@ -74,7 +74,7 @@ export interface TableLabelsConfig {
74
74
  export declare function col<T = any>(key: string, header: string, overrides?: Partial<TableColumnProvider<T>>): TableColumnProvider<T>;
75
75
  /** Configuration de l’export CSV déclenché depuis la toolbar. */
76
76
  export interface TableExportConfig<T = any> {
77
- /** Affiche le bouton Export dans la toolbar. Par défaut : `false`. */
77
+ /** Affiche le bouton Export dans la toolbar. Par défaut : `true`. */
78
78
  enabled?: boolean;
79
79
  /** Nom du fichier généré. Par défaut : `'export.csv'`. */
80
80
  filename?: string;
@@ -96,14 +96,15 @@ export interface TableExportConfig<T = any> {
96
96
  * Chaque tableau est identifié par `tableId` (clé localStorage unique).
97
97
  */
98
98
  export interface TablePreferencesConfig {
99
- /** Active la fonctionnalité. Par défaut : `false`. */
99
+ /** Active la fonctionnalité. Par défaut : `true`. */
100
100
  enabled?: boolean;
101
101
  /**
102
102
  * Identifiant unique du tableau, utilisé comme clé localStorage.
103
103
  * Doit être stable entre les rechargements de page.
104
+ * Si absent, un identifiant est dérivé automatiquement des clés de colonnes.
104
105
  * Exemple : `'user-table'`, `'invoice-list'`.
105
106
  */
106
- tableId: string;
107
+ tableId?: string;
107
108
  }
108
109
  /** Snapshot de configuration persisté dans le localStorage. */
109
110
  export interface SavedTableConfig {
@@ -141,6 +142,8 @@ export interface TableProvider<T = any> {
141
142
  active: string;
142
143
  direction: 'asc' | 'desc';
143
144
  };
145
+ /** Clé de colonne à utiliser comme group-by par défaut au chargement. N'est pas écrasé par les changements de données ni par un reset explicite de l'utilisateur. */
146
+ defaultGroupBy?: string | null;
144
147
  rowClass?: (row: T, index: number) => string | string[] | Record<string, boolean>;
145
148
  /** Callback déclenché quand l'utilisateur clique sur une ligne. Alternative au `(rowSelected)` Output. */
146
149
  onRowSelected?: (row: T, event: MouseEvent | null) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneteme/jquery-table",
3
- "version": "0.0.2",
3
+ "version": "0.0.5",
4
4
  "description": "jquery table lib",
5
5
  "homepage": "https://github.com/oneteme/jquery-charts",
6
6
  "bugs": "https://github.com/oneteme/jquery-charts/issues",
@@ -13,7 +13,7 @@
13
13
  "@angular/core": ">=16.1.0",
14
14
  "@angular/material": "^16.1.0",
15
15
  "@angular/cdk": "^16.1.0",
16
- "@oneteme/jquery-core": "^0.0.28"
16
+ "@oneteme/jquery-core": "^0.0.32"
17
17
  },
18
18
  "dependencies": {
19
19
  "tslib": "^2.3.0"