@den4ik92/ng2-smart-table 19.5.46 → 19.5.51

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,13 +1,13 @@
1
1
  import { Column } from '../../../../lib/data-set/column';
2
- import { DataSource } from '../../../../lib/data-source/data-source';
3
- import { SmartTableSortDirection } from '../../../../lib/interfaces/smart-table.models';
2
+ import { SmartTableSortDirection, SmartTableSortItem } from '../../../../lib/interfaces/smart-table.models';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class ColumnTitleComponent {
6
- readonly source: import("@angular/core").InputSignal<DataSource<any>>;
5
+ readonly currentSort: import("@angular/core").InputSignal<SmartTableSortItem | null>;
7
6
  readonly column: import("@angular/core").InputSignal<Column>;
7
+ readonly sortEmit: import("@angular/core").OutputEmitterRef<void>;
8
8
  protected readonly currentSortDirection: import("@angular/core").Signal<SmartTableSortDirection | null>;
9
9
  protected readonly currentSortDirectionSymbol: import("@angular/core").Signal<string>;
10
10
  _sort(event: Event): void;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<ColumnTitleComponent, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<ColumnTitleComponent, "ng2-st-column-title", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; "column": { "alias": "column"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<ColumnTitleComponent, "ng2-st-column-title", never, { "currentSort": { "alias": "currentSort"; "required": true; "isSignal": true; }; "column": { "alias": "column"; "required": true; "isSignal": true; }; }, { "sortEmit": "sortEmit"; }, never, never, true, never>;
13
13
  }
@@ -1,10 +1,12 @@
1
+ import { Column } from 'ng2-smart-table';
1
2
  import { DataSource } from '../../../lib/data-source/data-source';
2
3
  import { Grid } from '../../../lib/grid';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class TheadTitlesRowComponent {
5
6
  readonly grid: import("@angular/core").InputSignal<Grid>;
6
7
  readonly source: import("@angular/core").InputSignal<DataSource<any>>;
8
+ readonly sortEmit: import("@angular/core").OutputEmitterRef<Column>;
7
9
  readonly selectAllRows: import("@angular/core").OutputEmitterRef<void>;
8
10
  static ɵfac: i0.ɵɵFactoryDeclaration<TheadTitlesRowComponent, never>;
9
- static ɵcmp: i0.ɵɵComponentDeclaration<TheadTitlesRowComponent, "[ng2-st-thead-titles-row]", never, { "grid": { "alias": "grid"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": true; "isSignal": true; }; }, { "selectAllRows": "selectAllRows"; }, never, never, true, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<TheadTitlesRowComponent, "[ng2-st-thead-titles-row]", never, { "grid": { "alias": "grid"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": true; "isSignal": true; }; }, { "sortEmit": "sortEmit"; "selectAllRows": "selectAllRows"; }, never, never, true, never>;
10
12
  }
@@ -1,6 +1,7 @@
1
1
  import { Column } from '../../lib/data-set/column';
2
2
  import { DataSource } from '../../lib/data-source/data-source';
3
3
  import { Grid } from '../../lib/grid';
4
+ import { SmartTableSortItem } from '../../lib/interfaces/smart-table.models';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class Ng2SmartTableTheadComponent {
6
7
  readonly grid: import("@angular/core").InputSignal<Grid>;
@@ -13,11 +14,13 @@ export declare class Ng2SmartTableTheadComponent {
13
14
  readonly columnsWithSort: import("@angular/core").Signal<Column[]>;
14
15
  readonly columnsWithSortLength: import("@angular/core").Signal<number>;
15
16
  readonly columnsWithFiltersLength: import("@angular/core").Signal<number>;
16
- readonly currentSortConfig: import("@angular/core").Signal<import("@den4ik92/ng2-smart-table").SmartTableSortItem>;
17
+ readonly currentSortConfig: import("@angular/core").Signal<SmartTableSortItem | null>;
17
18
  readonly filterDropdownIsOpen: import("@angular/core").WritableSignal<boolean>;
18
19
  protected toggleDropdown(state?: boolean): void;
19
20
  protected sortByColumn(column?: Column): void;
20
21
  readonly filterInputClass: import("@angular/core").Signal<string>;
22
+ private lastColumnSort;
23
+ private getPrepareSort;
21
24
  static ɵfac: i0.ɵɵFactoryDeclaration<Ng2SmartTableTheadComponent, never>;
22
25
  static ɵcmp: i0.ɵɵComponentDeclaration<Ng2SmartTableTheadComponent, "[ng2-st-thead]", never, { "grid": { "alias": "grid"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": true; "isSignal": true; }; "isMobileView": { "alias": "isMobileView"; "required": false; "isSignal": true; }; }, { "selectAllRows": "selectAllRows"; "create": "create"; }, never, never, true, never>;
23
26
  }
@@ -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;
@@ -2,7 +2,7 @@ import { Observable, Subject } from 'rxjs';
2
2
  import { BaseDataType, SmartTableFilterItem, SmartTableOnChangedEvent, SmartTableOnChangedEventToEmit, SmartTablePagerSettings, SmartTableSortItem } from '../interfaces/smart-table.models';
3
3
  export declare abstract class DataSource<T extends BaseDataType = any> {
4
4
  protected readonly onChangedSource: Subject<SmartTableOnChangedEvent>;
5
- protected readonly sortConf: import("@angular/core").WritableSignal<SmartTableSortItem>;
5
+ protected readonly sortConf: import("@angular/core").WritableSignal<SmartTableSortItem | null>;
6
6
  protected readonly filters: import("@angular/core").WritableSignal<SmartTableFilterItem[]>;
7
7
  readonly pagingConf: import("@angular/core").WritableSignal<SmartTablePagerSettings>;
8
8
  protected readonly data: import("@angular/core").WritableSignal<T[]>;
@@ -11,7 +11,7 @@ export declare abstract class DataSource<T extends BaseDataType = any> {
11
11
  */
12
12
  abstract getAll(): Promise<T[]>;
13
13
  abstract count(): number;
14
- readonly getSort: import("@angular/core").Signal<SmartTableSortItem>;
14
+ readonly getSort: import("@angular/core").Signal<SmartTableSortItem | null>;
15
15
  readonly getFilters: import("@angular/core").Signal<SmartTableFilterItem[]>;
16
16
  refresh(): void;
17
17
  columnRefresh(): void;
@@ -22,7 +22,7 @@ export declare abstract class DataSource<T extends BaseDataType = any> {
22
22
  remove(element: T): Promise<true>;
23
23
  update(oldItem: T, newItem: T): Promise<true>;
24
24
  empty(): Promise<true>;
25
- setSort(conf: SmartTableSortItem, doEmit?: boolean): void;
25
+ setSort(conf: SmartTableSortItem | null, doEmit?: boolean): void;
26
26
  addFilter(newFilter: SmartTableFilterItem, doEmit?: boolean): Promise<void>;
27
27
  setFilters(newFilters: SmartTableFilterItem[], doEmit?: boolean): void;
28
28
  setPaging(page: number | undefined, perPage: number, doEmit?: boolean): void;
@@ -3,7 +3,7 @@ import { Observable } from 'rxjs';
3
3
  import { SmartTableFilterItem, SmartTableOnChangedEventToEmit, SmartTablePagerSettings, SmartTableSortItem } from '../../interfaces/smart-table.models';
4
4
  import { DataSource } from '../data-source';
5
5
  export type ParamsPrepareFunction = (options: {
6
- sort: SmartTableSortItem;
6
+ sort: SmartTableSortItem | null;
7
7
  filters: SmartTableFilterItem[];
8
8
  page: number;
9
9
  limit: number;
@@ -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';
@@ -21,6 +22,7 @@ export interface ColumnPositionState {
21
22
  export interface SmartTableSettings<T extends BaseDataType = any> {
22
23
  selectMode?: 'single' | 'multi';
23
24
  mode?: 'inline' | 'external';
25
+ resetSortOnThirdClick?: boolean;
24
26
  columnSortStorageKey?: string;
25
27
  columnSort?: boolean;
26
28
  hideHeader?: boolean;
@@ -104,7 +106,15 @@ interface SmartTableTextHtmlColumn<T extends BaseDataType> extends SmartTableDef
104
106
  }
105
107
  interface SmartTableCustomColumn<T extends BaseDataType> extends SmartTableDefaultColumn<T> {
106
108
  type: 'custom';
107
- 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>;
108
118
  }
109
119
  export type SmartTableEditorAndFilterTypes = 'text' | 'textarea' | 'list' | 'custom' | 'checkbox';
110
120
  export type SmartTableEditorAndFilter = SmartTableTextEditor | SmartTableEditorList | SmartTableEditorCheckbox | SmartTableEditorCustom;
@@ -198,7 +208,7 @@ interface SmartTableOnChangedEventBase<T extends BaseDataType = any> {
198
208
  elements: T[];
199
209
  filters: SmartTableFilterItem[];
200
210
  paging: SmartTablePagerSettings;
201
- sort: SmartTableSortItem;
211
+ sort: SmartTableSortItem | null;
202
212
  }
203
213
  interface SmartTableOnChangedEventAll {
204
214
  action: Exclude<SmartTableOnChangedEventType, 'remove' | 'update' | 'append' | 'prepend' | 'appendMany' | 'add'>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@den4ik92/ng2-smart-table",
3
- "version": "19.5.46",
3
+ "version": "19.5.51",
4
4
  "description": "Angular Smart Table",
5
5
  "author": "Den4ik92",
6
6
  "license": "MIT",