@den4ik92/ng2-smart-table 19.6.42 → 19.6.45
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 +92 -87
- 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/interfaces/smart-table.models.d.ts +18 -9
- 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>;
|
|
@@ -104,30 +104,31 @@ interface SmartTableDefaultColumn<T extends BaseDataType> {
|
|
|
104
104
|
interface SmartTableTextHtmlColumn<T extends BaseDataType> extends SmartTableDefaultColumn<T> {
|
|
105
105
|
type: 'text' | 'html';
|
|
106
106
|
}
|
|
107
|
-
interface SmartTableCustomColumn<T extends BaseDataType> extends SmartTableDefaultColumn<T> {
|
|
107
|
+
interface SmartTableCustomColumn<T extends BaseDataType, C = any> extends SmartTableDefaultColumn<T> {
|
|
108
108
|
type: 'custom';
|
|
109
|
-
renderComponent: ComponentType<
|
|
109
|
+
renderComponent: ComponentType<C>;
|
|
110
110
|
/**
|
|
111
111
|
* @description you can set any component inputs.
|
|
112
|
-
*
|
|
113
112
|
* inputs value is not updated when changed. set once onInit.
|
|
114
|
-
*
|
|
115
113
|
* make sure to set the correct input name to prevent setInput error
|
|
116
114
|
*/
|
|
117
|
-
|
|
115
|
+
inputs?: Record<string, any>;
|
|
118
116
|
}
|
|
119
117
|
export type SmartTableEditorAndFilterTypes = 'text' | 'textarea' | 'list' | 'custom' | 'checkbox';
|
|
120
118
|
export type SmartTableEditorAndFilter = SmartTableTextEditor | SmartTableEditorList | SmartTableEditorCheckbox | SmartTableEditorCustom;
|
|
121
119
|
interface SmartTableTextEditor {
|
|
122
120
|
type: 'text' | 'textarea';
|
|
123
|
-
config?:
|
|
121
|
+
config?: {
|
|
122
|
+
placeholder?: string;
|
|
123
|
+
} & Record<string, any>;
|
|
124
124
|
}
|
|
125
125
|
interface SmartTableEditorList {
|
|
126
126
|
type: 'list';
|
|
127
127
|
config: {
|
|
128
|
+
placeholder?: string;
|
|
128
129
|
selectText?: string;
|
|
129
130
|
list: SelectOption[];
|
|
130
|
-
}
|
|
131
|
+
} & Record<string, any>;
|
|
131
132
|
}
|
|
132
133
|
interface SmartTableEditorCheckbox {
|
|
133
134
|
type: 'checkbox';
|
|
@@ -135,12 +136,20 @@ interface SmartTableEditorCheckbox {
|
|
|
135
136
|
true: any;
|
|
136
137
|
false: any;
|
|
137
138
|
resetText?: string;
|
|
138
|
-
}
|
|
139
|
+
} & Record<string, any>;
|
|
139
140
|
}
|
|
140
141
|
interface SmartTableEditorCustom {
|
|
141
142
|
type: 'custom';
|
|
142
143
|
component: any;
|
|
143
|
-
config?:
|
|
144
|
+
config?: {
|
|
145
|
+
placeholder?: string;
|
|
146
|
+
/**
|
|
147
|
+
* @description you can set any component inputs.
|
|
148
|
+
* inputs value is not updated when changed. set once onInit.
|
|
149
|
+
* make sure to set the correct input name to prevent setInput error
|
|
150
|
+
*/
|
|
151
|
+
inputs?: Record<string, any>;
|
|
152
|
+
} & Record<string, any>;
|
|
144
153
|
}
|
|
145
154
|
export interface SmartTablePagerSettings {
|
|
146
155
|
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
|
*/
|