@den4ik92/ng2-smart-table 20.0.0 → 20.7.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.
package/index.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ interface ColumnPositionState {
|
|
|
67
67
|
interface SmartTableSettings<T extends BaseDataType = any> {
|
|
68
68
|
selectMode?: 'single' | 'multi';
|
|
69
69
|
mode?: 'inline' | 'external';
|
|
70
|
+
cellEmptyText?: string;
|
|
70
71
|
resetSortOnThirdClick?: boolean;
|
|
71
72
|
columnSort?: {
|
|
72
73
|
/**
|
|
@@ -133,7 +134,7 @@ interface SmartTableCustomAction<T extends BaseDataType = any> {
|
|
|
133
134
|
title: string;
|
|
134
135
|
hasPermissionFunction?: (row: T) => boolean;
|
|
135
136
|
}
|
|
136
|
-
type SmartTableColumnSettingsTypes = 'text' | 'html' | 'custom';
|
|
137
|
+
type SmartTableColumnSettingsTypes = 'text' | 'number' | 'html' | 'custom';
|
|
137
138
|
type SmartTableColumnSettings<T extends BaseDataType = any> = SmartTableTextHtmlColumn<T> | SmartTableCustomColumn<T>;
|
|
138
139
|
type SmartTableCompareFunction = (direction: number, a: any, b: any) => number;
|
|
139
140
|
type SmartTableValuePrepareFunction<T extends BaseDataType = any> = (columnData: any, rowData: T, cell: Cell) => any;
|
|
@@ -157,7 +158,7 @@ interface SmartTableDefaultColumn<T extends BaseDataType> {
|
|
|
157
158
|
filterFunction?: SmartTableFilterFunction;
|
|
158
159
|
}
|
|
159
160
|
interface SmartTableTextHtmlColumn<T extends BaseDataType> extends SmartTableDefaultColumn<T> {
|
|
160
|
-
type: 'text' | 'html';
|
|
161
|
+
type: 'text' | 'number' | 'html';
|
|
161
162
|
}
|
|
162
163
|
interface SmartTableCustomColumn<T extends BaseDataType> extends SmartTableDefaultColumn<T> {
|
|
163
164
|
type: 'custom';
|
|
@@ -169,10 +170,10 @@ interface SmartTableCustomColumn<T extends BaseDataType> extends SmartTableDefau
|
|
|
169
170
|
*/
|
|
170
171
|
inputs?: Record<string, any>;
|
|
171
172
|
}
|
|
172
|
-
type SmartTableEditorAndFilterTypes = 'text' | 'textarea' | 'list' | 'custom' | 'checkbox';
|
|
173
|
+
type SmartTableEditorAndFilterTypes = 'text' | 'number' | 'textarea' | 'list' | 'custom' | 'checkbox';
|
|
173
174
|
type SmartTableEditorAndFilter = SmartTableTextEditor | SmartTableEditorList | SmartTableEditorCheckbox | SmartTableEditorCustom;
|
|
174
175
|
interface SmartTableTextEditor {
|
|
175
|
-
type: 'text' | 'textarea';
|
|
176
|
+
type: 'text' | 'number' | 'textarea';
|
|
176
177
|
config?: {
|
|
177
178
|
placeholder?: string;
|
|
178
179
|
} & Record<string, any>;
|
|
@@ -313,6 +314,7 @@ declare class Row {
|
|
|
313
314
|
index: number;
|
|
314
315
|
protected rowDataObj: any;
|
|
315
316
|
protected columnsList: Column[];
|
|
317
|
+
protected cellEmptyText?: string | undefined;
|
|
316
318
|
readonly pending: _angular_core.WritableSignal<boolean>;
|
|
317
319
|
readonly isSelected: _angular_core.WritableSignal<boolean>;
|
|
318
320
|
readonly isInEditing: _angular_core.WritableSignal<boolean>;
|
|
@@ -320,7 +322,7 @@ declare class Row {
|
|
|
320
322
|
readonly rowData: _angular_core.WritableSignal<any>;
|
|
321
323
|
readonly columns: _angular_core.WritableSignal<Column[]>;
|
|
322
324
|
readonly visibleCells: _angular_core.Signal<Cell[]>;
|
|
323
|
-
constructor(index: number, rowDataObj: any, columnsList: Column[]);
|
|
325
|
+
constructor(index: number, rowDataObj: any, columnsList: Column[], cellEmptyText?: string | undefined);
|
|
324
326
|
getNewData(): any;
|
|
325
327
|
setData<T = any>(rowData: T): void;
|
|
326
328
|
createCell(column: Column, rowData: any): Cell;
|
|
@@ -329,6 +331,7 @@ declare class Row {
|
|
|
329
331
|
declare class DataSet {
|
|
330
332
|
protected columnSettings: SmartTableColumnSettings[];
|
|
331
333
|
readonly editorInputClass: string;
|
|
334
|
+
readonly cellEmptyText?: string | undefined;
|
|
332
335
|
newRow: Row;
|
|
333
336
|
protected readonly data: _angular_core.WritableSignal<any[]>;
|
|
334
337
|
protected readonly columns: _angular_core.WritableSignal<Column[]>;
|
|
@@ -338,7 +341,7 @@ declare class DataSet {
|
|
|
338
341
|
readonly getVisibleColumns: _angular_core.Signal<Column[]>;
|
|
339
342
|
readonly getRows: _angular_core.Signal<Row[]>;
|
|
340
343
|
readonly isAllSelected: _angular_core.Signal<boolean>;
|
|
341
|
-
constructor(dataList: any[] | undefined, columnSettings: SmartTableColumnSettings[], editorInputClass: string);
|
|
344
|
+
constructor(dataList: any[] | undefined, columnSettings: SmartTableColumnSettings[], editorInputClass: string, cellEmptyText?: string | undefined);
|
|
342
345
|
setData(data: any[]): void;
|
|
343
346
|
setColumnsConfig(columnSettings: SmartTableColumnSettings[]): void;
|
|
344
347
|
findRowByData(data: any): Row | undefined;
|
|
@@ -386,7 +389,7 @@ declare class Column {
|
|
|
386
389
|
filterFunction?: SmartTableFilterFunction;
|
|
387
390
|
constructor(id: string, settings: SmartTableColumnSettings, dataSet: DataSet);
|
|
388
391
|
getEditorConfig(): SmartTableEditorAndFilter['config'] | undefined;
|
|
389
|
-
getFilterType(): false | "text" | "custom" | "textarea" | "list" | "checkbox";
|
|
392
|
+
getFilterType(): false | "number" | "text" | "custom" | "textarea" | "list" | "checkbox";
|
|
390
393
|
getFilterConfig(): SmartTableEditorAndFilter['config'] | undefined;
|
|
391
394
|
}
|
|
392
395
|
|
|
@@ -394,12 +397,13 @@ declare class Cell {
|
|
|
394
397
|
protected value: any;
|
|
395
398
|
row: Row;
|
|
396
399
|
column: Column;
|
|
400
|
+
cellEmptyText: string;
|
|
397
401
|
readonly newValue: _angular_core.WritableSignal<any>;
|
|
398
402
|
readonly columnClass: string;
|
|
399
403
|
readonly styles: Partial<CSSStyleDeclaration>;
|
|
400
404
|
readonly title: string;
|
|
401
405
|
readonly id: string;
|
|
402
|
-
constructor(value: any, row: Row, column: Column);
|
|
406
|
+
constructor(value: any, row: Row, column: Column, cellEmptyText?: string);
|
|
403
407
|
getValue(): any;
|
|
404
408
|
getNotPrepareValue(): any;
|
|
405
409
|
setNewValue(value: any): void;
|