@den4ik92/ng2-smart-table 19.6.43 → 19.6.46
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/fesm2022/den4ik92-ng2-smart-table.mjs +100 -92
- package/fesm2022/den4ik92-ng2-smart-table.mjs.map +1 -1
- package/lib/components/cell/cell-editors/checkbox-editor.component.d.ts +5 -4
- package/lib/components/filter/custom-filter.component.d.ts +5 -2
- package/lib/components/filter/filter-types/base-filter.component.d.ts +4 -3
- package/lib/components/filter/filter-types/checkbox-filter.component.d.ts +1 -3
- package/lib/components/filter/filter-types/select-filter.component.d.ts +7 -1
- package/lib/components/filter/filter.component.d.ts +1 -1
- package/lib/lib/data-set/column.d.ts +2 -2
- package/lib/lib/data-source/data-source.d.ts +3 -2
- package/lib/lib/grid.d.ts +2 -1
- package/lib/lib/interfaces/smart-table.models.d.ts +29 -11
- package/lib/ng2-smart-table.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
1
2
|
import { BaseEditorComponent } from './base-editor.component';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class CheckboxEditorComponent extends BaseEditorComponent {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare class CheckboxEditorComponent extends BaseEditorComponent implements OnInit {
|
|
5
|
+
trueVal: any;
|
|
6
|
+
falseVal: any;
|
|
7
|
+
ngOnInit(): void;
|
|
7
8
|
onChange(event: any): void;
|
|
8
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxEditorComponent, never>;
|
|
9
10
|
static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxEditorComponent, "ng2-checkbox-editor", never, {}, {}, never, never, true, never>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { OnInit, Type } from '@angular/core';
|
|
1
2
|
import { Column } from '../../lib/data-set/column';
|
|
2
3
|
import { DataSource } from '../../lib/data-source/data-source';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CustomFilterComponent {
|
|
5
|
-
|
|
5
|
+
export declare class CustomFilterComponent implements OnInit {
|
|
6
|
+
customFilterComponent?: Type<any>;
|
|
6
7
|
readonly query: import("@angular/core").InputSignal<unknown>;
|
|
7
8
|
readonly inputClass: import("@angular/core").InputSignal<string>;
|
|
8
9
|
readonly source: import("@angular/core").InputSignal<DataSource<any>>;
|
|
9
10
|
readonly column: import("@angular/core").InputSignal<Column>;
|
|
10
11
|
readonly filter: import("@angular/core").OutputEmitterRef<any>;
|
|
12
|
+
readonly componentInputs: import("@angular/core").Signal<Record<string, any>>;
|
|
13
|
+
ngOnInit(): void;
|
|
11
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<CustomFilterComponent, never>;
|
|
12
15
|
static ɵcmp: i0.ɵɵComponentDeclaration<CustomFilterComponent, "ng2-custom-table-filter", never, { "query": { "alias": "query"; "required": false; "isSignal": true; }; "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>;
|
|
13
16
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { InputSignal,
|
|
1
|
+
import { InputSignal, OnDestroy, OnInit, OutputEmitterRef } from '@angular/core';
|
|
2
2
|
import { Subscription } from 'rxjs';
|
|
3
3
|
import { UntypedFormControl } from '@angular/forms';
|
|
4
4
|
import { Column } from '../../../lib/data-set/column';
|
|
5
5
|
import { DataSource } from '../../../lib/data-source/data-source';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class BaseFilterComponent implements FilterComponent, OnDestroy,
|
|
7
|
+
export declare class BaseFilterComponent implements FilterComponent, OnDestroy, OnInit {
|
|
8
8
|
delay: number;
|
|
9
9
|
changesSubscription?: Subscription;
|
|
10
10
|
readonly query: InputSignal<unknown>;
|
|
@@ -13,9 +13,10 @@ export declare class BaseFilterComponent implements FilterComponent, OnDestroy,
|
|
|
13
13
|
readonly column: InputSignal<Column>;
|
|
14
14
|
readonly filterEmitter: InputSignal<OutputEmitterRef<any>>;
|
|
15
15
|
readonly inputControl: UntypedFormControl;
|
|
16
|
+
placeholder: string;
|
|
17
|
+
constructor();
|
|
16
18
|
ngOnDestroy(): void;
|
|
17
19
|
ngOnInit(): void;
|
|
18
|
-
ngOnChanges({ query }: SimpleChanges): void;
|
|
19
20
|
setFilter(query: any): void;
|
|
20
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseFilterComponent, never>;
|
|
21
22
|
static ɵcmp: i0.ɵɵComponentDeclaration<BaseFilterComponent, "ng2-base-filter-component", never, { "query": { "alias": "query"; "required": false; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; "source": { "alias": "source"; "required": true; "isSignal": true; }; "column": { "alias": "column"; "required": true; "isSignal": true; }; "filterEmitter": { "alias": "filterEmitter"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { OnChanges, OnDestroy, OnInit } from '@angular/core';
|
|
2
1
|
import { BaseFilterComponent } from './base-filter.component';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CheckboxFilterComponent extends BaseFilterComponent
|
|
3
|
+
export declare class CheckboxFilterComponent extends BaseFilterComponent {
|
|
5
4
|
readonly filterIsActive: import("@angular/core").Signal<boolean>;
|
|
6
5
|
readonly currentState: import("@angular/core").Signal<boolean>;
|
|
7
|
-
constructor();
|
|
8
6
|
private getValuesConfig;
|
|
9
7
|
setCheckFilter(state: boolean): void;
|
|
10
8
|
resetFilter(event: Event): void;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
1
2
|
import { BaseFilterComponent } from './base-filter.component';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class SelectFilterComponent extends BaseFilterComponent {
|
|
4
|
+
export declare class SelectFilterComponent extends BaseFilterComponent implements OnInit {
|
|
5
|
+
readonly optionsList: import("@angular/core").WritableSignal<{
|
|
6
|
+
title: string;
|
|
7
|
+
value: any;
|
|
8
|
+
}[]>;
|
|
9
|
+
ngOnInit(): void;
|
|
4
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectFilterComponent, never>;
|
|
5
11
|
static ɵcmp: i0.ɵɵComponentDeclaration<SelectFilterComponent, "ng2-select-filter", never, {}, {}, never, never, true, never>;
|
|
6
12
|
}
|
|
@@ -2,10 +2,10 @@ import { Column } from '../../lib/data-set/column';
|
|
|
2
2
|
import { DataSource } from '../../lib/data-source/data-source';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class FilterComponent {
|
|
5
|
-
protected readonly query: import("@angular/core").Signal<string | null>;
|
|
6
5
|
readonly column: import("@angular/core").InputSignal<Column>;
|
|
7
6
|
readonly source: import("@angular/core").InputSignal<DataSource<any>>;
|
|
8
7
|
readonly inputClass: import("@angular/core").InputSignal<string>;
|
|
8
|
+
protected readonly query: import("@angular/core").Signal<string | null>;
|
|
9
9
|
onFilter(query: any): void;
|
|
10
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<FilterComponent, never>;
|
|
11
11
|
static ɵcmp: i0.ɵɵComponentDeclaration<FilterComponent, "ng2-smart-table-filter", never, { "column": { "alias": "column"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": true; "isSignal": true; }; "inputClass": { "alias": "inputClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -24,7 +24,7 @@ export declare class Column {
|
|
|
24
24
|
valuePrepareFunction?: SmartTableValuePrepareFunction;
|
|
25
25
|
filterFunction?: SmartTableFilterFunction;
|
|
26
26
|
constructor(id: string, settings: SmartTableColumnSettings, dataSet: DataSet);
|
|
27
|
-
getEditorConfig(): SmartTableEditorAndFilter['config'] |
|
|
27
|
+
getEditorConfig(): SmartTableEditorAndFilter['config'] | undefined;
|
|
28
28
|
getFilterType(): false | "text" | "custom" | "textarea" | "list" | "checkbox";
|
|
29
|
-
getFilterConfig(): SmartTableEditorAndFilter['config'] |
|
|
29
|
+
getFilterConfig(): SmartTableEditorAndFilter['config'] | undefined;
|
|
30
30
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
1
2
|
import { Observable, Subject } from 'rxjs';
|
|
2
3
|
import { BaseDataType, SmartTableFilterItem, SmartTableOnChangedEvent, SmartTableOnChangedEventToEmit, SmartTablePagerSettings, SmartTableSortItem } from '../interfaces/smart-table.models';
|
|
3
4
|
export declare abstract class DataSource<T extends BaseDataType = any> {
|
|
@@ -11,8 +12,8 @@ export declare abstract class DataSource<T extends BaseDataType = any> {
|
|
|
11
12
|
*/
|
|
12
13
|
abstract getAll(): Promise<T[]>;
|
|
13
14
|
abstract count(): number;
|
|
14
|
-
readonly getSort:
|
|
15
|
-
readonly getFilters:
|
|
15
|
+
readonly getSort: Signal<SmartTableSortItem | null>;
|
|
16
|
+
readonly getFilters: Signal<SmartTableFilterItem[]>;
|
|
16
17
|
refresh(): void;
|
|
17
18
|
columnRefresh(): void;
|
|
18
19
|
onChanged(): Observable<SmartTableOnChangedEvent>;
|
package/lib/lib/grid.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export declare class Grid {
|
|
|
15
15
|
readonly isActionsVisible: import("@angular/core").Signal<boolean>;
|
|
16
16
|
readonly actionIsOnLeft: import("@angular/core").Signal<boolean>;
|
|
17
17
|
readonly actionIsOnRight: import("@angular/core").Signal<boolean>;
|
|
18
|
+
readonly columnSortDragDelay: import("@angular/core").Signal<number>;
|
|
19
|
+
private readonly columnStateStorageKey;
|
|
18
20
|
constructor(source: DataSource | undefined, settings: SmartTableSettings);
|
|
19
21
|
setColumnsSortedEmitter(emitter: OutputEmitterRef<ColumnPositionState[]>): void;
|
|
20
22
|
detach(): void;
|
|
@@ -40,5 +42,4 @@ export declare class Grid {
|
|
|
40
42
|
private setColumnsSortState;
|
|
41
43
|
private getColumnsStateFromSettings;
|
|
42
44
|
private getMergedColumnStates;
|
|
43
|
-
private get columnStateStorageKey();
|
|
44
45
|
}
|
|
@@ -23,8 +23,17 @@ export interface SmartTableSettings<T extends BaseDataType = any> {
|
|
|
23
23
|
selectMode?: 'single' | 'multi';
|
|
24
24
|
mode?: 'inline' | 'external';
|
|
25
25
|
resetSortOnThirdClick?: boolean;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
columnSort?: {
|
|
27
|
+
/**
|
|
28
|
+
* @description save table columns state in local storage and use it after init
|
|
29
|
+
*/
|
|
30
|
+
stateStorageKey?: string;
|
|
31
|
+
/**
|
|
32
|
+
* @description delay to start move column card
|
|
33
|
+
*/
|
|
34
|
+
dragDelay?: number;
|
|
35
|
+
active: boolean;
|
|
36
|
+
};
|
|
28
37
|
hideHeader?: boolean;
|
|
29
38
|
hideSubHeader?: boolean;
|
|
30
39
|
/**
|
|
@@ -109,25 +118,26 @@ interface SmartTableCustomColumn<T extends BaseDataType> extends SmartTableDefau
|
|
|
109
118
|
renderComponent: ComponentType<any>;
|
|
110
119
|
/**
|
|
111
120
|
* @description you can set any component inputs.
|
|
112
|
-
*
|
|
113
121
|
* inputs value is not updated when changed. set once onInit.
|
|
114
|
-
*
|
|
115
122
|
* make sure to set the correct input name to prevent setInput error
|
|
116
123
|
*/
|
|
117
|
-
|
|
124
|
+
inputs?: Record<string, any>;
|
|
118
125
|
}
|
|
119
126
|
export type SmartTableEditorAndFilterTypes = 'text' | 'textarea' | 'list' | 'custom' | 'checkbox';
|
|
120
127
|
export type SmartTableEditorAndFilter = SmartTableTextEditor | SmartTableEditorList | SmartTableEditorCheckbox | SmartTableEditorCustom;
|
|
121
128
|
interface SmartTableTextEditor {
|
|
122
129
|
type: 'text' | 'textarea';
|
|
123
|
-
config?:
|
|
130
|
+
config?: {
|
|
131
|
+
placeholder?: string;
|
|
132
|
+
} & Record<string, any>;
|
|
124
133
|
}
|
|
125
134
|
interface SmartTableEditorList {
|
|
126
135
|
type: 'list';
|
|
127
136
|
config: {
|
|
137
|
+
placeholder?: string;
|
|
128
138
|
selectText?: string;
|
|
129
139
|
list: SelectOption[];
|
|
130
|
-
}
|
|
140
|
+
} & Record<string, any>;
|
|
131
141
|
}
|
|
132
142
|
interface SmartTableEditorCheckbox {
|
|
133
143
|
type: 'checkbox';
|
|
@@ -135,12 +145,20 @@ interface SmartTableEditorCheckbox {
|
|
|
135
145
|
true: any;
|
|
136
146
|
false: any;
|
|
137
147
|
resetText?: string;
|
|
138
|
-
}
|
|
148
|
+
} & Record<string, any>;
|
|
139
149
|
}
|
|
140
|
-
interface SmartTableEditorCustom {
|
|
150
|
+
export interface SmartTableEditorCustom {
|
|
141
151
|
type: 'custom';
|
|
142
|
-
component: any
|
|
143
|
-
config?:
|
|
152
|
+
component: ComponentType<any>;
|
|
153
|
+
config?: {
|
|
154
|
+
placeholder?: string;
|
|
155
|
+
/**
|
|
156
|
+
* @description you can set any component inputs.
|
|
157
|
+
* inputs value is not updated when changed. set once onInit.
|
|
158
|
+
* make sure to set the correct input name to prevent setInput error
|
|
159
|
+
*/
|
|
160
|
+
inputs?: Record<string, any>;
|
|
161
|
+
} & Record<string, any>;
|
|
144
162
|
}
|
|
145
163
|
export interface SmartTablePagerSettings {
|
|
146
164
|
display: boolean;
|
|
@@ -19,7 +19,7 @@ export declare class Ng2SmartTableComponent<T extends BaseDataType = any> implem
|
|
|
19
19
|
* <div #paginationSlot>
|
|
20
20
|
* </div>
|
|
21
21
|
* inside component
|
|
22
|
-
* readonly paginationContainerRef = viewChild
|
|
22
|
+
* readonly paginationContainerRef = viewChild('paginationSlot', {
|
|
23
23
|
* read: ViewContainerRef,
|
|
24
24
|
* });
|
|
25
25
|
*/
|