@den4ik92/ng2-smart-table 19.5.50 → 19.6.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.
@@ -2,6 +2,10 @@ import { Cell } from '../../../lib/data-set/cell';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class CustomViewComponent {
4
4
  readonly cell: import("@angular/core").InputSignal<Cell>;
5
+ readonly inputs: import("@angular/core").Signal<{
6
+ rowData: any;
7
+ value: any;
8
+ }>;
5
9
  static ɵfac: i0.ɵɵFactoryDeclaration<CustomViewComponent, never>;
6
10
  static ɵcmp: i0.ɵɵComponentDeclaration<CustomViewComponent, "ng2-custom-view-component", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
7
11
  }
@@ -1,7 +1,9 @@
1
+ import { TemplateRef } from '@angular/core';
1
2
  import { DataSource } from '../../lib/data-source/data-source';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class PagerComponent {
4
5
  readonly source: import("@angular/core").InputSignal<DataSource<any>>;
6
+ readonly content: import("@angular/core").InputSignal<TemplateRef<any> | undefined>;
5
7
  protected readonly pagingConf: import("@angular/core").Signal<import("@den4ik92/ng2-smart-table").SmartTablePagerSettings>;
6
8
  protected readonly currentPerPage: import("@angular/core").Signal<number>;
7
9
  protected readonly currentPage: import("@angular/core").Signal<number>;
@@ -18,5 +20,5 @@ export declare class PagerComponent {
18
20
  getPages(current: number, last: number, total: number): (string | number)[];
19
21
  onChangePerPage(target: HTMLSelectElement): void;
20
22
  static ɵfac: i0.ɵɵFactoryDeclaration<PagerComponent, never>;
21
- static ɵcmp: i0.ɵɵComponentDeclaration<PagerComponent, "ng2-smart-table-pager", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<PagerComponent, "ng2-smart-table-pager", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
22
24
  }
@@ -1,3 +1,4 @@
1
+ import { ComponentType } from '@angular/cdk/portal';
1
2
  import { SmartTableCompareFunction, SmartTableEditorAndFilter, SmartTableFilterFunction, SmartTableValuePrepareFunction } from '../interfaces/smart-table.models';
2
3
  import { SmartTableColumnSettings, SmartTableColumnSettingsTypes } from './../interfaces/smart-table.models';
3
4
  import { DataSet } from './data-set';
@@ -17,7 +18,8 @@ export declare class Column {
17
18
  isFilterable: boolean;
18
19
  editor: SmartTableEditorAndFilter | false;
19
20
  filter: SmartTableEditorAndFilter | false;
20
- renderComponent: any;
21
+ renderComponent?: ComponentType<any>;
22
+ renderComponentInputs: Record<string, any>;
21
23
  compareFunction?: SmartTableCompareFunction;
22
24
  valuePrepareFunction?: SmartTableValuePrepareFunction;
23
25
  filterFunction?: SmartTableFilterFunction;
@@ -1,3 +1,4 @@
1
+ import { ComponentType } from '@angular/cdk/portal';
1
2
  import { InputSignal } from '@angular/core';
2
3
  import { Cell } from '../data-set/cell';
3
4
  import { DataSource } from '../data-source/data-source';
@@ -105,7 +106,15 @@ interface SmartTableTextHtmlColumn<T extends BaseDataType> extends SmartTableDef
105
106
  }
106
107
  interface SmartTableCustomColumn<T extends BaseDataType> extends SmartTableDefaultColumn<T> {
107
108
  type: 'custom';
108
- renderComponent: any;
109
+ renderComponent: ComponentType<any>;
110
+ /**
111
+ * @description you can set any component inputs.
112
+ *
113
+ * inputs value is not updated when changed. set once onInit.
114
+ *
115
+ * make sure to set the correct input name to prevent setInput error
116
+ */
117
+ renderComponentInputs?: Record<string, any>;
109
118
  }
110
119
  export type SmartTableEditorAndFilterTypes = 'text' | 'textarea' | 'list' | 'custom' | 'checkbox';
111
120
  export type SmartTableEditorAndFilter = SmartTableTextEditor | SmartTableEditorList | SmartTableEditorCheckbox | SmartTableEditorCustom;
@@ -1,4 +1,4 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnChanges, OnDestroy, SimpleChange } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, Injector, NgZone, OnChanges, OnDestroy, SimpleChange, TemplateRef, ViewContainerRef } from '@angular/core';
2
2
  import { Row } from './lib/data-set/row';
3
3
  import { DataSource } from './lib/data-source/data-source';
4
4
  import { Grid } from './lib/grid';
