@den4ik92/ng2-smart-table 19.1.1 → 19.1.3

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.
Files changed (32) hide show
  1. package/fesm2022/den4ik92-ng2-smart-table.mjs +137 -136
  2. package/fesm2022/den4ik92-ng2-smart-table.mjs.map +1 -1
  3. package/lib/components/cell/cell-edit-mode/custom-edit.component.d.ts +1 -1
  4. package/lib/components/cell/cell-edit-mode/default-edit.component.d.ts +1 -1
  5. package/lib/components/cell/cell-edit-mode/edit-cell-default.d.ts +1 -1
  6. package/lib/components/cell/cell-edit-mode/edit-cell.component.d.ts +1 -1
  7. package/lib/components/cell/cell-editors/checkbox-editor.component.d.ts +1 -1
  8. package/lib/components/cell/cell-editors/default-editor.d.ts +1 -1
  9. package/lib/components/cell/cell-editors/input-editor.component.d.ts +1 -1
  10. package/lib/components/cell/cell-editors/select-editor.component.d.ts +1 -1
  11. package/lib/components/cell/cell-editors/textarea-editor.component.d.ts +1 -1
  12. package/lib/components/cell/cell-view-mode/custom-view.component.d.ts +1 -1
  13. package/lib/components/cell/cell-view-mode/view-cell.component.d.ts +1 -1
  14. package/lib/components/filter/custom-filter.component.d.ts +1 -1
  15. package/lib/components/filter/default-filter.component.d.ts +1 -1
  16. package/lib/components/filter/filter-default.d.ts +1 -1
  17. package/lib/components/filter/filter-types/checkbox-filter.component.d.ts +1 -1
  18. package/lib/components/filter/filter-types/default-filter.d.ts +4 -1
  19. package/lib/components/filter/filter-types/input-filter.component.d.ts +1 -1
  20. package/lib/components/filter/filter-types/select-filter.component.d.ts +1 -1
  21. package/lib/components/table-columns-editor/column-editor.directive.d.ts +1 -1
  22. package/lib/components/table-columns-editor/table-columns-editor.component.d.ts +1 -1
  23. package/lib/components/thead/cells/checkbox-select-all.component.d.ts +2 -4
  24. package/lib/components/thead/cells/column-title.component.d.ts +3 -3
  25. package/lib/components/thead/cells/title/title.component.d.ts +6 -5
  26. package/lib/lib/data-set/cell.d.ts +2 -2
  27. package/lib/lib/data-set/column.d.ts +8 -8
  28. package/lib/lib/data-set/data-set.d.ts +1 -1
  29. package/lib/lib/data-source/local/local.data-source.d.ts +1 -1
  30. package/lib/lib/data-source/local/local.sorter.d.ts +3 -2
  31. package/lib/lib/interfaces/smart-table.models.d.ts +8 -4
  32. package/package.json +1 -1
@@ -7,5 +7,5 @@ export declare class CustomEditComponent extends EditCellDefaultComponent implem
7
7
  ngOnChanges(changes: SimpleChanges): void;
8
8
  ngOnDestroy(): void;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<CustomEditComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<CustomEditComponent, "table-cell-custom-editor", never, {}, {}, never, never, true, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<CustomEditComponent, "ng2-table-cell-custom-editor", never, {}, {}, never, never, true, never>;
11
11
  }
@@ -5,5 +5,5 @@ export declare class DefaultEditComponent extends EditCellDefaultComponent {
5
5
  constructor();
6
6
  getEditorType(): SmartTableEditorAndFilterTypes;
7
7
  static ɵfac: i0.ɵɵFactoryDeclaration<DefaultEditComponent, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<DefaultEditComponent, "table-cell-default-editor", never, {}, {}, never, never, true, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<DefaultEditComponent, "ng2-table-cell-default-editor", never, {}, {}, never, never, true, never>;
9
9
  }
@@ -4,5 +4,5 @@ export declare class EditCellDefaultComponent {
4
4
  readonly cell: import("@angular/core").InputSignal<Cell>;
5
5
  readonly inputClass: import("@angular/core").InputSignal<string>;
6
6
  static ɵfac: i0.ɵɵFactoryDeclaration<EditCellDefaultComponent, never>;
7
- static ɵcmp: i0.ɵɵComponentDeclaration<EditCellDefaultComponent, "ng-component", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<EditCellDefaultComponent, "ng2-edit-cell-default-base-component", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
8
8
  }
