@3kles/kles-material-table-v2 21.1.0 → 21.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3kles/kles-material-table-v2",
3
- "version": "21.1.0",
3
+ "version": "21.3.0",
4
4
  "keywords": [
5
5
  "3KLES"
6
6
  ],
@@ -7,7 +7,7 @@ import * as i4 from '@3kles/kles-material-dynamicforms';
7
7
  import { IKlesFieldConfig, GroupUiState, ArrayUiState, AbstractUiState } from '@3kles/kles-material-dynamicforms';
8
8
  import { SortHeaderArrowPosition, SortDirection, Sort, MatSort } from '@angular/material/sort';
9
9
  import * as rxjs from 'rxjs';
10
- import { Observable } from 'rxjs';
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
13
  import { DataSource } from '@angular/cdk/table';
@@ -348,6 +348,20 @@ type Brand<K extends string> = {
348
348
  type SelectionConfig<T> = SelectionConfigDef<T> & Brand<'SelectionConfig'>;
349
349
  declare const selectionConfig: <T>(l: SelectionConfigDef<T>) => SelectionConfig<T>;
350
350
 
351
+ declare class KlesTableIntl {
352
+ readonly changes: Subject<void>;
353
+ emptyStateTitle: string;
354
+ emptyStateDescription: string;
355
+ static ɵfac: i0.ɵɵFactoryDeclaration<KlesTableIntl, never>;
356
+ static ɵprov: i0.ɵɵInjectableDeclaration<KlesTableIntl>;
357
+ }
358
+
359
+ type TableElevationLevel = 0 | 1 | 2 | 3 | 4 | 5;
360
+ interface EmptyStateConfig {
361
+ enabled?: boolean;
362
+ component?: Type<unknown>;
363
+ intl?: Type<KlesTableIntl>;
364
+ }
351
365
  interface DefaultTableConfig {
352
366
  id?: string;
353
367
  columns: KlesColumnConfig[];
@@ -356,6 +370,8 @@ interface DefaultTableConfig {
356
370
  footer?: boolean;
357
371
  sortConfig?: Sort;
358
372
  columnSeparator?: boolean | ColumnSeparatorConfig;
373
+ elevation?: TableElevationLevel;
374
+ emptyState?: boolean | EmptyStateConfig;
359
375
  }
360
376
  interface PaginatorConfig {
361
377
  paginator?: boolean;
@@ -453,8 +469,12 @@ declare class DragDropService extends DragDropBase {
453
469
  declare class ScrollbarService {
454
470
  private element;
455
471
  private default;
472
+ private readonly hiddenClass;
456
473
  register(el: HTMLElement): void;
457
474
  unregister(): void;
475
+ setScrollbarVisible(visible: boolean): void;
476
+ hideScrollbar(): void;
477
+ showScrollbar(): void;
458
478
  toTop(sb?: ScrollBehavior): void;
459
479
  toBottom(sb?: ScrollBehavior): void;
460
480
  toLeft(sb?: ScrollBehavior): void;
@@ -739,6 +759,8 @@ declare class ColumnsService {
739
759
  constructor(_columns: WritableSignal<KlesColumnConfig[]>, eventsService: EventsService);
740
760
  register(): void;
741
761
  get columns(): Signal<KlesColumnConfig[]>;
762
+ readonly stickyStartBoundary: Signal<string>;
763
+ readonly stickyEndBoundary: Signal<string>;
742
764
  getVisible(): string[];
743
765
  setVisible(columnDef: string, visible: boolean): void;
744
766
  toggleVisible(columnDef: string): void;
@@ -756,6 +778,7 @@ declare class ColumnsService {
756
778
  setColumnPosition(columnDef: string, position: number): void;
757
779
  private updateColumn;
758
780
  private setDisplayedColumns;
781
+ private getVisibleColumns;
759
782
  static ɵfac: i0.ɵɵFactoryDeclaration<ColumnsService, never>;
760
783
  static ɵprov: i0.ɵɵInjectableDeclaration<ColumnsService>;
761
784
  }
@@ -906,6 +929,7 @@ declare class ValidationService {
906
929
 
907
930
  interface IDatasourceService {
908
931
  get datasource(): IKlesDataSource;
932
+ readonly isEmpty: Signal<boolean>;
909
933
  register(): void;
910
934
  }
911
935
  declare class DatasourceService implements IDatasourceService {
@@ -915,6 +939,8 @@ declare class DatasourceService implements IDatasourceService {
915
939
  private validationService;
916
940
  private _datasource;
917
941
  private readonly destroyRef;
942
+ private readonly _isEmpty;
943
+ readonly isEmpty: Signal<boolean>;
918
944
  constructor(fm: KlesForm, columnsService: ColumnsService, cellValueChangeService: CellValueChangeService, validationService: ValidationService);
919
945
  register(): void;
920
946
  get datasource(): KlesDataSource;
@@ -1018,6 +1044,7 @@ interface ILinesService {
1018
1044
  register(): void;
1019
1045
  total(): number;
1020
1046
  loaded(): EventEmitter<void>;
1047
+ loading(): EventEmitter<void>;
1021
1048
  }
1022
1049
 
1023
1050
  interface ISelectionService {
@@ -1089,6 +1116,27 @@ declare class CellService {
1089
1116
  static ɵprov: i0.ɵɵInjectableDeclaration<CellService>;
1090
1117
  }
1091
1118
 
1119
+ declare class KlesTableEmptyStateComponent {
1120
+ readonly intl: KlesTableIntl;
1121
+ private readonly changeDetectorRef;
1122
+ private readonly destroyRef;
1123
+ constructor();
1124
+ static ɵfac: i0.ɵɵFactoryDeclaration<KlesTableEmptyStateComponent, never>;
1125
+ static ɵcmp: i0.ɵɵComponentDeclaration<KlesTableEmptyStateComponent, "kles-table-empty-state", never, {}, {}, never, never, true, never>;
1126
+ }
1127
+
1128
+ declare class EmptyStateService {
1129
+ private readonly _enabled;
1130
+ readonly enabled: i0.Signal<boolean>;
1131
+ readonly component: Type<unknown>;
1132
+ constructor(config: boolean | EmptyStateConfig | undefined);
1133
+ enable(): void;
1134
+ disable(): void;
1135
+ toggle(): void;
1136
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmptyStateService, never>;
1137
+ static ɵprov: i0.ɵɵInjectableDeclaration<EmptyStateService>;
1138
+ }
1139
+
1092
1140
  type TableSection = 'header' | 'body' | 'footer';
1093
1141
  declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy {
1094
1142
  private readonly host;
@@ -1112,6 +1160,7 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1112
1160
  private readonly eventsService;
1113
1161
  readonly rowService: RowService;
1114
1162
  readonly cellService: CellService;
1163
+ readonly emptyStateService: EmptyStateService;
1115
1164
  table: MatTable<FormGroup>;
1116
1165
  matSort: MatSort;
1117
1166
  formElemRef: ElementRef<HTMLElement>;
@@ -1126,12 +1175,15 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1126
1175
  extraRows: Signal<(ExtraRowConfig & {
1127
1176
  displayedColumns: string[];
1128
1177
  })[]>;
1178
+ readonly isEmpty: Signal<boolean>;
1129
1179
  private ro?;
1130
1180
  private readonly destroyRef;
1131
1181
  private rafId?;
1132
1182
  private _cleanup?;
1133
- 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);
1183
+ emptyStateComponent: typeof KlesTableEmptyStateComponent;
1184
+ 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);
1134
1185
  get isLoadingClass(): boolean;
1186
+ get isEmptyClass(): boolean;
1135
1187
  get events(): EventsApi;
1136
1188
  get form(): FormApi;
1137
1189
  get scrollbar(): ScrollbarApi;
@@ -1152,8 +1204,11 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1152
1204
  ngOnDestroy(): void;
1153
1205
  submit(): void;
1154
1206
  getColumnSeparator(column: KlesColumnConfig, section: TableSection): string | null;
1207
+ getStickyStartSeparator(column: KlesColumnConfig, section: TableSection): string | null;
1208
+ getStickyEndSeparator(column: KlesColumnConfig, section: TableSection): string | null;
1209
+ private getSeparatorStyle;
1155
1210
  private calculHeaderHeight;
1156
- 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]>;
1211
+ 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]>;
1157
1212
  static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "kles-table", never, {}, {}, never, never, true, never>;
1158
1213
  }
1159
1214
 
@@ -1184,6 +1239,7 @@ declare class KlesTableComponent<TValue = unknown> implements OnInit, KlesTableA
1184
1239
  rowContextMenu: EventEmitter<RowMousePayload<TValue>>;
1185
1240
  cellClick: EventEmitter<CellMousePayload<TValue>>;
1186
1241
  cellValueChange: EventEmitter<CellValueChangePayload<TValue>>;
1242
+ readonly elevationShadow: i0.Signal<string>;
1187
1243
  constructor(connectorService: KlesTableConnectorService);
1188
1244
  ngOnInit(): void;
1189
1245
  get hostId(): string;
@@ -1230,6 +1286,7 @@ declare const SELECTION_SERVICE: InjectionToken<ISelectionService>;
1230
1286
  declare const SORT_SERVICE: InjectionToken<ISortService>;
1231
1287
  declare const SCROLLBAR_ORCHESTRATOR_SERVICE: InjectionToken<IScrollbarOrchestratorService>;
1232
1288
  declare const TABLE_SERVICE: InjectionToken<ITableService>;
1289
+ declare const EMPTY_STATE_CONFIG: InjectionToken<boolean | EmptyStateConfig>;
1233
1290
 
1234
- export { AlignCell, COLUMNS, DATASOURCE_SERVICE, DRAG_DROP_CONFIG, EXTRA_ROWS, FOOTER, HEADER_SERVICE, KlesMaterialTableModule, KlesTableComponent, 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 };
1235
- export type { ColumnSeparatorConfig, ColumnSeparatorStyle, DefaultTableConfig, DragDrop, DragDropConfig, 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 };
1291
+ 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 };
1292
+ 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 };