@@ -7,8 +7,40 @@ import * as i0 from "@angular/core";
7
7
  export declare class Ng2SmartTableComponent<T extends BaseDataType = any> implements OnChanges, OnDestroy, AfterViewInit {
8
8
  private elementRef;
9
9
  private ngZone;
10
+ private injector;
10
11
  readonly source: import("@angular/core").InputSignal<DataSource<T>>;
11
12
  readonly settings: import("@angular/core").InputSignal<SmartTableSettings<T>>;
13
+ /**
14
+ * @description If you want to display pagination in your custom container, you can pass it to "paginationSlot".
15
+ * @example
16
+ * <ng2-smart-table
17
+ * [paginationSlot]="paginationSlot">
18
+ * </ng2-smart-table>
19
+ * <div #paginationSlot>
20
+ * </div>
21
+ */
22
+ readonly paginationSlot: import("@angular/core").InputSignal<ViewContainerRef | undefined>;
23
+ /**
24
+ * @description if you want to render custom data inside a container with pagination you can pass a TemplateRef
25
+ * @example
26
+ * <ng2-smart-table
27
+ * [paginationTemplateData]="paginationData"
28
+ * >
29
+ * </ng2-smart-table>
30
+ * <ng-template #paginationData
31
+ * >
32
+ * any data
33
+ * </ng-template>
34
+ * ----- or another option, will work only if you do not use paginationSlot
35
+ * <ng2-smart-table
36
+ * [paginationTemplateData]="paginationData"
37
+ * >
38
+ * <ng-container pager-content>
39
+ * some content will be rendered in the pager
40
+ * </ng-container>
41
+ * </ng2-smart-table>
42
+ */
43
+ readonly paginationTemplateData: import("@angular/core").InputSignal<TemplateRef<unknown> | undefined>;
12
44
  readonly multiRowSelect: import("@angular/core").OutputEmitterRef<SmartTableRowSelectEvent<T>>;
13
45
  readonly rowClicked: import("@angular/core").OutputEmitterRef<SmartTableRowClickedEvent<T>>;
14
46
  readonly columnsSorted: import("@angular/core").OutputEmitterRef<ColumnPositionState[]>;
@@ -30,7 +62,8 @@ export declare class Ng2SmartTableComponent<T extends BaseDataType = any> implem
30
62
  private readonly isExternalMode;
31
63
  private resizeObserver;
32
64
  private resizeDebounceTimer;
33
- constructor(elementRef: ElementRef, ngZone: NgZone);
65
+ private paginationComponentRef;
66
+ constructor(elementRef: ElementRef, ngZone: NgZone, injector: Injector);
34
67
  ngOnChanges({ settings }: Record<string, SimpleChange>): void;
35
68
  ngAfterViewInit(): void;
36
69
  ngOnDestroy(): void;
@@ -50,5 +83,5 @@ export declare class Ng2SmartTableComponent<T extends BaseDataType = any> implem
50
83
  private setupResizeObserver;
51
84
  private destroyResizeObserver;
52
85
  static ɵfac: i0.ɵɵFactoryDeclaration<Ng2SmartTableComponent<any>, never>;
53
- static ɵcmp: i0.ɵɵComponentDeclaration<Ng2SmartTableComponent<any>, "ng2-smart-table", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; "settings": { "alias": "settings"; "required": true; "isSignal": true; }; }, { "multiRowSelect": "multiRowSelect"; "rowClicked": "rowClicked"; "columnsSorted": "columnsSorted"; "deleteEmitter": "deleteEmitter"; "deleteConfirm": "deleteConfirm"; "edit": "edit"; "editConfirm": "editConfirm"; "editCancel": "editCancel"; "create": "create"; "createConfirm": "createConfirm"; "custom": "custom"; }, never, never, true, never>;
86
+ static ɵcmp: i0.ɵɵComponentDeclaration<Ng2SmartTableComponent<any>, "ng2-smart-table", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; "settings": { "alias": "settings"; "required": true; "isSignal": true; }; "paginationSlot": { "alias": "paginationSlot"; "required": false; "isSignal": true; }; "paginationTemplateData": { "alias": "paginationTemplateData"; "required": false; "isSignal": true; }; }, { "multiRowSelect": "multiRowSelect"; "rowClicked": "rowClicked"; "columnsSorted": "columnsSorted"; "deleteEmitter": "deleteEmitter"; "deleteConfirm": "deleteConfirm"; "edit": "edit"; "editConfirm": "editConfirm"; "editCancel": "editCancel"; "create": "create"; "createConfirm": "createConfirm"; "custom": "custom"; }, never, ["[pager-content]"], true, never>;
54
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@den4ik92/ng2-smart-table",
3
- "version": "19.5.50",
3
+ "version": "19.6.0",
4
4
  "description": "Angular Smart Table",
5
5
  "author": "Den4ik92",
6
6
  "license": "MIT",
@@ -8,10 +8,10 @@
8
8
  "tslib": "^2.6.1"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/common": "^19.0.3",
12
- "@angular/core": "^19.0.3",
13
- "@angular/forms": "^19.0.3",
14
- "@angular/cdk": "^19.0.3"
11
+ "@angular/common": "^19.2.14",
12
+ "@angular/core": "^19.2.14",
13
+ "@angular/forms": "^19.2.14",
14
+ "@angular/cdk": "^19.2.14"
15
15
  },
16
16
  "module": "fesm2022/den4ik92-ng2-smart-table.mjs",
17
17
  "typings": "index.d.ts",