@@ -6,5 +6,5 @@ export declare class EditCellComponent {
6
6
  readonly inputClass: import("@angular/core").InputSignal<string>;
7
7
  getEditorType(): SmartTableEditorAndFilterTypes;
8
8
  static ɵfac: i0.ɵɵFactoryDeclaration<EditCellComponent, never>;
9
- static ɵcmp: i0.ɵɵComponentDeclaration<EditCellComponent, "table-cell-edit-mode", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<EditCellComponent, "ng2-table-cell-edit-mode", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
10
10
  }
@@ -6,5 +6,5 @@ export declare class CheckboxEditorComponent extends DefaultEditor {
6
6
  constructor();
7
7
  onChange(event: any): void;
8
8
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxEditorComponent, never>;
9
- static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxEditorComponent, "checkbox-editor", never, {}, {}, never, never, true, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxEditorComponent, "ng2-checkbox-editor", never, {}, {}, never, never, true, never>;
10
10
  }
@@ -5,7 +5,7 @@ export declare class DefaultEditor implements Editor {
5
5
  readonly cell: InputSignal<Cell>;
6
6
  readonly inputClass: InputSignal<string>;
7
7
  static ɵfac: i0.ɵɵFactoryDeclaration<DefaultEditor, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<DefaultEditor, "ng-component", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<DefaultEditor, "ng2-default-editor-base-component", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
9
9
  }
