@3kles/kles-material-table-v2 21.4.2 → 21.5.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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Signal, EventEmitter, Type, WritableSignal, OnInit, AfterViewInit, OnDestroy, ElementRef, InjectionToken } from '@angular/core';
2
+ import { Signal, EventEmitter, Type, WritableSignal, Injector, OnInit, AfterViewInit, OnDestroy, ElementRef, InjectionToken } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
- import { FormControlStatus, FormGroup, FormArray, ValidatorFn, AsyncValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';
4
+ import { FormGroup, FormControlStatus, FormArray, ValidatorFn, AsyncValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';
5
5
  import { MatTableDataSource, MatTable } from '@angular/material/table';
6
6
  import * as i4 from '@3kles/kles-material-dynamicforms';
7
7
  import { IKlesFieldConfig, GroupUiState, ArrayUiState, AbstractUiState } from '@3kles/kles-material-dynamicforms';
@@ -10,6 +10,7 @@ import * as rxjs from 'rxjs';
10
10
  import { Observable, Subject } from 'rxjs';
11
11
  import { PageEvent, MatPaginatorIntl, MatPaginatorSelectConfig, MatPaginator } from '@angular/material/paginator';
12
12
  import { CdkDrag, CdkDragDrop } from '@angular/cdk/drag-drop';
13
+ import * as _3kles_kles_material_table_v2 from '@3kles/kles-material-table-v2';
13
14
  import { DataSource } from '@angular/cdk/table';
14
15
 
15
16
  declare enum AlignCell {
@@ -24,7 +25,9 @@ declare enum Span {
24
25
 
25
26
  type B = Omit<IKlesFieldConfig, 'name'>;
26
27
  type C = Omit<IKlesFieldConfig, 'name' | 'value'>;
27
- type NgStyleInput = Record<string, any> | ((value?: any, status?: FormControlStatus, row?: Record<string, any>, rowStatus?: FormControlStatus) => Record<string, string | any>);
28
+ type KlesStyleValue = string | number | null | undefined;
29
+ type KlesStyleMap = Record<string, KlesStyleValue>;
30
+ type NgStyleInput = KlesStyleMap | ((value?: unknown, status?: FormControlStatus, row?: Record<string, unknown>, rowStatus?: FormControlStatus) => KlesStyleMap);
28
31
  interface IStyle {
29
32
  ngStyle?: NgStyleInput;
30
33
  }
@@ -32,13 +35,16 @@ interface IKlesHeaderFieldConfig {
32
35
  field?: B;
33
36
  label?: string;
34
37
  tooltip?: string;
38
+ /** Displays the action used to clear this column's filter. */
35
39
  filterClearable?: boolean;
36
- filterPredicate?: (value: any, filter: any) => boolean;
37
- sortPredicate?: (data: any) => string | number;
40
+ /** Overrides the default filter predicate for this column. */
41
+ filterPredicate?: (value: unknown, filter: unknown) => boolean;
42
+ /** Overrides the default sorting value for this column. */
43
+ sortPredicate?: (data: FormGroup) => string | number;
38
44
  style?: IStyle;
39
45
  }
40
46
  interface IKlesCellFieldConfig {
41
- executeAfterChange?: (property?: string, row?: any, group?: FormGroup<any> | FormArray<any>) => Observable<any>;
47
+ executeAfterChange?: (property?: string, row?: unknown, group?: FormGroup | FormArray) => Observable<unknown>;
42
48
  style?: IStyle;
43
49
  field?: C;
44
50
  }
@@ -53,6 +59,7 @@ interface KlesExtraCellFieldConfig extends IKlesCellFieldConfig {
53
59
  }
54
60
 
55
61
  type ColumnSeparatorStyle = 'solid' | 'dashed' | 'dotted' | 'double';
62
+ type ColumnClass = string | string[] | Set<string> | Record<string, boolean | null | undefined>;
56
63
  interface ColumnSeparatorConfig {
57
64
  color?: string;
58
65
  width?: string;
@@ -69,7 +76,7 @@ interface KlesColumnConfig {
69
76
  visible?: boolean;
70
77
  visibleWhen?: Signal<boolean>;
71
78
  disabled?: boolean;
72
- ngClass?: any;
79
+ ngClass?: ColumnClass;
73
80
  filterable?: boolean;
74
81
  sortable?: boolean;
75
82
  sortArrowPosition?: SortHeaderArrowPosition;
@@ -87,6 +94,7 @@ interface KlesColumnConfig {
87
94
  }
88
95
 
89
96
  interface ColumnApi {
97
+ getVisible(): string[];
90
98
  setVisible(columnDef: string, visible: boolean): void;
91
99
  toggleVisible(columnDef: string): void;
92
100
  changeWidth(columnDef: string, options: {
@@ -94,27 +102,30 @@ interface ColumnApi {
94
102
  maxWidth?: string;
95
103
  minWidth?: string;
96
104
  }): void;
97
- setResizable(columnDef: string, resizable: boolean): any;
98
- toggleResizable(columnDef: string): any;
105
+ setResizable(columnDef: string, resizable: boolean): void;
106
+ toggleResizable(columnDef: string): void;
99
107
  setSticky(columnDef: string, options: {
100
108
  sticky?: boolean;
101
109
  stickyEnd?: boolean;
102
- }): any;
110
+ }): void;
103
111
  columns(): KlesColumnConfig[];
104
- setColumnPosition: (columnDef: any, position: number) => void;
112
+ setColumnPosition(columnDef: string, position: number): void;
105
113
  }
106
114
 
107
- interface FooterApi$1 {
115
+ interface FooterApi {
116
+ visible: Signal<boolean>;
108
117
  show(): void;
109
118
  hide(): void;
110
119
  }
111
120
 
112
121
  interface LoadingApi {
113
- start(): any;
114
- stop(): any;
122
+ active: Signal<boolean>;
123
+ start(): void;
124
+ stop(): void;
115
125
  }
116
126
 
117
127
  interface PaginationApi {
128
+ disabled: Signal<boolean>;
118
129
  setPageIndex(value: number): void;
119
130
  setPageSize(value: number): void;
120
131
  setPageSizeOptions(option: number[]): void;
@@ -126,6 +137,9 @@ interface PaginationApi {
126
137
  }
127
138
 
128
139
  interface ScrollbarApi {
140
+ setVisible(visible: boolean): void;
141
+ show(): void;
142
+ hide(): void;
129
143
  toTop(sb?: ScrollBehavior): void;
130
144
  toLeft(sb?: ScrollBehavior): void;
131
145
  toBottom(sb?: ScrollBehavior): void;
@@ -140,6 +154,21 @@ declare enum KlesSelectionModelState {
140
154
  }
141
155
 
142
156
  interface IKlesSelectionModel<T> {
157
+ readonly count: Signal<number>;
158
+ readonly changed: Observable<{
159
+ added?: T[];
160
+ removed?: T[];
161
+ count: number;
162
+ state: KlesSelectionModelState;
163
+ }>;
164
+ readonly stateChanged: Observable<KlesSelectionModelState>;
165
+ readonly selected: {
166
+ items: T[];
167
+ count: number;
168
+ state: KlesSelectionModelState;
169
+ };
170
+ readonly state: KlesSelectionModelState;
171
+ readonly selectionMode: boolean;
143
172
  select(value: T | T[], options?: {
144
173
  emitEvent?: boolean;
145
174
  }): void;
@@ -149,22 +178,15 @@ interface IKlesSelectionModel<T> {
149
178
  toggle(value: T, options?: {
150
179
  emitEvent?: boolean;
151
180
  }): void;
181
+ reset(values: T[], options?: {
182
+ emitEvent?: boolean;
183
+ }): void;
184
+ isSelected(value: T): boolean;
185
+ isMultipleSelection(): boolean;
152
186
  isEmpty(): boolean;
153
187
  hasValue(): boolean;
154
188
  disable(): void;
155
189
  enable(): void;
156
- get selected(): {
157
- items?: T[];
158
- count: number;
159
- state: KlesSelectionModelState;
160
- };
161
- get changed(): Observable<{
162
- added?: T[];
163
- removed?: T[];
164
- count: number;
165
- state: KlesSelectionModelState;
166
- }>;
167
- get state(): KlesSelectionModelState;
168
190
  }
169
191
 
170
192
  interface SelectionApi {
@@ -180,63 +202,51 @@ interface SortApi {
180
202
  sortChange(): EventEmitter<Sort>;
181
203
  }
182
204
 
183
- interface FormApi {
184
- header: HeaderApi;
185
- rows: RowsApi;
186
- footer: FooterApi;
205
+ type FormValue = Record<string, unknown>;
206
+ type TableFormValue<TValue> = TValue extends object ? TValue : FormValue;
207
+ interface FormApi<TRow = FormValue> {
208
+ header: HeaderFormApi;
209
+ rows: RowsFormApi<TRow>;
210
+ footer: FooterFormApi;
187
211
  }
188
212
  type Id = string | number;
189
- interface HeaderApi {
190
- setValue(value: {
191
- [key: string]: any;
192
- }, options?: {
213
+ interface HeaderFormApi {
214
+ setValue(value: FormValue, options?: {
193
215
  emitEvent?: boolean;
194
216
  onlySelf?: boolean;
195
217
  }): void;
196
- patchValue(value: {
197
- [key: string]: any;
198
- }, options?: {
218
+ patchValue(value: FormValue, options?: {
199
219
  emitEvent?: boolean;
200
220
  onlySelf?: boolean;
201
221
  }): void;
202
222
  get(): FormGroup;
203
- clear(value?: any, options?: {
223
+ clear(value?: unknown, options?: {
204
224
  emitEvent?: boolean;
205
225
  }): void;
206
226
  }
207
- interface FooterApi {
208
- setValue(value: {
209
- [key: string]: any;
210
- }, options?: {
227
+ interface FooterFormApi {
228
+ setValue(value: FormValue, options?: {
211
229
  emitEvent?: boolean;
212
230
  onlySelf?: boolean;
213
231
  }): void;
214
- patchValue(value: {
215
- [key: string]: any;
216
- }, options?: {
232
+ patchValue(value: FormValue, options?: {
217
233
  emitEvent?: boolean;
218
234
  onlySelf?: boolean;
219
235
  }): void;
220
236
  get(): FormGroup;
221
- clear(value?: any, options?: {
237
+ clear(value?: unknown, options?: {
222
238
  emitEvent?: boolean;
223
239
  }): void;
224
240
  }
225
- interface RowsApi {
226
- create(value: {
227
- [key: string]: any;
228
- }, index?: number, options?: {
241
+ interface RowsFormApi<TRow = FormValue> {
242
+ create(value: TRow, index?: number, options?: {
229
243
  emitEvent?: boolean;
230
244
  }): FormGroup;
231
- patch(_id: Id, value: {
232
- [key: string]: any;
233
- }, options?: {
245
+ patch(_id: Id, value: Partial<TRow>, options?: {
234
246
  emitEvent?: boolean;
235
247
  onlySelf?: boolean;
236
248
  }): FormGroup | undefined;
237
- reset(_id: Id, value?: {
238
- [key: string]: any;
239
- }, options?: {
249
+ reset(_id: Id, value?: TRow, options?: {
240
250
  emitEvent?: boolean;
241
251
  onlySelf?: boolean;
242
252
  overwriteDefaultValue?: boolean;
@@ -248,28 +258,6 @@ interface RowsApi {
248
258
  get(_id: Id): FormGroup | undefined;
249
259
  }
250
260
 
251
- interface EventsApi {
252
- listen(): Observable<any>;
253
- }
254
-
255
- interface ITable {
256
- scrollbar: ScrollbarApi;
257
- column: ColumnApi;
258
- pagination?: PaginationApi | undefined;
259
- selection: SelectionApi;
260
- sort: SortApi;
261
- footer: FooterApi$1;
262
- loading: LoadingApi;
263
- form: FormApi;
264
- events: EventsApi;
265
- ui: GroupUiState<{
266
- header: GroupUiState;
267
- rows: ArrayUiState;
268
- footer: GroupUiState;
269
- }>;
270
- refresh(): void;
271
- }
272
-
273
261
  type Pagination = {
274
262
  page: number;
275
263
  perPage: number;
@@ -281,6 +269,9 @@ type Query = {
281
269
  filters?: Filters;
282
270
  };
283
271
 
272
+ type LoaderCallback<TArgs extends unknown[], TResult> = {
273
+ bivarianceHack(...args: TArgs): TResult;
274
+ }['bivarianceHack'];
284
275
  type LoaderLazyResult<R> = Observable<{
285
276
  total: number;
286
277
  items: R[];
@@ -291,39 +282,42 @@ type LoaderLazyResult<R> = Observable<{
291
282
  type LoaderResult<R> = Observable<{
292
283
  items: R[];
293
284
  }>;
294
- type LinesLoaderDef<T, R> = {
285
+ type LinesLoaderDef<T, R, C> = {
295
286
  params?: () => Observable<T>;
296
- loader: (params: T) => LoaderResult<R>;
297
- hasChildren?: (parent: FormGroup, depth: number) => boolean;
298
- childrens?: (params: T, parent: FormGroup, depth: number) => LoaderResult<R>;
287
+ loader: LoaderCallback<[params: T], LoaderResult<R>>;
288
+ hasChildren?: LoaderCallback<[parent: FormGroup, depth: number], boolean>;
289
+ childrens?: LoaderCallback<[params: T, parent: FormGroup, depth: number], LoaderResult<C>>;
299
290
  };
300
- type LinesLazyLoaderDef<T, R> = {
291
+ type LinesLazyLoaderDef<T, R, C> = {
301
292
  params?: () => Observable<T>;
302
- loader: (params: T, query?: Query) => LoaderLazyResult<R>;
303
- hasChildren?: (parent: FormGroup, depth: number) => boolean;
304
- childrens?: (params: T, parent: FormGroup, depth: number, query?: Query) => LoaderLazyResult<R>;
293
+ loader: LoaderCallback<[params: T, query?: Query], LoaderLazyResult<R>>;
294
+ hasChildren?: LoaderCallback<[parent: FormGroup, depth: number], boolean>;
295
+ childrens?: LoaderCallback<[params: T, parent: FormGroup, depth: number, query?: Query], LoaderLazyResult<C>>;
305
296
  };
306
297
  type Brand$1<K extends string> = {
307
298
  readonly __brand: K;
308
299
  };
309
- type LinesLoader<T, R> = LinesLoaderDef<T, R> & Brand$1<'LinesLoader'>;
310
- type LinesLazyLoader<T, R> = LinesLazyLoaderDef<T, R> & Brand$1<'LinesLazyLoader'>;
311
- declare const linesLoader: <T, R>(l: LinesLoaderDef<T, R>) => LinesLoader<T, R>;
312
- declare const linesLazyLoader: <T, R>(l: LinesLazyLoaderDef<T, R>) => LinesLazyLoader<T, R>;
313
-
300
+ type LinesLoader<T, R, C = R> = LinesLoaderDef<T, R, C> & Brand$1<'LinesLoader'>;
301
+ type LinesLazyLoader<T, R, C = R> = LinesLazyLoaderDef<T, R, C> & Brand$1<'LinesLazyLoader'>;
302
+ declare const linesLoader: <T, R, C = R>(l: LinesLoaderDef<T, R, C>) => LinesLoader<T, R, C>;
303
+ declare const linesLazyLoader: <T, R, C = R>(l: LinesLazyLoaderDef<T, R, C>) => LinesLazyLoader<T, R, C>;
304
+
305
+ type SelectionCallback<TArgs extends unknown[], TResult> = {
306
+ bivarianceHack(...args: TArgs): TResult;
307
+ }['bivarianceHack'];
314
308
  type RowId = string | number;
315
309
  interface SelectionResponse {
316
310
  selected: boolean;
317
311
  count?: number;
318
312
  }
319
313
  interface SelectionAllResponse extends SelectionResponse {
320
- footer?: any;
314
+ footer?: unknown;
321
315
  }
322
316
  interface SelectionState {
323
317
  loading: boolean;
324
318
  success: boolean;
325
319
  selected?: boolean;
326
- footer?: any;
320
+ footer?: unknown;
327
321
  count?: number;
328
322
  error?: unknown;
329
323
  }
@@ -331,15 +325,20 @@ type SelectionConfigDef<T> = {
331
325
  selectionMode?: boolean;
332
326
  key?: string;
333
327
  params?: () => Observable<T>;
334
- select?: (params: T, row: FormGroup, selected: boolean, filters?: {
335
- [key: string]: any;
336
- }) => Observable<SelectionResponse>;
337
- selectAll?: (params: T, selected: boolean, filters?: {
338
- [key: string]: any;
339
- }) => Observable<SelectionAllResponse>;
340
- /** optionnel */
341
- /** pour indiquer le critère des lignes déja sélectionné */
328
+ select?: SelectionCallback<[
329
+ params: T,
330
+ row: FormGroup,
331
+ selected: boolean,
332
+ filters?: Record<string, unknown>
333
+ ], Observable<SelectionResponse>>;
334
+ selectAll?: SelectionCallback<[
335
+ params: T,
336
+ selected: boolean,
337
+ filters?: Record<string, unknown>
338
+ ], Observable<SelectionAllResponse>>;
339
+ /** Resolves the initial selected state of a row. */
342
340
  isSelected?: (row: FormGroup) => boolean;
341
+ /** Resolves whether selection must remain disabled for a row. */
343
342
  isDisabled?: (row: FormGroup) => boolean;
344
343
  };
345
344
  type Brand<K extends string> = {
@@ -365,7 +364,9 @@ interface EmptyStateConfig {
365
364
  interface DefaultTableConfig {
366
365
  id?: string;
367
366
  columns: KlesColumnConfig[];
367
+ /** Reserved for row-level validation configuration; not applied yet. */
368
368
  lineValidations?: ValidatorFn[];
369
+ /** Reserved for asynchronous row-level validation configuration; not applied yet. */
369
370
  lineAsyncValidations?: AsyncValidatorFn[];
370
371
  footer?: boolean;
371
372
  sortConfig?: Sort;
@@ -382,26 +383,47 @@ interface PaginatorConfig {
382
383
  selectConfig?: MatPaginatorSelectConfig;
383
384
  }
384
385
  interface InfiniteScrollConfig {
386
+ /** Reserved for the future infinite-scroll implementation. */
385
387
  infinite?: boolean;
386
388
  }
387
- interface DragDropConfig {
389
+ interface DragDropRowChange<TValue = unknown> extends DragDropRowContext<TValue> {
390
+ previousIndex: number;
391
+ currentIndex: number;
392
+ previousContainerId?: string;
393
+ currentContainerId?: string;
394
+ parentId?: string | number | null;
395
+ depth?: number;
396
+ previousSiblingIndex?: number;
397
+ currentSiblingIndex?: number;
398
+ movedRows?: FormGroup[];
399
+ movedRawValues?: TValue[];
400
+ }
401
+ interface DragDropConfig<TValue = unknown> {
388
402
  enable?: boolean;
389
403
  options?: {
390
404
  autoScrollStep?: number;
391
405
  connectedTo?: string[];
392
406
  dragDisabled?: (row: FormGroup) => boolean;
407
+ drop?: (change: DragDropRowChange<TValue>) => Observable<unknown>;
393
408
  dragPreview?: {
394
409
  matchSize?: boolean;
395
- component: Type<any>;
410
+ component: Type<unknown>;
396
411
  };
397
412
  dragPlaceholder?: {
398
- component: Type<any>;
413
+ component: Type<unknown>;
399
414
  };
400
415
  };
401
416
  }
402
- interface DragDrop {
403
- dragDropRows?: DragDropConfig;
404
- drapDropColumns?: DragDropConfig;
417
+ interface DragDropRowContext<TValue = unknown> {
418
+ row: FormGroup;
419
+ rowIndex: number;
420
+ value: Partial<TValue>;
421
+ rawValue: TValue;
422
+ }
423
+ interface DragDrop<TValue = unknown> {
424
+ dragDropRows?: DragDropConfig<TValue>;
425
+ /** Reserved for the future column drag-and-drop implementation. */
426
+ dragDropColumns?: DragDropConfig<TValue>;
405
427
  }
406
428
  type ExtraRowMode = 'expand' | 'always';
407
429
  interface ExtraRowConfig {
@@ -428,89 +450,9 @@ type Exclusive<T, U> = (T & {
428
450
  }) | (U & {
429
451
  [K in keyof T]?: never;
430
452
  });
431
- type KlesTableConfig<T = any, R = any> = DefaultTableConfig & Exclusive<PaginatorConfig, InfiniteScrollConfig> & LoaderConfig<T, R> & DragDrop & Selection<T> & ExtraRow;
432
-
433
- interface ITableStore {
434
- reset(): void;
435
- }
436
-
437
- declare class PaginatorStore implements ITableStore {
438
- protected config: PaginatorConfig;
439
- private s;
440
- page$: Observable<Pagination>;
441
- constructor(config: PaginatorConfig);
442
- setPage(v: Pagination): void;
443
- snapshot(): Pagination;
444
- reset(): void;
445
- static ɵfac: i0.ɵɵFactoryDeclaration<PaginatorStore, [{ optional: true; }]>;
446
- static ɵprov: i0.ɵɵInjectableDeclaration<PaginatorStore>;
447
- }
448
-
449
- declare abstract class DragDropBase {
450
- protected config?: DragDropConfig;
451
- constructor(config?: DragDropConfig);
452
- get enable(): boolean;
453
- get autoScrollStep(): number | true;
454
- get connectedTo(): string[];
455
- get sortPredicate(): (index: number, item: CdkDrag<number>) => boolean;
456
- get previewComponent(): i0.Type<any>;
457
- get previewMatchSize(): true;
458
- abstract listDropped(event: CdkDragDrop<FormArray<FormGroup>>): void;
459
- }
460
- declare class DragDropService extends DragDropBase {
461
- protected config?: DragDropConfig;
462
- private paginatorStore?;
463
- constructor(config?: DragDropConfig, paginatorStore?: PaginatorStore | null);
464
- listDropped(event: CdkDragDrop<FormArray<FormGroup>>): void;
465
- static ɵfac: i0.ɵɵFactoryDeclaration<DragDropService, [{ optional: true; }, { optional: true; }]>;
466
- static ɵprov: i0.ɵɵInjectableDeclaration<DragDropService>;
467
- }
468
-
469
- declare class ScrollbarService {
470
- private element;
471
- private default;
472
- private readonly hiddenClass;
473
- register(el: HTMLElement): void;
474
- unregister(): void;
475
- setScrollbarVisible(visible: boolean): void;
476
- hideScrollbar(): void;
477
- showScrollbar(): void;
478
- toTop(sb?: ScrollBehavior): void;
479
- toBottom(sb?: ScrollBehavior): void;
480
- toLeft(sb?: ScrollBehavior): void;
481
- toRight(sb?: ScrollBehavior): void;
482
- to(top: number, left: number, sb?: ScrollBehavior): void;
483
- getTop(): number;
484
- static ɵfac: i0.ɵɵFactoryDeclaration<ScrollbarService, never>;
485
- static ɵprov: i0.ɵɵInjectableDeclaration<ScrollbarService>;
486
- }
487
-
488
- declare class KlesTableConnectorService {
489
- private _connected$;
490
- private _table?;
491
- readonly connected$: Observable<boolean>;
492
- constructor();
493
- connect(table: ITable): () => void;
494
- get table(): ITable;
495
- get scrollbar(): ScrollbarApi;
496
- get column(): ColumnApi;
497
- get pagination(): PaginationApi | undefined;
498
- get sort(): SortApi;
499
- get loading(): LoadingApi;
500
- get selection(): SelectionApi;
501
- get footer(): FooterApi$1;
502
- get form(): FormApi;
503
- get ui(): GroupUiState<{
504
- header: GroupUiState;
505
- rows: ArrayUiState;
506
- footer: GroupUiState;
507
- }>;
508
- get events(): EventsApi;
509
- refresh(): void;
510
- static ɵfac: i0.ɵɵFactoryDeclaration<KlesTableConnectorService, never>;
511
- static ɵprov: i0.ɵɵInjectableDeclaration<KlesTableConnectorService>;
512
- }
453
+ type KlesTableConfig<T = unknown, R = unknown> = DefaultTableConfig & Exclusive<PaginatorConfig, InfiniteScrollConfig> & LoaderConfig<T, R> & DragDrop<R> & Selection<T> & ExtraRow;
513
454
 
455
+ type AggregationType = 'sum' | 'avg' | 'min' | 'max' | 'count';
514
456
  interface SortPayload {
515
457
  active: string;
516
458
  direction: SortDirection;
@@ -531,6 +473,18 @@ interface RowPayload<TValue = unknown> {
531
473
  interface RowMousePayload<TValue = unknown> extends RowPayload<TValue> {
532
474
  event: MouseEvent;
533
475
  }
476
+ interface RowActionClickPayload<TValue = unknown> extends RowPayload<TValue> {
477
+ actionKey: string;
478
+ event?: MouseEvent;
479
+ }
480
+ interface BulkActionClickPayload<TValue = unknown> {
481
+ actionKey: string;
482
+ selectedRows: FormGroup[];
483
+ selectedValues: Partial<TValue>[];
484
+ selectedRawValues: TValue[];
485
+ selectedCount: number;
486
+ event?: MouseEvent;
487
+ }
534
488
  /**
535
489
  * Payload de base pour une cellule.
536
490
  */
@@ -556,6 +510,36 @@ interface CellValueChangePayload<TValue = unknown> {
556
510
  value: Partial<TValue>;
557
511
  rawValue: TValue;
558
512
  }
513
+ /**
514
+ * Sélection.
515
+ */
516
+ interface SelectionChangePayload<TValue = unknown> {
517
+ selectedRows: FormGroup[];
518
+ selectedValues: Partial<TValue>[];
519
+ selectedRawValues: TValue[];
520
+ selectedCount: number;
521
+ addedRows?: FormGroup[];
522
+ removedRows?: FormGroup[];
523
+ allSelected?: boolean;
524
+ }
525
+ interface SelectionErrorPayload<TValue = unknown> {
526
+ error: unknown;
527
+ requestedSelected: boolean;
528
+ previousSelected: boolean;
529
+ row?: FormGroup;
530
+ rowIndex?: number;
531
+ value?: Partial<TValue>;
532
+ rawValue?: TValue;
533
+ }
534
+ interface LoadingChangePayload {
535
+ loading: boolean;
536
+ }
537
+ interface VisibilityChangePayload {
538
+ visible: boolean;
539
+ }
540
+ interface EmptyStateChangePayload {
541
+ enabled: boolean;
542
+ }
559
543
  /**
560
544
  * Pagination.
561
545
  */
@@ -577,6 +561,9 @@ interface FilterChangePayload {
577
561
  currentValue: unknown;
578
562
  };
579
563
  }
564
+ interface GlobalSearchPayload {
565
+ search: string;
566
+ }
580
567
  /**
581
568
  * Colonnes.
582
569
  */
@@ -601,11 +588,11 @@ interface ColumnVisibilityChangePayload {
601
588
  /**
602
589
  * Drag & drop.
603
590
  */
604
- interface RowDropPayload<TValue = unknown> extends RowPayload<TValue> {
605
- previousIndex: number;
606
- currentIndex: number;
607
- previousContainerId?: string;
608
- currentContainerId?: string;
591
+ interface RowDropPayload<TValue = unknown> extends DragDropRowChange<TValue> {
592
+ }
593
+ interface RowDropErrorPayload<TValue = unknown> {
594
+ change: RowDropPayload<TValue>;
595
+ error: unknown;
609
596
  }
610
597
  interface ColumnDropPayload {
611
598
  columnDef: string;
@@ -620,6 +607,8 @@ interface ExpansionPayload<TValue = unknown> extends RowPayload<TValue> {
620
607
  }
621
608
  interface TreePayload<TValue = unknown> extends RowPayload<TValue> {
622
609
  level: number;
610
+ children?: FormGroup[];
611
+ childValues?: TValue[];
623
612
  }
624
613
  /**
625
614
  * Lazy loading.
@@ -634,6 +623,33 @@ interface LoadErrorPayload {
634
623
  error: unknown;
635
624
  message?: string;
636
625
  }
626
+ /**
627
+ * État / vue.
628
+ */
629
+ interface StateChangePayload {
630
+ columns: string[];
631
+ filters: Record<string, unknown>;
632
+ sort?: SortPayload;
633
+ pageIndex?: number;
634
+ pageSize?: number;
635
+ }
636
+ /**
637
+ * Footer / résumé.
638
+ */
639
+ interface SummaryChangePayload {
640
+ columnDef: string;
641
+ value: unknown;
642
+ aggregation: AggregationType;
643
+ }
644
+ /**
645
+ * Validation.
646
+ */
647
+ interface RowValidatePayload<TValue = unknown> extends RowPayload<TValue> {
648
+ valid: boolean;
649
+ invalid: boolean;
650
+ errors: ValidationErrors | null;
651
+ controlsErrors: Record<string, ValidationErrors | null>;
652
+ }
637
653
  interface ValidationErrorPayload<TValue = unknown> {
638
654
  row?: FormGroup;
639
655
  rowIndex?: number;
@@ -665,6 +681,15 @@ interface TableEventMap<TValue = unknown> {
665
681
  cellDoubleClick: CellMousePayload<TValue>;
666
682
  cellContextMenu: CellMousePayload<TValue>;
667
683
  cellValueChange: CellValueChangePayload<TValue>;
684
+ /**
685
+ * Sélection
686
+ */
687
+ selectionChange: SelectionChangePayload<TValue>;
688
+ rowSelect: RowPayload<TValue>;
689
+ rowUnselect: RowPayload<TValue>;
690
+ selectAll: SelectionChangePayload<TValue>;
691
+ unselectAll: SelectionChangePayload<TValue>;
692
+ selectionError: SelectionErrorPayload<TValue>;
668
693
  /**
669
694
  * pagination
670
695
  */
@@ -692,17 +717,14 @@ interface TableEventMap<TValue = unknown> {
692
717
  rowDragMove: RowPayload<TValue>;
693
718
  rowDragEnd: RowPayload<TValue>;
694
719
  rowDrop: RowDropPayload<TValue>;
695
- columnDragStart: ColumnPayload;
696
- columnDragEnd: ColumnPayload;
697
- columnDrop: ColumnDropPayload;
720
+ rowDropSuccess: RowDropPayload<TValue>;
721
+ rowDropError: RowDropErrorPayload<TValue>;
698
722
  /**
699
723
  * Expansion / tree
700
724
  */
701
725
  rowExpand: ExpansionPayload<TValue>;
702
726
  rowCollapse: ExpansionPayload<TValue>;
703
727
  rowToggleExpand: ExpansionPayload<TValue>;
704
- expandAll: void;
705
- collapseAll: void;
706
728
  nodeExpand: TreePayload<TValue>;
707
729
  nodeCollapse: TreePayload<TValue>;
708
730
  nodeLoadChildren: TreePayload<TValue>;
@@ -714,6 +736,12 @@ interface TableEventMap<TValue = unknown> {
714
736
  loadSuccess: LoadSuccessPayload<TValue>;
715
737
  loadError: LoadErrorPayload;
716
738
  refresh: void;
739
+ /**
740
+ * États d'affichage
741
+ */
742
+ loadingChange: LoadingChangePayload;
743
+ footerVisibilityChange: VisibilityChangePayload;
744
+ emptyStateChange: EmptyStateChangePayload;
717
745
  /**
718
746
  * Error / validation
719
747
  */
@@ -732,6 +760,56 @@ type TableEvent<TValue = unknown> = {
732
760
  }[keyof TableEventMap<TValue>];
733
761
  type TableEventPayload<TValue, K extends keyof TableEventMap<TValue>> = TableEventMap<TValue>[K];
734
762
 
763
+ interface EventsApi<TValue = unknown> {
764
+ listen(): Observable<TableEvent<TValue>>;
765
+ }
766
+
767
+ interface EmptyStateApi {
768
+ enabled: Signal<boolean>;
769
+ enable(): void;
770
+ disable(): void;
771
+ toggle(): void;
772
+ }
773
+
774
+ interface RenderApi {
775
+ rows(): void;
776
+ }
777
+
778
+ type TreeNodeId = string | number;
779
+ interface TreeApi {
780
+ readonly expandedIds: Signal<ReadonlySet<TreeNodeId>>;
781
+ readonly loadingIds: Signal<ReadonlySet<TreeNodeId>>;
782
+ isExpanded(id: TreeNodeId): boolean;
783
+ isLoading(id: TreeNodeId): boolean;
784
+ getChildren(id: TreeNodeId): FormGroup[];
785
+ getDescendants(id: TreeNodeId): FormGroup[];
786
+ expand(id: TreeNodeId): void;
787
+ collapse(id: TreeNodeId): void;
788
+ toggle(id: TreeNodeId): void;
789
+ collapseAll(): void;
790
+ }
791
+
792
+ interface ITable {
793
+ scrollbar: ScrollbarApi;
794
+ column: ColumnApi;
795
+ pagination?: PaginationApi | undefined;
796
+ selection: SelectionApi;
797
+ sort: SortApi;
798
+ footer: FooterApi;
799
+ loading: LoadingApi;
800
+ form: FormApi;
801
+ events: EventsApi;
802
+ emptyState: EmptyStateApi;
803
+ render: RenderApi;
804
+ tree: TreeApi;
805
+ ui: GroupUiState<{
806
+ header: GroupUiState;
807
+ rows: ArrayUiState;
808
+ footer: GroupUiState;
809
+ }>;
810
+ refresh(): void;
811
+ }
812
+
735
813
  declare class EventsService<TValue = unknown> {
736
814
  private readonly eventsSubject;
737
815
  readonly events$: Observable<TableEvent<TValue>>;
@@ -783,36 +861,12 @@ declare class ColumnsService {
783
861
  static ɵprov: i0.ɵɵInjectableDeclaration<ColumnsService>;
784
862
  }
785
863
 
786
- declare class LoadingService {
787
- private _loading;
788
- get loading(): i0.Signal<boolean>;
789
- start(): void;
790
- stop(): void;
791
- static ɵfac: i0.ɵɵFactoryDeclaration<LoadingService, never>;
792
- static ɵprov: i0.ɵɵInjectableDeclaration<LoadingService>;
793
- }
794
-
795
- interface IKlesDataSource extends DataSource<FormGroup> {
796
- set data(data: any[]);
797
- get paginator(): MatPaginator | null | undefined;
798
- set paginator(paginator: MatPaginator | null | undefined);
799
- get sort(): MatSort | null | undefined;
800
- set sort(sort: MatSort | null | undefined);
801
- get filter(): string | undefined;
802
- set filter(f: string);
803
- connect(): Observable<readonly FormGroup[]>;
804
- }
805
-
806
- declare class KlesDataSource extends MatTableDataSource<FormGroup, MatPaginator> implements IKlesDataSource {
807
- constructor();
808
- }
809
-
810
864
  interface KlesRowContext<TSource = unknown> {
811
865
  source: TSource;
812
866
  _id: string | number;
813
867
  meta: {
814
868
  depth: number;
815
- parentId: string | null;
869
+ parentId: string | number | null;
816
870
  };
817
871
  }
818
872
 
@@ -828,11 +882,11 @@ declare class RowFormFactory {
828
882
  };
829
883
  createRow<TSource extends Record<string, any>>(fields: IKlesFieldConfig[], record: TSource, meta?: {
830
884
  depth: number;
831
- parentId: string | null;
885
+ parentId: string | number | null;
832
886
  }): KlesCreatedRow<TSource>;
833
887
  createRows<TSource extends Record<string, any>>(fields: IKlesFieldConfig[], records: TSource[], meta?: {
834
888
  depth: number;
835
- parentId: string | null;
889
+ parentId: string | number | null;
836
890
  }): KlesCreatedRow<TSource>[];
837
891
  static ɵfac: i0.ɵɵFactoryDeclaration<RowFormFactory, never>;
838
892
  static ɵprov: i0.ɵɵInjectableDeclaration<RowFormFactory>;
@@ -848,6 +902,13 @@ declare class RowContextStore {
848
902
  static ɵprov: i0.ɵɵInjectableDeclaration<RowContextStore>;
849
903
  }
850
904
 
905
+ interface KlesRowMoveResult {
906
+ previousIndex: number;
907
+ currentIndex: number;
908
+ previousSiblingIndex: number;
909
+ currentSiblingIndex: number;
910
+ movedRows: FormGroup[];
911
+ }
851
912
  declare class KlesForm {
852
913
  private columnsService;
853
914
  private rowFactory;
@@ -864,7 +925,9 @@ declare class KlesForm {
864
925
  }>;
865
926
  readonly uiStore: WeakMap<AbstractControl<any, any, any>, AbstractUiState<any, any>>;
866
927
  private readonly rowsStructureChangedSubject;
928
+ private readonly rowsReplacedSubject;
867
929
  readonly rowsStructureChanged$: rxjs.Observable<void>;
930
+ readonly rowsReplaced$: rxjs.Observable<void>;
868
931
  constructor(columnsService: ColumnsService, rowFactory: RowFormFactory, rowContextStore: RowContextStore);
869
932
  getRows(): FormArray<FormGroup>;
870
933
  getUiRows(): ArrayUiState;
@@ -881,6 +944,19 @@ declare class KlesForm {
881
944
  groupUi: GroupUiState;
882
945
  };
883
946
  insertRows(rows: KlesCreatedRow[], index?: number): void;
947
+ moveRow(row: FormGroup, targetRow: FormGroup): {
948
+ previousIndex: number;
949
+ currentIndex: number;
950
+ } | undefined;
951
+ canMoveSubtree(row: FormGroup, targetRow: FormGroup): boolean;
952
+ moveSubtree(row: FormGroup, targetRow: FormGroup): KlesRowMoveResult | undefined;
953
+ getSubtreeRows(row: FormGroup): FormGroup[];
954
+ private getSiblingIndex;
955
+ transferRowTo(target: KlesForm, row: FormGroup, targetRow?: FormGroup): {
956
+ previousIndex: number;
957
+ currentIndex: number;
958
+ } | undefined;
959
+ transferSubtreeTo(target: KlesForm, row: FormGroup, targetRow?: FormGroup): KlesRowMoveResult | undefined;
884
960
  updateRow(_id: number | string, value: any, options?: {
885
961
  emitEvent?: boolean;
886
962
  onlySelf?: boolean;
@@ -893,6 +969,9 @@ declare class KlesForm {
893
969
  deleteRowById(id: number | string, option?: {
894
970
  emitEvent?: boolean;
895
971
  }): void;
972
+ deleteRowsByIds(ids: ReadonlyArray<number | string>, option?: {
973
+ emitEvent?: boolean;
974
+ }): void;
896
975
  setHeaderControl(name: string, header: AbstractControl, options?: {
897
976
  emitEvent?: false;
898
977
  }): void;
@@ -908,6 +987,133 @@ declare class KlesForm {
908
987
  static ɵprov: i0.ɵɵInjectableDeclaration<KlesForm>;
909
988
  }
910
989
 
990
+ declare abstract class DragDropBase {
991
+ protected config: DragDropConfig | undefined;
992
+ protected readonly eventsService: EventsService;
993
+ protected readonly klesForm: KlesForm;
994
+ protected readonly injector: Injector;
995
+ private static nextDropListId;
996
+ readonly dropListId: string;
997
+ constructor(config: DragDropConfig | undefined, eventsService: EventsService, klesForm: KlesForm, injector: Injector, tableId?: string);
998
+ get enable(): boolean;
999
+ get autoScrollStep(): number;
1000
+ get connectedTo(): string[];
1001
+ get sortPredicate(): (index: number, item: CdkDrag<FormGroup>) => boolean;
1002
+ get previewComponent(): i0.Type<unknown>;
1003
+ get previewMatchSize(): boolean;
1004
+ get placeholderComponent(): i0.Type<unknown>;
1005
+ isDragDisabled(row: FormGroup): boolean;
1006
+ componentInjector(row: FormGroup, rowIndex: number): Injector;
1007
+ abstract listDropped(event: CdkDragDrop<KlesForm>): void;
1008
+ rowDragStarted(row: FormGroup, rowIndex: number): void;
1009
+ rowDragMoved(row: FormGroup, rowIndex: number): void;
1010
+ rowDragEnded(row: FormGroup, rowIndex: number): void;
1011
+ protected rowPayload(row: FormGroup, rowIndex: number): {
1012
+ row: FormGroup<any>;
1013
+ rowIndex: number;
1014
+ value: any;
1015
+ rawValue: any;
1016
+ };
1017
+ protected reorder(event: CdkDragDrop<KlesForm>): void;
1018
+ protected transfer(event: CdkDragDrop<KlesForm>): void;
1019
+ private handleDrop;
1020
+ private toDropListId;
1021
+ }
1022
+ declare class DragDropService extends DragDropBase {
1023
+ constructor(config: DragDropConfig | undefined, eventsService: EventsService, klesForm: KlesForm, injector: Injector, tableId?: string);
1024
+ listDropped(event: CdkDragDrop<KlesForm>): void;
1025
+ }
1026
+
1027
+ declare class ScrollbarService {
1028
+ private element;
1029
+ private default;
1030
+ private readonly hiddenClass;
1031
+ register(el: HTMLElement): void;
1032
+ unregister(): void;
1033
+ setScrollbarVisible(visible: boolean): void;
1034
+ hideScrollbar(): void;
1035
+ showScrollbar(): void;
1036
+ toTop(sb?: ScrollBehavior): void;
1037
+ toBottom(sb?: ScrollBehavior): void;
1038
+ toLeft(sb?: ScrollBehavior): void;
1039
+ toRight(sb?: ScrollBehavior): void;
1040
+ to(top: number, left: number, sb?: ScrollBehavior): void;
1041
+ getTop(): number;
1042
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScrollbarService, never>;
1043
+ static ɵprov: i0.ɵɵInjectableDeclaration<ScrollbarService>;
1044
+ }
1045
+
1046
+ declare class KlesTableConnectorService {
1047
+ private _connected$;
1048
+ private _table?;
1049
+ readonly connected$: Observable<boolean>;
1050
+ constructor();
1051
+ connect(table: ITable): () => void;
1052
+ get table(): ITable;
1053
+ get scrollbar(): ScrollbarApi;
1054
+ get column(): ColumnApi;
1055
+ get pagination(): PaginationApi | undefined;
1056
+ get sort(): SortApi;
1057
+ get loading(): LoadingApi;
1058
+ get selection(): SelectionApi;
1059
+ get footer(): FooterApi;
1060
+ get form(): _3kles_kles_material_table_v2.FormApi<_3kles_kles_material_table_v2.FormValue>;
1061
+ get ui(): GroupUiState<{
1062
+ header: GroupUiState;
1063
+ rows: ArrayUiState;
1064
+ footer: GroupUiState;
1065
+ }>;
1066
+ get events(): EventsApi;
1067
+ get emptyState(): EmptyStateApi;
1068
+ get render(): RenderApi;
1069
+ get tree(): TreeApi;
1070
+ refresh(): void;
1071
+ static ɵfac: i0.ɵɵFactoryDeclaration<KlesTableConnectorService, never>;
1072
+ static ɵprov: i0.ɵɵInjectableDeclaration<KlesTableConnectorService>;
1073
+ }
1074
+
1075
+ declare class LoadingService {
1076
+ private readonly eventsService;
1077
+ private _loading;
1078
+ constructor(eventsService: EventsService);
1079
+ get loading(): i0.Signal<boolean>;
1080
+ start(): void;
1081
+ stop(): void;
1082
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoadingService, never>;
1083
+ static ɵprov: i0.ɵɵInjectableDeclaration<LoadingService>;
1084
+ }
1085
+
1086
+ interface ITableStore {
1087
+ reset(): void;
1088
+ }
1089
+
1090
+ declare class PaginatorStore implements ITableStore {
1091
+ protected config: PaginatorConfig;
1092
+ private s;
1093
+ page$: Observable<Pagination>;
1094
+ constructor(config: PaginatorConfig);
1095
+ setPage(v: Pagination): void;
1096
+ snapshot(): Pagination;
1097
+ reset(): void;
1098
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaginatorStore, [{ optional: true; }]>;
1099
+ static ɵprov: i0.ɵɵInjectableDeclaration<PaginatorStore>;
1100
+ }
1101
+
1102
+ interface IKlesDataSource extends DataSource<FormGroup> {
1103
+ set data(data: unknown[]);
1104
+ get paginator(): MatPaginator | null | undefined;
1105
+ set paginator(paginator: MatPaginator | null | undefined);
1106
+ get sort(): MatSort | null | undefined;
1107
+ set sort(sort: MatSort | null | undefined);
1108
+ get filter(): string | undefined;
1109
+ set filter(f: string);
1110
+ connect(): Observable<readonly FormGroup[]>;
1111
+ }
1112
+
1113
+ declare class KlesDataSource extends MatTableDataSource<FormGroup, MatPaginator> implements IKlesDataSource {
1114
+ constructor();
1115
+ }
1116
+
911
1117
  declare class CellValueChangeService {
912
1118
  private readonly eventsService;
913
1119
  private readonly destroyRef;
@@ -1013,8 +1219,8 @@ interface ILoader<R> {
1013
1219
  total: number;
1014
1220
  items: R[];
1015
1221
  loading: boolean;
1016
- error?: any;
1017
- header?: any;
1222
+ error?: unknown;
1223
+ header?: Record<string, unknown>;
1018
1224
  }>;
1019
1225
  refresh(): void;
1020
1226
  }
@@ -1062,6 +1268,8 @@ interface ISelectionService {
1062
1268
  selectionMode: boolean;
1063
1269
  register(): void;
1064
1270
  selectionModel?: IKlesSelectionModel<FormGroup>;
1271
+ readonly loadingRows: Signal<ReadonlySet<FormGroup>>;
1272
+ isLoading(row: FormGroup): boolean;
1065
1273
  count(): Signal<number>;
1066
1274
  disable(): void;
1067
1275
  enable(): void;
@@ -1088,7 +1296,8 @@ interface ITableService {
1088
1296
 
1089
1297
  declare class FooterService {
1090
1298
  private _footer;
1091
- constructor(_footer: WritableSignal<boolean>);
1299
+ private readonly eventsService;
1300
+ constructor(_footer: WritableSignal<boolean>, eventsService: EventsService);
1092
1301
  get footer(): Signal<boolean>;
1093
1302
  show(): void;
1094
1303
  hide(): void;
@@ -1136,10 +1345,11 @@ declare class KlesTableEmptyStateComponent {
1136
1345
  }
1137
1346
 
1138
1347
  declare class EmptyStateService {
1348
+ private readonly eventsService;
1139
1349
  private readonly _enabled;
1140
1350
  readonly enabled: i0.Signal<boolean>;
1141
1351
  readonly component: Type<unknown>;
1142
- constructor(config: boolean | EmptyStateConfig | undefined);
1352
+ constructor(config: boolean | EmptyStateConfig | undefined, eventsService: EventsService);
1143
1353
  enable(): void;
1144
1354
  disable(): void;
1145
1355
  toggle(): void;
@@ -1147,6 +1357,38 @@ declare class EmptyStateService {
1147
1357
  static ɵprov: i0.ɵɵInjectableDeclaration<EmptyStateService>;
1148
1358
  }
1149
1359
 
1360
+ declare class TreeService<T, R> {
1361
+ private readonly loaderConfig;
1362
+ private readonly loaderChildrensService;
1363
+ private readonly fm;
1364
+ private readonly columnsService;
1365
+ private readonly rowFactory;
1366
+ private readonly eventsService;
1367
+ private readonly destroyRef;
1368
+ private readonly expandedSubject;
1369
+ readonly expandedIds$: rxjs.Observable<Set<TreeNodeId>>;
1370
+ readonly expandedIds: i0.WritableSignal<ReadonlySet<TreeNodeId>>;
1371
+ readonly loadingIds: i0.WritableSignal<ReadonlySet<TreeNodeId>>;
1372
+ constructor();
1373
+ toggle(id: TreeNodeId, group?: FormGroup, depth?: number): void;
1374
+ expand(id: TreeNodeId, group?: FormGroup, depth?: number): void;
1375
+ collapse(id: TreeNodeId, group?: FormGroup, depth?: number): void;
1376
+ collapseAll(): void;
1377
+ reset(): void;
1378
+ isExpanded(id: TreeNodeId): boolean;
1379
+ isLoading(id: TreeNodeId): boolean;
1380
+ getChildren(id: TreeNodeId): FormGroup[];
1381
+ getDescendants(id: TreeNodeId): FormGroup[];
1382
+ hasChildren(group: FormGroup, depth: number): boolean;
1383
+ private findRow;
1384
+ private setExpanded;
1385
+ private publishExpanded;
1386
+ private setLoading;
1387
+ private rowPayload;
1388
+ static ɵfac: i0.ɵɵFactoryDeclaration<TreeService<any, any>, never>;
1389
+ static ɵprov: i0.ɵɵInjectableDeclaration<TreeService<any, any>>;
1390
+ }
1391
+
1150
1392
  type TableSection = 'header' | 'body' | 'footer';
1151
1393
  declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy {
1152
1394
  private readonly host;
@@ -1155,7 +1397,7 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1155
1397
  private readonly datasourceService;
1156
1398
  readonly tableService: ITableService;
1157
1399
  readonly dragDropRowService: DragDropService;
1158
- private readonly selectionService;
1400
+ readonly selectionService: ISelectionService;
1159
1401
  readonly columnsService: ColumnsService;
1160
1402
  readonly loadingService: LoadingService;
1161
1403
  private readonly paginatorService;
@@ -1171,6 +1413,7 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1171
1413
  readonly rowService: RowService;
1172
1414
  readonly cellService: CellService;
1173
1415
  readonly emptyStateService: EmptyStateService;
1416
+ private readonly treeService;
1174
1417
  table: MatTable<FormGroup>;
1175
1418
  matSort: MatSort;
1176
1419
  formElemRef: ElementRef<HTMLElement>;
@@ -1191,10 +1434,13 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1191
1434
  private rafId?;
1192
1435
  private _cleanup?;
1193
1436
  emptyStateComponent: typeof KlesTableEmptyStateComponent;
1194
- constructor(host: ElementRef<HTMLElement>, connectorService: KlesTableConnectorService, loader: ILoader<any>, datasourceService: IDatasourceService, tableService: ITableService, dragDropRowService: DragDropService, selectionService: ISelectionService, columnsService: ColumnsService, loadingService: LoadingService, paginatorService: PaginatorService, scrollbarService: ScrollbarService, footerService: FooterService, extraRowService: ExtraRowService, renderService: RenderService, sortService: ISortService, filterService: FilterService, expandedRowStore: ExpandedRowStore, rowFactory: RowFormFactory, eventsService: EventsService, rowService: RowService, cellService: CellService, emptyStateService: EmptyStateService);
1437
+ constructor(host: ElementRef<HTMLElement>, connectorService: KlesTableConnectorService, loader: ILoader<unknown>, datasourceService: IDatasourceService, tableService: ITableService, dragDropRowService: DragDropService, selectionService: ISelectionService, columnsService: ColumnsService, loadingService: LoadingService, paginatorService: PaginatorService, scrollbarService: ScrollbarService, footerService: FooterService, extraRowService: ExtraRowService, renderService: RenderService, sortService: ISortService, filterService: FilterService, expandedRowStore: ExpandedRowStore, rowFactory: RowFormFactory, eventsService: EventsService, rowService: RowService, cellService: CellService, emptyStateService: EmptyStateService, treeService: TreeService<unknown, unknown>);
1195
1438
  get isLoadingClass(): boolean;
1196
1439
  get isEmptyClass(): boolean;
1197
1440
  get events(): EventsApi;
1441
+ get emptyState(): EmptyStateApi;
1442
+ get render(): RenderApi;
1443
+ get tree(): TreeApi;
1198
1444
  get form(): FormApi;
1199
1445
  get scrollbar(): ScrollbarApi;
1200
1446
  get column(): ColumnApi;
@@ -1202,27 +1448,27 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1202
1448
  get selection(): SelectionApi;
1203
1449
  get sort(): SortApi;
1204
1450
  get loading(): LoadingApi;
1205
- get footer(): FooterApi$1;
1451
+ get footer(): FooterApi;
1206
1452
  get ui(): GroupUiState<{
1207
1453
  header: GroupUiState;
1208
1454
  rows: ArrayUiState;
1209
1455
  footer: GroupUiState;
1210
1456
  }>;
1211
1457
  refresh(): void;
1458
+ private rowEventPayload;
1212
1459
  ngOnInit(): void;
1213
1460
  ngAfterViewInit(): void;
1214
1461
  ngOnDestroy(): void;
1215
- submit(): void;
1216
1462
  getColumnSeparator(column: KlesColumnConfig, section: TableSection): string | null;
1217
1463
  getStickyStartSeparator(column: KlesColumnConfig, section: TableSection): string | null;
1218
1464
  getStickyEndSeparator(column: KlesColumnConfig, section: TableSection): string | null;
1219
1465
  private getSeparatorStyle;
1220
1466
  private calculHeaderHeight;
1221
- static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, null, null, null, null, null, null]>;
1467
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, null, null, null, null, null, null, null]>;
1222
1468
  static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "kles-table", never, {}, {}, never, never, true, never>;
1223
1469
  }
1224
1470
 
1225
- interface KlesTableApi {
1471
+ interface KlesTableApi<TValue = unknown> {
1226
1472
  refresh(): void;
1227
1473
  get scrollbar(): ScrollbarApi;
1228
1474
  get column(): ColumnApi;
@@ -1230,8 +1476,12 @@ interface KlesTableApi {
1230
1476
  get sort(): SortApi;
1231
1477
  get loading(): LoadingApi;
1232
1478
  get selection(): SelectionApi;
1233
- get form(): FormApi;
1234
- get footer(): FooterApi$1;
1479
+ get form(): FormApi<TableFormValue<TValue>>;
1480
+ get footer(): FooterApi;
1481
+ get emptyState(): EmptyStateApi;
1482
+ get render(): RenderApi;
1483
+ get tree(): TreeApi;
1484
+ get events(): EventsApi<TValue>;
1235
1485
  get ui(): GroupUiState<{
1236
1486
  header: GroupUiState;
1237
1487
  rows: ArrayUiState;
@@ -1239,7 +1489,7 @@ interface KlesTableApi {
1239
1489
  }>;
1240
1490
  }
1241
1491
 
1242
- declare class KlesTableComponent<TValue = unknown> implements OnInit, KlesTableApi {
1492
+ declare class KlesTableComponent<TValue = unknown> implements OnInit, KlesTableApi<TValue> {
1243
1493
  private connectorService;
1244
1494
  tableConfig: i0.InputSignal<KlesTableConfig>;
1245
1495
  private readonly destroyRef;
@@ -1247,8 +1497,25 @@ declare class KlesTableComponent<TValue = unknown> implements OnInit, KlesTableA
1247
1497
  rowClick: EventEmitter<RowMousePayload<TValue>>;
1248
1498
  rowDoubleClick: EventEmitter<RowMousePayload<TValue>>;
1249
1499
  rowContextMenu: EventEmitter<RowMousePayload<TValue>>;
1500
+ rowMouseEnter: EventEmitter<RowMousePayload<TValue>>;
1501
+ rowMouseLeave: EventEmitter<RowMousePayload<TValue>>;
1502
+ rowDrop: EventEmitter<RowDropPayload<TValue>>;
1503
+ rowDropSuccess: EventEmitter<RowDropPayload<TValue>>;
1504
+ rowDropError: EventEmitter<RowDropErrorPayload<TValue>>;
1250
1505
  cellClick: EventEmitter<CellMousePayload<TValue>>;
1506
+ cellDoubleClick: EventEmitter<CellMousePayload<TValue>>;
1507
+ cellContextMenu: EventEmitter<CellMousePayload<TValue>>;
1251
1508
  cellValueChange: EventEmitter<CellValueChangePayload<TValue>>;
1509
+ selectionChange: EventEmitter<SelectionChangePayload<TValue>>;
1510
+ selectionError: EventEmitter<SelectionErrorPayload<TValue>>;
1511
+ pageChange: EventEmitter<PageChangePayload>;
1512
+ sortChange: EventEmitter<SortPayload>;
1513
+ filterChange: EventEmitter<FilterChangePayload>;
1514
+ loadError: EventEmitter<LoadErrorPayload>;
1515
+ nodeExpand: EventEmitter<TreePayload<TValue>>;
1516
+ nodeCollapse: EventEmitter<TreePayload<TValue>>;
1517
+ nodeLoadChildren: EventEmitter<TreePayload<TValue>>;
1518
+ nodeChildrenLoaded: EventEmitter<TreePayload<TValue>>;
1252
1519
  readonly elevationShadow: i0.Signal<string>;
1253
1520
  constructor(connectorService: KlesTableConnectorService);
1254
1521
  ngOnInit(): void;
@@ -1260,8 +1527,12 @@ declare class KlesTableComponent<TValue = unknown> implements OnInit, KlesTableA
1260
1527
  get sort(): SortApi;
1261
1528
  get loading(): LoadingApi;
1262
1529
  get selection(): SelectionApi;
1263
- get form(): FormApi;
1264
- get footer(): FooterApi$1;
1530
+ get form(): FormApi<TableFormValue<TValue>>;
1531
+ get footer(): FooterApi;
1532
+ get emptyState(): EmptyStateApi;
1533
+ get render(): RenderApi;
1534
+ get events(): EventsApi<TValue>;
1535
+ get tree(): TreeApi;
1265
1536
  get ui(): GroupUiState<{
1266
1537
  header: GroupUiState;
1267
1538
  rows: ArrayUiState;
@@ -1269,7 +1540,7 @@ declare class KlesTableComponent<TValue = unknown> implements OnInit, KlesTableA
1269
1540
  }>;
1270
1541
  private dispatchEvent;
1271
1542
  static ɵfac: i0.ɵɵFactoryDeclaration<KlesTableComponent<any>, never>;
1272
- static ɵcmp: i0.ɵɵComponentDeclaration<KlesTableComponent<any>, "kles-dynamic-table", never, { "tableConfig": { "alias": "tableConfig"; "required": true; "isSignal": true; }; }, { "tableEvent": "tableEvent"; "rowClick": "rowClick"; "rowDoubleClick": "rowDoubleClick"; "rowContextMenu": "rowContextMenu"; "cellClick": "cellClick"; "cellValueChange": "cellValueChange"; }, never, never, true, never>;
1543
+ static ɵcmp: i0.ɵɵComponentDeclaration<KlesTableComponent<any>, "kles-dynamic-table", never, { "tableConfig": { "alias": "tableConfig"; "required": true; "isSignal": true; }; }, { "tableEvent": "tableEvent"; "rowClick": "rowClick"; "rowDoubleClick": "rowDoubleClick"; "rowContextMenu": "rowContextMenu"; "rowMouseEnter": "rowMouseEnter"; "rowMouseLeave": "rowMouseLeave"; "rowDrop": "rowDrop"; "rowDropSuccess": "rowDropSuccess"; "rowDropError": "rowDropError"; "cellClick": "cellClick"; "cellDoubleClick": "cellDoubleClick"; "cellContextMenu": "cellContextMenu"; "cellValueChange": "cellValueChange"; "selectionChange": "selectionChange"; "selectionError": "selectionError"; "pageChange": "pageChange"; "sortChange": "sortChange"; "filterChange": "filterChange"; "loadError": "loadError"; "nodeExpand": "nodeExpand"; "nodeCollapse": "nodeCollapse"; "nodeLoadChildren": "nodeLoadChildren"; "nodeChildrenLoaded": "nodeChildrenLoaded"; }, never, never, true, never>;
1273
1544
  }
1274
1545
 
1275
1546
  declare class KlesMaterialTableModule {
@@ -1279,17 +1550,18 @@ declare class KlesMaterialTableModule {
1279
1550
  static ɵinj: i0.ɵɵInjectorDeclaration<KlesMaterialTableModule>;
1280
1551
  }
1281
1552
 
1282
- declare const SELECTION_CONFIG: InjectionToken<SelectionConfig<any>>;
1283
- declare const LOADER_CONFIG: InjectionToken<LoaderConfig<any, any>>;
1553
+ declare const SELECTION_CONFIG: InjectionToken<SelectionConfig<unknown>>;
1554
+ declare const LOADER_CONFIG: InjectionToken<LoaderConfig<unknown, unknown>>;
1284
1555
  declare const COLUMNS: InjectionToken<WritableSignal<KlesColumnConfig[]>>;
1285
1556
  declare const FOOTER: InjectionToken<WritableSignal<boolean>>;
1286
1557
  declare const EXTRA_ROWS: InjectionToken<WritableSignal<ExtraRowConfig[]>>;
1287
1558
  declare const ROW_DRAG_DROP: InjectionToken<DragDropService>;
1288
- declare const DRAG_DROP_CONFIG: InjectionToken<DragDropService>;
1559
+ declare const DRAG_DROP_CONFIG: InjectionToken<DragDropConfig<unknown>>;
1560
+ declare const KLES_DRAG_DROP_ROW_CONTEXT: InjectionToken<DragDropRowContext<unknown>>;
1289
1561
  declare const PAGINATOR_CONFIG: InjectionToken<PaginatorConfig>;
1290
1562
  declare const SORT_CONFIG: InjectionToken<Sort>;
1291
1563
  declare const HEADER_SERVICE: InjectionToken<IHeaderService>;
1292
- declare const LOADER_SERVICE: InjectionToken<ILoader<any>>;
1564
+ declare const LOADER_SERVICE: InjectionToken<ILoader<unknown>>;
1293
1565
  declare const LINES_SERVICE: InjectionToken<ILinesService>;
1294
1566
  declare const DATASOURCE_SERVICE: InjectionToken<IDatasourceService>;
1295
1567
  declare const SELECTION_SERVICE: InjectionToken<ISelectionService>;
@@ -1298,5 +1570,5 @@ declare const SCROLLBAR_ORCHESTRATOR_SERVICE: InjectionToken<IScrollbarOrchestra
1298
1570
  declare const TABLE_SERVICE: InjectionToken<ITableService>;
1299
1571
  declare const EMPTY_STATE_CONFIG: InjectionToken<boolean | EmptyStateConfig>;
1300
1572
 
1301
- export { AlignCell, COLUMNS, DATASOURCE_SERVICE, DRAG_DROP_CONFIG, EMPTY_STATE_CONFIG, EXTRA_ROWS, FOOTER, HEADER_SERVICE, KlesMaterialTableModule, KlesTableComponent, KlesTableEmptyStateComponent, KlesTableIntl, LINES_SERVICE, LOADER_CONFIG, LOADER_SERVICE, PAGINATOR_CONFIG, ROW_DRAG_DROP, SCROLLBAR_ORCHESTRATOR_SERVICE, SELECTION_CONFIG, SELECTION_SERVICE, SORT_CONFIG, SORT_SERVICE, Span, TABLE_SERVICE, TableComponent, linesLazyLoader, linesLoader, selectionConfig };
1302
- export type { ColumnSeparatorConfig, ColumnSeparatorStyle, DefaultTableConfig, DragDrop, DragDropConfig, EmptyStateConfig, ExtraRow, ExtraRowConfig, ExtraRowMode, IKlesCellFieldConfig, IKlesFooterFieldConfig, IKlesHeaderFieldConfig, ITable, InfiniteScrollConfig, KlesColumnConfig, KlesExtraCellFieldConfig, KlesTableApi, KlesTableConfig, LinesLazyLoader, LinesLoader, LoaderConfig, LoaderLazyResult, LoaderResult, NgStyleInput, PaginatorConfig, RowId, Selection, SelectionAllResponse, SelectionConfig, SelectionResponse, SelectionState, TableElevationLevel };
1573
+ export { AlignCell, COLUMNS, DATASOURCE_SERVICE, DRAG_DROP_CONFIG, EMPTY_STATE_CONFIG, EXTRA_ROWS, FOOTER, HEADER_SERVICE, KLES_DRAG_DROP_ROW_CONTEXT, KlesMaterialTableModule, KlesTableComponent, KlesTableEmptyStateComponent, KlesTableIntl, LINES_SERVICE, LOADER_CONFIG, LOADER_SERVICE, PAGINATOR_CONFIG, ROW_DRAG_DROP, SCROLLBAR_ORCHESTRATOR_SERVICE, SELECTION_CONFIG, SELECTION_SERVICE, SORT_CONFIG, SORT_SERVICE, Span, TABLE_SERVICE, TableComponent, linesLazyLoader, linesLoader, selectionConfig };
1574
+ export type { AggregationType, BulkActionClickPayload, CellMousePayload, CellPayload, CellValueChangePayload, ColumnApi, ColumnClass, ColumnDropPayload, ColumnOrderChangePayload, ColumnPayload, ColumnResizePayload, ColumnSeparatorConfig, ColumnSeparatorStyle, ColumnVisibilityChangePayload, DefaultTableConfig, DragDrop, DragDropConfig, DragDropRowChange, DragDropRowContext, EmptyStateApi, EmptyStateChangePayload, EmptyStateConfig, EventsApi, ExpansionPayload, ExtraRow, ExtraRowConfig, ExtraRowMode, FilterChangePayload, FooterApi, FooterFormApi, FormApi, FormValue, GlobalSearchPayload, HeaderFormApi, IKlesCellFieldConfig, IKlesFooterFieldConfig, IKlesHeaderFieldConfig, ITable, InfiniteScrollConfig, KlesColumnConfig, KlesExtraCellFieldConfig, KlesStyleMap, KlesStyleValue, KlesTableApi, KlesTableConfig, LinesLazyLoader, LinesLoader, LoadErrorPayload, LoadSuccessPayload, LoaderConfig, LoaderLazyResult, LoaderResult, LoadingApi, LoadingChangePayload, NgStyleInput, PageChangePayload, PaginationApi, PaginatorConfig, RenderApi, RowActionClickPayload, RowDropErrorPayload, RowDropPayload, RowId, RowMousePayload, RowPayload, RowValidatePayload, RowsFormApi, ScrollbarApi, Selection, SelectionAllResponse, SelectionApi, SelectionChangePayload, SelectionConfig, SelectionErrorPayload, SelectionResponse, SelectionState, SortApi, SortPayload, StateChangePayload, SummaryChangePayload, TableElevationLevel, TableEvent, TableEventMap, TableEventPayload, TableEventType, TableFormValue, TreeApi, TreeNodeId, TreePayload, ValidationErrorPayload, VisibilityChangePayload };