@oneteme/jquery-table 0.0.8 → 0.0.9

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.
@@ -1,95 +0,0 @@
1
- import { ViewEvent, ViewField, ViewState } from '@oneteme/jquery-core';
2
- import { TableColumnProvider, TableViewConfig } from '../../jquery-table.model';
3
- import { SliceConfig } from '../slice-panel/slice-panel.model';
4
- export type { ViewField, ViewConfig, ViewState, ViewEvent } from '@oneteme/jquery-core';
5
- export { viewField, groupableViewFields, sliceableViewFields, initialViewState } from '@oneteme/jquery-core';
6
- export interface ViewFieldState {
7
- activeColumns: TableColumnProvider<any>[];
8
- /** true si l'utilisateur a déjà personnalisé la sélection de colonnes */
9
- userCustomized: boolean;
10
- }
11
- export interface ViewGroupByState {
12
- activeKey: string | null;
13
- userCustomized: boolean;
14
- }
15
- export interface ViewSliceByState {
16
- activeDynamicColumns: TableColumnProvider<any>[];
17
- availableForDynamic: TableColumnProvider<any>[];
18
- allDynamicColumns: TableColumnProvider<any>[];
19
- activeLabel: string;
20
- }
21
- export interface ViewPanelConfig {
22
- /** Config brute issue de TableProvider.view */
23
- config?: TableViewConfig;
24
- /** Toutes les colonnes résolues (non filtrées) */
25
- columns: TableColumnProvider<any>[];
26
- /** Slices statiques */
27
- sliceConfigs: SliceConfig<any>[];
28
- /** Label utilisé quand aucun groupe / aucune slice n’est actif. Défaut : 'Aucun'. */
29
- noneLabel?: string; /** Clé de colonne utilisée comme group-by par défaut au chargement. */
30
- defaultGroupBy?: string | null;
31
- }
32
- /**
33
- * Centralise l'état et les actions du panneau View (Champs / Group by / Slice by).
34
- * Pas de dépendance Angular/DOM : peut être extraite vers jquery-core à terme.
35
- *
36
- * Usage :
37
- * this._view = new ViewFacade();
38
- * this._view.events$.subscribe(e => { ... });
39
- * this._view.update({ config, columns, sliceConfigs });
40
- */
41
- export declare class ViewFacade<T = any> {
42
- readonly fields: ViewFieldState;
43
- readonly groupBy: ViewGroupByState;
44
- readonly sliceBy: ViewSliceByState;
45
- private _panelConfig;
46
- private _hiddenStaticKeys;
47
- private readonly _events$;
48
- readonly events$: import("rxjs").Observable<ViewEvent>;
49
- get enabled(): boolean;
50
- get showFields(): boolean;
51
- get showGroupBySection(): boolean;
52
- get showSliceBySection(): boolean;
53
- get allowColumnRemoval(): boolean;
54
- get isColumnDragDropEnabled(): boolean;
55
- get menuBaseColumns(): TableColumnProvider<T>[];
56
- get menuOptionalColumns(): TableColumnProvider<T>[];
57
- get totalColumnCount(): number;
58
- get groupByColumns(): TableColumnProvider<T>[];
59
- get activeGroupByLabel(): string;
60
- get staticSlicesForMenu(): Array<{
61
- key: string;
62
- title: string;
63
- icon?: string;
64
- }>;
65
- colLabel(col: {
66
- key: string;
67
- header?: string;
68
- }): string;
69
- update(panelConfig: ViewPanelConfig): void;
70
- setActiveColumns(columns: TableColumnProvider<T>[]): void;
71
- setUserCustomized(value: boolean): void;
72
- /** Remet la vue dans son état initial : colonnes par défaut, groupBy par défaut, pas de dynamic slices. */
73
- resetToDefaults(): void;
74
- addColumn(column: TableColumnProvider<T>): void;
75
- removeColumn(columnKey: string): boolean;
76
- toggleColumnVisibility(column: TableColumnProvider<T>, visible: boolean): void;
77
- reorderColumns(fromKey: string, toKey: string): boolean;
78
- isColumnVisible(key: string): boolean;
79
- setGroupBy(key: string | null): void;
80
- /** Appelée quand le SlicePanelComponent émet dynamicSliceKeysChange */
81
- onDynamicSliceKeysChange(keys: string[]): void;
82
- isDynamicSliceActive(key: string): boolean;
83
- /** Retourne un snapshot ViewState (contrat core) de l'état courant. */
84
- toViewState(): ViewState;
85
- /** Convertit une TableColumnProvider en ViewField (contrat core). */
86
- static toViewField(col: TableColumnProvider<any>): ViewField;
87
- destroy(): void;
88
- private _refreshDefaultColumns;
89
- private _refreshDynamicSliceMeta;
90
- /** Notifie la facade des slices statiques actuellement cachées (géré par table.component).
91
- * Recalcule le label slice afin qu'il reflète uniquement les slices visibles. */
92
- updateHiddenStaticKeys(keys: Set<string>): void;
93
- private _computeSliceLabel;
94
- private _uniqueByKey;
95
- }