10
10
  export interface Editor {
11
11
  cell: InputSignal<Cell>;
@@ -3,5 +3,5 @@ import * as i0 from "@angular/core";
3
3
  export declare class InputEditorComponent extends DefaultEditor {
4
4
  constructor();
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<InputEditorComponent, never>;
6
- static ɵcmp: i0.ɵɵComponentDeclaration<InputEditorComponent, "input-editor", never, {}, {}, never, never, true, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputEditorComponent, "ng2-input-editor", never, {}, {}, never, never, true, never>;
7
7
  }
@@ -3,5 +3,5 @@ import * as i0 from "@angular/core";
3
3
  export declare class SelectEditorComponent extends DefaultEditor {
4
4
  constructor();
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectEditorComponent, never>;
6
- static ɵcmp: i0.ɵɵComponentDeclaration<SelectEditorComponent, "select-editor", never, {}, {}, never, never, true, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectEditorComponent, "ng2-select-editor", never, {}, {}, never, never, true, never>;
7
7
  }
@@ -3,5 +3,5 @@ import * as i0 from "@angular/core";
3
3
  export declare class TextareaEditorComponent extends DefaultEditor {
4
4
  constructor();
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<TextareaEditorComponent, never>;
6
- static ɵcmp: i0.ɵɵComponentDeclaration<TextareaEditorComponent, "textarea-editor", never, {}, {}, never, never, true, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextareaEditorComponent, "ng2-textarea-editor", never, {}, {}, never, never, true, never>;
7
7
  }
@@ -3,5 +3,5 @@ import * as i0 from "@angular/core";
3
3
  export declare class CustomViewComponent {
4
4
  readonly cell: import("@angular/core").InputSignal<Cell>;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<CustomViewComponent, never>;
6
- static ɵcmp: i0.ɵɵComponentDeclaration<CustomViewComponent, "custom-view-component", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<CustomViewComponent, "ng2-custom-view-component", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
7
7
  }
@@ -3,5 +3,5 @@ import * as i0 from "@angular/core";
3
3
  export declare class ViewCellComponent {
4
4
  readonly cell: import("@angular/core").InputSignal<Cell>;
5
5
  static ɵfac: i0.ɵɵFactoryDeclaration<ViewCellComponent, never>;
6
- static ɵcmp: i0.ɵɵComponentDeclaration<ViewCellComponent, "table-cell-view-mode", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<ViewCellComponent, "ng2-table-cell-view-mode", never, { "cell": { "alias": "cell"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
7
7
  }
@@ -8,5 +8,5 @@ export declare class CustomFilterComponent extends FilterDefault implements OnCh
8
8
  ngOnChanges(changes: SimpleChanges): void;
9
9
  ngOnDestroy(): void;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<CustomFilterComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<CustomFilterComponent, "custom-table-filter", never, {}, {}, never, never, true, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<CustomFilterComponent, "ng2-custom-table-filter", never, {}, {}, never, never, true, never>;
12
12
  }
@@ -2,5 +2,5 @@ import { FilterDefault } from "./filter-default";
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class DefaultFilterComponent extends FilterDefault {
4
4
  static ɵfac: i0.ɵɵFactoryDeclaration<DefaultFilterComponent, never>;
5
- static ɵcmp: i0.ɵɵComponentDeclaration<DefaultFilterComponent, "default-table-filter", never, {}, {}, never, never, true, never>;
5
+ static ɵcmp: i0.ɵɵComponentDeclaration<DefaultFilterComponent, "ng2-default-table-filter", never, {}, {}, never, never, true, never>;
6
6
  }
@@ -9,5 +9,5 @@ export declare class FilterDefault {
9
9
  readonly filter: import("@angular/core").OutputEmitterRef<any>;
10
10
  onFilter(query: string): void;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<FilterDefault, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<FilterDefault, "ng-component", never, { "column": { "alias": "column"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": true; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "query": { "alias": "query"; "required": false; }; }, { "filter": "filter"; }, never, never, true, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<FilterDefault, "ng2-filter-default-component", never, { "column": { "alias": "column"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": true; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "query": { "alias": "query"; "required": false; }; }, { "filter": "filter"; }, never, never, true, never>;
13
13
  }
@@ -9,5 +9,5 @@ export declare class CheckboxFilterComponent extends DefaultFilter implements On
9
9
  ngOnInit(): void;
10
10
  resetFilter(event: any): void;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxFilterComponent, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxFilterComponent, "checkbox-filter", never, {}, {}, never, never, true, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxFilterComponent, "ng2-checkbox-filter", never, {}, {}, never, never, true, never>;
13
13
  }
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter, InputSignal, OnDestroy, OutputEmitterRef } from '@angular/core';
2
2
  import { Subscription } from 'rxjs';
3
+ import { LocalDataSource } from 'ng2-smart-table';
3
4
  import { Column } from '../../../lib/data-set/column';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class DefaultFilter implements Filter, OnDestroy {
@@ -7,18 +8,20 @@ export declare class DefaultFilter implements Filter, OnDestroy {
7
8
  changesSubscription?: Subscription;
8
9
  query: string;
9
10
  readonly inputClass: InputSignal<string>;
11
+ readonly source: InputSignal<LocalDataSource<any>>;
10
12
  readonly column: InputSignal<Column>;
11
13
  readonly filter: OutputEmitterRef<string>;
12
14
  ngOnDestroy(): void;
13
15
  setFilter(): void;
14
16
  static ɵfac: i0.ɵɵFactoryDeclaration<DefaultFilter, never>;
15
- static ɵcmp: i0.ɵɵComponentDeclaration<DefaultFilter, "ng-component", never, { "query": { "alias": "query"; "required": false; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "column": { "alias": "column"; "required": true; "isSignal": true; }; }, { "filter": "filter"; }, never, never, true, never>;
17
+ static ɵcmp: i0.ɵɵComponentDeclaration<DefaultFilter, "ng2-default-base-filter-component", never, { "query": { "alias": "query"; "required": false; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "source": { "alias": "source"; "required": true; "isSignal": true; }; "column": { "alias": "column"; "required": true; "isSignal": true; }; }, { "filter": "filter"; }, never, never, true, never>;
16
18
  }
17
19
  export interface Filter {
18
20
  delay?: number;
19
21
  changesSubscription?: Subscription;
20
22
  query: string;
21
23
  inputClass: InputSignal<string>;
24
+ source: InputSignal<LocalDataSource>;
22
25
  column: InputSignal<Column>;
23
26
  filter: EventEmitter<string> | OutputEmitterRef<any>;
24
27
  }
@@ -8,5 +8,5 @@ export declare class InputFilterComponent extends DefaultFilter implements OnIni
8
8
  ngOnInit(): void;
9
9
  ngOnChanges(changes: SimpleChanges): void;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<InputFilterComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<InputFilterComponent, "input-filter", never, {}, {}, never, never, true, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputFilterComponent, "ng2-input-filter", never, {}, {}, never, never, true, never>;
12
12
  }
@@ -7,5 +7,5 @@ export declare class SelectFilterComponent extends DefaultFilter implements OnIn
7
7
  constructor();
8
8
  ngOnInit(): void;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectFilterComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<SelectFilterComponent, "select-filter", never, {}, {}, never, never, true, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<SelectFilterComponent, "ng2-select-filter", never, {}, {}, never, never, true, never>;
11
11
  }
@@ -15,5 +15,5 @@ export declare class SmartTableColumnEditorDirective implements OnDestroy {
15
15
  buttclicked(): void;
16
16
  private getOverlayConfig;
17
17
  static ɵfac: i0.ɵɵFactoryDeclaration<SmartTableColumnEditorDirective, never>;
18
- static ɵdir: i0.ɵɵDirectiveDeclaration<SmartTableColumnEditorDirective, "[smartTableColumnEditor]", never, { "tableComponent": { "alias": "tableComponent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
18
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SmartTableColumnEditorDirective, "[ng2SmartTableColumnEditor]", never, { "tableComponent": { "alias": "tableComponent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
19
19
  }
@@ -15,5 +15,5 @@ export declare class TableColumnsEditorComponent {
15
15
  setAndUpdate(): void;
16
16
  private updateChangedState;
17
17
  static ɵfac: i0.ɵɵFactoryDeclaration<TableColumnsEditorComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<TableColumnsEditorComponent, "ngx-table-columns-editor", never, { "grid": { "alias": "grid"; "required": false; "isSignal": true; }; "close": { "alias": "close"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<TableColumnsEditorComponent, "ng2-table-columns-editor", never, { "grid": { "alias": "grid"; "required": false; "isSignal": true; }; "close": { "alias": "close"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
19
19
  }
@@ -1,9 +1,7 @@
1
- import { LocalDataSource } from "../../../lib/data-source/local/local.data-source";
2
1
  import { Grid } from "../../../lib/grid";
3
2
  import * as i0 from "@angular/core";
4
3
  export declare class CheckboxSelectAllComponent {
5
- grid: Grid;
6
- source: LocalDataSource;
4
+ readonly grid: import("@angular/core").InputSignal<Grid>;
7
5
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxSelectAllComponent, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxSelectAllComponent, "[ng2-st-checkbox-select-all]", never, { "grid": { "alias": "grid"; "required": false; }; "source": { "alias": "source"; "required": false; }; }, {}, never, never, true, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxSelectAllComponent, "[ng2-st-checkbox-select-all]", never, { "grid": { "alias": "grid"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
9
7
  }
@@ -2,9 +2,9 @@ import { Column } from "../../../lib/data-set/column";
2
2
  import { LocalDataSource } from "../../../lib/data-source/local/local.data-source";
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class ColumnTitleComponent {
5
- column: Column;
6
- source: LocalDataSource;
5
+ readonly source: import("@angular/core").InputSignal<LocalDataSource<any>>;
6
+ readonly column: import("@angular/core").InputSignal<Column>;
7
7
  readonly sort: import("@angular/core").OutputEmitterRef<any>;
8
8
  static ɵfac: i0.ɵɵFactoryDeclaration<ColumnTitleComponent, never>;
9
- static ɵcmp: i0.ɵɵComponentDeclaration<ColumnTitleComponent, "ng2-st-column-title", never, { "column": { "alias": "column"; "required": false; }; "source": { "alias": "source"; "required": false; }; }, { "sort": "sort"; }, never, never, true, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<ColumnTitleComponent, "ng2-st-column-title", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; "column": { "alias": "column"; "required": true; "isSignal": true; }; }, { "sort": "sort"; }, never, never, true, never>;
10
10
  }
@@ -1,18 +1,19 @@
1
- import { OnChanges, SimpleChanges } from "@angular/core";
1
+ import { OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
2
2
  import { Subscription } from "rxjs";
3
3
  import { Column } from "../../../../lib/data-set/column";
4
4
  import { LocalDataSource } from "./../../../../lib/data-source/local/local.data-source";
5
5
  import { SmartTableSortDirection } from "./../../../../lib/interfaces/smart-table.models";
6
6
  import * as i0 from "@angular/core";
7
- export declare class TitleComponent implements OnChanges {
7
+ export declare class TitleComponent implements OnChanges, OnDestroy {
8
8
  currentDirection: SmartTableSortDirection | "";
9
- column: Column;
10
- source: LocalDataSource;
9
+ readonly source: import("@angular/core").InputSignal<LocalDataSource<any>>;
10
+ readonly column: import("@angular/core").InputSignal<Column>;
11
11
  readonly sort: import("@angular/core").OutputEmitterRef<any>;
12
12
  protected dataChangedSub: Subscription | false;
13
13
  ngOnChanges(changes: SimpleChanges): void;
14
+ ngOnDestroy(): void;
14
15
  _sort(event: any): void;
15
16
  changeSortDirection(): string;
16
17
  static ɵfac: i0.ɵɵFactoryDeclaration<TitleComponent, never>;
17
- static ɵcmp: i0.ɵɵComponentDeclaration<TitleComponent, "ng2-smart-table-title", never, { "column": { "alias": "column"; "required": false; }; "source": { "alias": "source"; "required": false; }; }, { "sort": "sort"; }, never, never, true, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<TitleComponent, "ng2-smart-table-title", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; "column": { "alias": "column"; "required": true; "isSignal": true; }; }, { "sort": "sort"; }, never, never, true, never>;
18
19
  }
@@ -1,19 +1,19 @@
1
1
  import { Column } from './column';
2
2
  import { DataSet } from './data-set';
3
3
  import { Row } from './row';
4
- export declare function prepareValue(value: any): any;
5
4
  export declare class Cell {
6
5
  protected value: any;
7
6
  protected row: Row;
8
7
  protected column: Column;
9
8
  protected dataSet: DataSet;
9
+ private prepareValue;
10
10
  newValue: any;
11
- protected static PREPARE: typeof prepareValue;
12
11
  constructor(value: any, row: Row, column: Column, dataSet: DataSet);
13
12
  getColumn(): Column;
14
13
  getColumnClass(): string | undefined;
15
14
  getRow(): Row;
16
15
  getValue(): any;
16
+ getNotPrepareValue(): any;
17
17
  setValue(value: any): any;
18
18
  getId(): string;
19
19
  getTitle(): string;
@@ -1,4 +1,4 @@
1
- import { SmartTableEditorAndFilter } from '../interfaces/smart-table.models';
1
+ import { SmartTableCompareFunction, SmartTableEditorAndFilter, SmartTableFilterFunction, SmartTableValuePrepareFunction } from '../interfaces/smart-table.models';
2
2
  import { SmartTableColumnSettings, SmartTableColumnSettingsTypes, SmartTableSortDirection } from './../interfaces/smart-table.models';
3
3
  import { DataSet } from './data-set';
4
4
  export declare class Column {
@@ -19,15 +19,15 @@ export declare class Column {
19
19
  editor: SmartTableEditorAndFilter | false;
20
20
  filter: SmartTableEditorAndFilter | false;
21
21
  renderComponent: any;
22
- compareFunction: Function | undefined;
23
- valuePrepareFunction: Function | undefined;
24
- filterFunction: Function | undefined;
22
+ compareFunction?: SmartTableCompareFunction;
23
+ valuePrepareFunction?: SmartTableValuePrepareFunction;
24
+ filterFunction?: SmartTableFilterFunction;
25
25
  constructor(id: string, settings: SmartTableColumnSettings, dataSet: DataSet);
26
- getCompareFunction(): Function | undefined;
27
- getValuePrepareFunction(): Function | undefined;
28
- getFilterFunction(): Function | undefined;
26
+ getCompareFunction(): SmartTableCompareFunction | undefined;
27
+ getValuePrepareFunction(): SmartTableValuePrepareFunction | undefined;
28
+ getFilterFunction(): SmartTableFilterFunction | undefined;
29
29
  getConfig(): any;
30
- getFilterType(): any;
30
+ getFilterType(): false | "text" | "custom" | "textarea" | "list" | "checkbox";
31
31
  getFilterConfig(): any;
32
32
  protected process(settings: SmartTableColumnSettings): void;
33
33
  prepareSortDirection(): SmartTableSortDirection;
@@ -26,7 +26,7 @@ export declare class DataSet {
26
26
  * @param settings
27
27
  * @private
28
28
  */
29
- createColumns(settings: SmartTableColumnSettings[]): void;
29
+ createColumns(columnsParams: SmartTableColumnSettings[]): void;
30
30
  /**
31
31
  * Create rows based on current data prepared in data source
32
32
  * @private
@@ -1,6 +1,6 @@
1
1
  import { SmartTableFilterConf, SmartTableFilterItem, SmartTablePagingItem, SmartTableSortItem } from '../../interfaces/smart-table.models';
2
2
  import { DataSource } from '../data-source';
3
- export declare class LocalDataSource<T = any> extends DataSource<T> {
3
+ export declare class LocalDataSource<T extends Record<string, any> = any> extends DataSource<T> {
4
4
  protected data: T[];
5
5
  protected filteredAndSorted: T[];
6
6
  protected sortConf: SmartTableSortItem[];
@@ -1,4 +1,5 @@
1
- export declare function compareValues(direction: any, a: any, b: any): any;
1
+ import { SmartTableCompareFunction } from "../../interfaces/smart-table.models";
2
+ export declare function compareValues(direction: number, a: any, b: any): number;
2
3
  export declare class LocalSorter {
3
- static sort(data: Array<any>, field: string, direction: string, customCompare?: Function): Array<any>;
4
+ static sort<T extends Record<string, any>>(data: T[], field: string, direction: string, customCompare?: SmartTableCompareFunction): T[];
4
5
  }
@@ -1,3 +1,4 @@
1
+ import { Cell } from "../data-set/cell";
1
2
  import { LocalDataSource } from "../data-source/local/local.data-source";
2
3
  import { Deferred } from "../helpers";
3
4
  interface SelectOption {
@@ -69,6 +70,9 @@ export interface SmartTableCustomAction {
69
70
  }
70
71
  export type SmartTableColumnSettingsTypes = 'text' | 'html' | 'custom';
71
72
  export type SmartTableColumnSettings<T extends Record<string, any> = any> = SmartTableTextHtmlColumn<T> | SmartTableCustomColumn<T>;
73
+ export type SmartTableCompareFunction = (direction: number, a: any, b: any) => number;
74
+ export type SmartTableValuePrepareFunction<T extends Record<string, any> = any> = (columnData: any, rowData: T, cell: Cell) => any;
75
+ export type SmartTableFilterFunction = (columnData: any, search: string) => boolean;
72
76
  interface SmartTableDefaultColumn<T extends Record<string, any>> {
73
77
  key: keyof T;
74
78
  title: string;
@@ -82,9 +86,9 @@ interface SmartTableDefaultColumn<T extends Record<string, any>> {
82
86
  sortDirection?: SmartTableSortDirection | false;
83
87
  editor?: SmartTableEditorAndFilter;
84
88
  filter?: SmartTableEditorAndFilter | false;
85
- compareFunction?: (itemA: T, itemB: T) => number;
86
- valuePrepareFunction?: (columnData: any, rowData: T) => any;
87
- filterFunction?: (columnData: any, search: string) => boolean;
89
+ compareFunction?: SmartTableCompareFunction;
90
+ valuePrepareFunction?: SmartTableValuePrepareFunction<T>;
91
+ filterFunction?: SmartTableFilterFunction;
88
92
  }
89
93
  interface SmartTableTextHtmlColumn<T extends Record<string, any>> extends SmartTableDefaultColumn<T> {
90
94
  type: 'text' | 'html';
@@ -138,7 +142,7 @@ export type SmartTableSortDirection = 'asc' | 'desc';
138
142
  export interface SmartTableSortItem {
139
143
  field: string;
140
144
  direction: SmartTableSortDirection;
141
- compare?: any;
145
+ compare?: SmartTableCompareFunction;
142
146
  }
143
147
  interface SmartTableDefaultEvent<T> {
144
148
  confirm: Deferred<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@den4ik92/ng2-smart-table",
3
- "version": "19.1.1",
3
+ "version": "19.1.3",
4
4
  "description": "Angular Smart Table",
5
5
  "author": "Den4ik92",
6
6
  "license": "MIT",