@3kles/kles-material-table-v2 21.8.0 → 21.8.1

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.8.0",
3
+ "version": "21.8.1",
4
4
  "keywords": [
5
5
  "3KLES"
6
6
  ],
@@ -355,20 +355,29 @@ declare class KlesTableIntl {
355
355
  static ɵprov: i0.ɵɵInjectableDeclaration<KlesTableIntl>;
356
356
  }
357
357
 
358
+ interface KlesRowContext<TSource = unknown> {
359
+ source: TSource;
360
+ _id: string | number;
361
+ meta: {
362
+ depth: number;
363
+ parentId: string | number | null;
364
+ };
365
+ }
366
+
358
367
  type TableElevationLevel = 0 | 1 | 2 | 3 | 4 | 5;
359
368
  type RowClassValue = string | string[] | Set<string> | Record<string, boolean | null | undefined>;
360
- type RowStyleInput = KlesStyleMap | ((row: Record<string, unknown>, status: FormControlStatus, index: number) => KlesStyleMap);
361
- type RowClassInput = RowClassValue | ((row: Record<string, unknown>, status: FormControlStatus, index: number) => RowClassValue);
362
- interface RowAppearanceConfig {
363
- rowStyle?: RowStyleInput;
364
- rowClass?: RowClassInput;
369
+ type RowStyleInput<TSource = unknown> = KlesStyleMap | ((row: Record<string, unknown>, status: FormControlStatus, index: number, context: KlesRowContext<TSource>) => KlesStyleMap);
370
+ type RowClassInput<TSource = unknown> = RowClassValue | ((row: Record<string, unknown>, status: FormControlStatus, index: number, context: KlesRowContext<TSource>) => RowClassValue);
371
+ interface RowAppearanceConfig<TSource = unknown> {
372
+ rowStyle?: RowStyleInput<TSource>;
373
+ rowClass?: RowClassInput<TSource>;
365
374
  }
366
375
  interface EmptyStateConfig {
367
376
  enabled?: boolean;
368
377
  component?: Type<unknown>;
369
378
  intl?: Type<KlesTableIntl>;
370
379
  }
371
- interface DefaultTableConfig extends RowAppearanceConfig {
380
+ interface DefaultTableConfig<TSource = unknown> extends RowAppearanceConfig<TSource> {
372
381
  id?: string;
373
382
  columns: KlesColumnConfig[];
374
383
  /** Reserved for row-level validation configuration; not applied yet. */
@@ -465,7 +474,7 @@ type Exclusive<T, U> = (T & {
465
474
  }) | (U & {
466
475
  [K in Exclude<keyof T, keyof U>]?: never;
467
476
  });
468
- type KlesTableConfig<T = unknown, R = unknown> = DefaultTableConfig & Exclusive<PaginatorConfig, InfiniteScrollConfig> & LoaderConfig<T, R> & DragDrop<R> & Selection<T> & ExtraRow;
477
+ type KlesTableConfig<T = unknown, R = unknown> = DefaultTableConfig<R> & Exclusive<PaginatorConfig, InfiniteScrollConfig> & LoaderConfig<T, R> & DragDrop<R> & Selection<T> & ExtraRow;
469
478
 
470
479
  type AggregationType = 'sum' | 'avg' | 'min' | 'max' | 'count';
471
480
  interface SortPayload {
@@ -876,15 +885,6 @@ declare class ColumnsService {
876
885
  static ɵprov: i0.ɵɵInjectableDeclaration<ColumnsService>;
877
886
  }
878
887
 
879
- interface KlesRowContext<TSource = unknown> {
880
- source: TSource;
881
- _id: string | number;
882
- meta: {
883
- depth: number;
884
- parentId: string | number | null;
885
- };
886
- }
887
-
888
888
  interface KlesCreatedRow<TSource = unknown> {
889
889
  formGroup: FormGroup;
890
890
  groupUi: GroupUiState;
@@ -1434,6 +1434,7 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1434
1434
  readonly cellService: CellService;
1435
1435
  readonly emptyStateService: EmptyStateService;
1436
1436
  private readonly treeService;
1437
+ private readonly rowContextStore;
1437
1438
  table: MatTable<FormGroup>;
1438
1439
  matSort: MatSort;
1439
1440
  formElemRef: ElementRef<HTMLElement>;
@@ -1454,7 +1455,8 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1454
1455
  private rafId?;
1455
1456
  private _cleanup?;
1456
1457
  emptyStateComponent: typeof KlesTableEmptyStateComponent;
1457
- constructor(host: ElementRef<HTMLElement>, connectorService: KlesTableConnectorService, loader: ILoader<unknown>, datasourceService: IDatasourceService, tableService: ITableService, dragDropRowService: DragDropService, rowAppearance: RowAppearanceConfig, 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>);
1458
+ constructor(host: ElementRef<HTMLElement>, connectorService: KlesTableConnectorService, loader: ILoader<unknown>, datasourceService: IDatasourceService, tableService: ITableService, dragDropRowService: DragDropService, rowAppearance: RowAppearanceConfig, 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>, rowContextStore: RowContextStore);
1459
+ getRowContext(row: FormGroup): KlesRowContext;
1458
1460
  get isLoadingClass(): boolean;
1459
1461
  get isEmptyClass(): boolean;
1460
1462
  get events(): EventsApi;
@@ -1484,7 +1486,7 @@ declare class TableComponent implements ITable, OnInit, AfterViewInit, OnDestroy
1484
1486
  getStickyEndSeparator(column: KlesColumnConfig, section: TableSection): string | null;
1485
1487
  private getSeparatorStyle;
1486
1488
  private calculHeaderHeight;
1487
- static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, null, null, null, null, null, null, null]>;
1489
+ static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, null, null, null, null, null, null, null, null]>;
1488
1490
  static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent, "kles-table", never, {}, {}, never, never, true, never>;
1489
1491
  }
1490
1492
 
@@ -1576,7 +1578,7 @@ declare const COLUMNS: InjectionToken<WritableSignal<KlesColumnConfig[]>>;
1576
1578
  declare const FOOTER: InjectionToken<WritableSignal<boolean>>;
1577
1579
  declare const EXTRA_ROWS: InjectionToken<WritableSignal<ExtraRowConfig[]>>;
1578
1580
  declare const MULTI_UNFOLD: InjectionToken<boolean>;
1579
- declare const ROW_APPEARANCE_CONFIG: InjectionToken<RowAppearanceConfig>;
1581
+ declare const ROW_APPEARANCE_CONFIG: InjectionToken<RowAppearanceConfig<unknown>>;
1580
1582
  declare const ROW_DRAG_DROP: InjectionToken<DragDropService>;
1581
1583
  declare const DRAG_DROP_CONFIG: InjectionToken<DragDropConfig<unknown>>;
1582
1584
  declare const KLES_DRAG_DROP_ROW_CONTEXT: InjectionToken<DragDropRowContext<unknown>>;
@@ -1594,4 +1596,4 @@ declare const TABLE_SERVICE: InjectionToken<ITableService>;
1594
1596
  declare const EMPTY_STATE_CONFIG: InjectionToken<boolean | EmptyStateConfig>;
1595
1597
 
1596
1598
  export { AlignCell, COLUMNS, DATASOURCE_SERVICE, DRAG_DROP_CONFIG, EMPTY_STATE_CONFIG, EXTRA_ROWS, FOOTER, HEADER_SERVICE, INFINITE_SCROLL_CONFIG, KLES_DRAG_DROP_ROW_CONTEXT, KlesMaterialTableModule, KlesTableComponent, KlesTableEmptyStateComponent, KlesTableIntl, LINES_SERVICE, LOADER_CONFIG, LOADER_SERVICE, MULTI_UNFOLD, PAGINATOR_CONFIG, ROW_APPEARANCE_CONFIG, ROW_DRAG_DROP, SCROLLBAR_ORCHESTRATOR_SERVICE, SELECTION_CONFIG, SELECTION_SERVICE, SORT_CONFIG, SORT_SERVICE, Span, TABLE_SERVICE, TableComponent, linesLazyLoader, linesLoader, selectionConfig };
1597
- 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, RowAppearanceConfig, RowClassInput, RowClassValue, RowDropErrorPayload, RowDropPayload, RowId, RowMousePayload, RowPayload, RowStyleInput, 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 };
1599
+ 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, KlesRowContext, KlesStyleMap, KlesStyleValue, KlesTableApi, KlesTableConfig, LinesLazyLoader, LinesLoader, LoadErrorPayload, LoadSuccessPayload, LoaderConfig, LoaderLazyResult, LoaderResult, LoadingApi, LoadingChangePayload, NgStyleInput, PageChangePayload, PaginationApi, PaginatorConfig, RenderApi, RowActionClickPayload, RowAppearanceConfig, RowClassInput, RowClassValue, RowDropErrorPayload, RowDropPayload, RowId, RowMousePayload, RowPayload, RowStyleInput, 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 };