@den4ik92/ng2-smart-table 2.0.2 → 2.0.4
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/esm2020/lib/lib/data-set/data-set.mjs +4 -6
- package/esm2020/lib/lib/grid.mjs +1 -1
- package/esm2020/lib/lib/interfaces/smart-table.models.mjs +1 -1
- package/esm2020/lib/ng2-smart-table.component.mjs +4 -17
- package/fesm2015/den4ik92-ng2-smart-table.mjs +6 -21
- package/fesm2015/den4ik92-ng2-smart-table.mjs.map +1 -1
- package/fesm2020/den4ik92-ng2-smart-table.mjs +6 -21
- package/fesm2020/den4ik92-ng2-smart-table.mjs.map +1 -1
- package/lib/lib/data-set/data-set.d.ts +3 -3
- package/lib/lib/interfaces/smart-table.models.d.ts +3 -5
- package/lib/ng2-smart-table.component.d.ts +1 -6
- package/package.json +1 -1
|
@@ -2,13 +2,13 @@ import { Row } from './row';
|
|
|
2
2
|
import { Column } from './column';
|
|
3
3
|
import { SmartTableColumnSettings } from '../interfaces/smart-table.models';
|
|
4
4
|
export declare class DataSet {
|
|
5
|
-
protected columnSettings: SmartTableColumnSettings;
|
|
5
|
+
protected columnSettings: SmartTableColumnSettings[];
|
|
6
6
|
newRow: Row;
|
|
7
7
|
protected data: Array<any>;
|
|
8
8
|
protected columns: Array<Column>;
|
|
9
9
|
protected rows: Array<Row>;
|
|
10
10
|
protected selectedRows: Set<Row>;
|
|
11
|
-
constructor(data: any[] | undefined, columnSettings: SmartTableColumnSettings);
|
|
11
|
+
constructor(data: any[] | undefined, columnSettings: SmartTableColumnSettings[]);
|
|
12
12
|
setData(data: Array<any>): void;
|
|
13
13
|
getColumns(): Array<Column>;
|
|
14
14
|
getRows(): Array<Row>;
|
|
@@ -26,7 +26,7 @@ export declare class DataSet {
|
|
|
26
26
|
* @param settings
|
|
27
27
|
* @private
|
|
28
28
|
*/
|
|
29
|
-
createColumns(settings:
|
|
29
|
+
createColumns(settings: SmartTableColumnSettings[]): void;
|
|
30
30
|
/**
|
|
31
31
|
* Create rows based on current data prepared in data source
|
|
32
32
|
* @private
|
|
@@ -7,14 +7,13 @@ export interface SelectOption {
|
|
|
7
7
|
interface ObjectAny {
|
|
8
8
|
[key: string]: any;
|
|
9
9
|
}
|
|
10
|
-
export interface SmartTableSettings<T
|
|
10
|
+
export interface SmartTableSettings<T = ObjectAny> {
|
|
11
11
|
mode?: 'inline' | 'external' | 'click-to-edit';
|
|
12
12
|
selectMode?: 'single' | 'multi';
|
|
13
13
|
selectedRowIndex?: number;
|
|
14
14
|
switchPageToSelectedRowPage?: boolean;
|
|
15
15
|
hideHeader?: boolean;
|
|
16
16
|
hideSubHeader?: boolean;
|
|
17
|
-
bodyHeight?: string;
|
|
18
17
|
actions?: SmartTableAction | false;
|
|
19
18
|
filter?: {
|
|
20
19
|
inputClass: string;
|
|
@@ -42,9 +41,7 @@ export interface SmartTableSettings<T extends ObjectAny = any> {
|
|
|
42
41
|
class?: string;
|
|
43
42
|
};
|
|
44
43
|
noDataMessage?: string;
|
|
45
|
-
columns:
|
|
46
|
-
[key in keyof T]?: SmartTableColumnSettings<T>;
|
|
47
|
-
};
|
|
44
|
+
columns: SmartTableColumnSettings<T>[];
|
|
48
45
|
pager?: SmartTablePagerSettings | false;
|
|
49
46
|
rowClassFunction?: (row: {
|
|
50
47
|
data: T;
|
|
@@ -65,6 +62,7 @@ export interface SmartTableCustomAction {
|
|
|
65
62
|
export type SmartTableColumnSettingsTypes = 'text' | 'html' | 'custom';
|
|
66
63
|
export type SmartTableColumnSettings<T = any> = SmartTableTextHtmlColumn<T> | SmartTableCustomColumn<T>;
|
|
67
64
|
interface SmartTableDefaultColumn<T> {
|
|
65
|
+
key: keyof T;
|
|
68
66
|
title: string;
|
|
69
67
|
width?: string;
|
|
70
68
|
class?: string;
|
|
@@ -9,7 +9,6 @@ export declare class Ng2SmartTableComponent implements OnChanges {
|
|
|
9
9
|
settings: SmartTableSettings;
|
|
10
10
|
multiRowSelect: EventEmitter<SmartTableRowSelectEvent<any>>;
|
|
11
11
|
rowClicked: EventEmitter<SmartTableRowClickedEvent<any>>;
|
|
12
|
-
listScrollEnd: EventEmitter<boolean>;
|
|
13
12
|
delete: EventEmitter<any>;
|
|
14
13
|
edit: EventEmitter<any>;
|
|
15
14
|
editCancel: EventEmitter<any>;
|
|
@@ -26,7 +25,6 @@ export declare class Ng2SmartTableComponent implements OnChanges {
|
|
|
26
25
|
isHideSubHeader: boolean;
|
|
27
26
|
isPagerDisplay: boolean;
|
|
28
27
|
rowClassFunction: Function;
|
|
29
|
-
private currentScrollTop;
|
|
30
28
|
grid: Grid;
|
|
31
29
|
defaultSettings: SmartTableSettings;
|
|
32
30
|
ngOnChanges(changes: {
|
|
@@ -36,13 +34,10 @@ export declare class Ng2SmartTableComponent implements OnChanges {
|
|
|
36
34
|
protected onSelectAllRows(): void;
|
|
37
35
|
protected onSelectRow(row: Row, state: boolean): void;
|
|
38
36
|
protected emitUserRowClicked(row: Row): void;
|
|
39
|
-
protected onScroll(event: Event & {
|
|
40
|
-
target: HTMLElement;
|
|
41
|
-
}): void;
|
|
42
37
|
private initGrid;
|
|
43
38
|
private prepareSource;
|
|
44
39
|
private prepareSettings;
|
|
45
40
|
private emitUserSelectRow;
|
|
46
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<Ng2SmartTableComponent, never>;
|
|
47
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Ng2SmartTableComponent, "ng2-smart-table", never, { "source": "source"; "settings": "settings"; }, { "multiRowSelect": "multiRowSelect"; "rowClicked": "rowClicked"; "
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Ng2SmartTableComponent, "ng2-smart-table", never, { "source": "source"; "settings": "settings"; }, { "multiRowSelect": "multiRowSelect"; "rowClicked": "rowClicked"; "delete": "delete"; "edit": "edit"; "editCancel": "editCancel"; "create": "create"; "custom": "custom"; "deleteConfirm": "deleteConfirm"; "editConfirm": "editConfirm"; "createConfirm": "createConfirm"; "rowHover": "rowHover"; }, never, never, false, never>;
|
|
48
43
|
}
|