@webilix/ngx-table-m3 0.0.16 → 0.0.21
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/webilix-ngx-table-m3.mjs +70 -70
- package/fesm2022/webilix-ngx-table-m3.mjs.map +1 -1
- package/index.d.ts +317 -5
- package/package.json +9 -9
- package/lib/columns/column.action.d.ts +0 -24
- package/lib/columns/column.info.d.ts +0 -9
- package/lib/columns/column.interface.d.ts +0 -44
- package/lib/columns/date/column-date.component.d.ts +0 -10
- package/lib/columns/date/column-date.interface.d.ts +0 -10
- package/lib/columns/duration/column-duration.component.d.ts +0 -10
- package/lib/columns/duration/column-duration.interface.d.ts +0 -9
- package/lib/columns/file-size/column-file-size.component.d.ts +0 -10
- package/lib/columns/file-size/column-file-size.interface.d.ts +0 -10
- package/lib/columns/index.d.ts +0 -19
- package/lib/columns/mobile/column-mobile.component.d.ts +0 -10
- package/lib/columns/mobile/column-mobile.interface.d.ts +0 -9
- package/lib/columns/number/column-number.component.d.ts +0 -10
- package/lib/columns/number/column-number.interface.d.ts +0 -9
- package/lib/columns/period/column-period.component.d.ts +0 -13
- package/lib/columns/period/column-period.interface.d.ts +0 -14
- package/lib/columns/text/column-text.component.d.ts +0 -10
- package/lib/columns/text/column-text.interface.d.ts +0 -8
- package/lib/columns/weight/column-weight.component.d.ts +0 -10
- package/lib/columns/weight/column-weight.interface.d.ts +0 -10
- package/lib/filters/date/filter-date.component.d.ts +0 -13
- package/lib/filters/date/filter-date.interface.d.ts +0 -16
- package/lib/filters/filter.component.d.ts +0 -40
- package/lib/filters/filter.info.d.ts +0 -8
- package/lib/filters/filter.interface.d.ts +0 -24
- package/lib/filters/filter.service.d.ts +0 -18
- package/lib/filters/index.d.ts +0 -12
- package/lib/filters/multi-select/filter-multi-select.component.d.ts +0 -23
- package/lib/filters/multi-select/filter-multi-select.interface.d.ts +0 -20
- package/lib/filters/number/filter-number.component.d.ts +0 -34
- package/lib/filters/number/filter-number.interface.d.ts +0 -21
- package/lib/filters/search/filter-search.component.d.ts +0 -23
- package/lib/filters/search/filter-search.interface.d.ts +0 -22
- package/lib/filters/select/filter-select.component.d.ts +0 -23
- package/lib/filters/select/filter-select.interface.d.ts +0 -20
- package/lib/ngx-table.component.d.ts +0 -35
- package/lib/ngx-table.config.d.ts +0 -19
- package/lib/ngx-table.interface.d.ts +0 -43
- package/lib/views/action/view-action.component.d.ts +0 -28
- package/lib/views/card/toolbar/view-card-toolbar.component.d.ts +0 -24
- package/lib/views/card/view-card.component.d.ts +0 -38
- package/lib/views/index.d.ts +0 -4
- package/lib/views/pagination/view-pagination.component.d.ts +0 -27
- package/lib/views/table/view-table.component.d.ts +0 -43
- package/lib/views/value/view-value.component.d.ts +0 -73
- package/lib/views/view.interface.d.ts +0 -23
- package/lib/views/view.service.d.ts +0 -30
- package/public-api.d.ts +0 -3
package/index.d.ts
CHANGED
|
@@ -1,5 +1,317 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, EnvironmentProviders, OnInit, OnChanges, EventEmitter, SimpleChanges } from '@angular/core';
|
|
3
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
4
|
+
import { NgxHelperContainerService } from '@webilix/ngx-helper-m3';
|
|
5
|
+
|
|
6
|
+
type Filter = IFilterDate | IFilterMultiSelect | IFilterNumber | IFilterSearch | IFilterSelect;
|
|
7
|
+
interface IFilter {
|
|
8
|
+
readonly filter: Filter;
|
|
9
|
+
readonly title: string;
|
|
10
|
+
readonly value?: any;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface IFilterDate {
|
|
14
|
+
readonly type: 'DATE';
|
|
15
|
+
readonly minDate?: Date;
|
|
16
|
+
readonly maxDate?: Date;
|
|
17
|
+
readonly toParam?: (value: Date) => string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface IFilterMultiSelect {
|
|
21
|
+
readonly type: 'MULTI-SELECT';
|
|
22
|
+
readonly options: {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly title: string;
|
|
25
|
+
}[];
|
|
26
|
+
readonly english?: boolean;
|
|
27
|
+
readonly maxItem?: number;
|
|
28
|
+
readonly toParam?: (value: string[]) => string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type Mode$1 = 'EQUAL' | 'GREATER' | 'LESS' | 'BETWEEN';
|
|
32
|
+
interface IFilterNumberValue {
|
|
33
|
+
readonly query: string;
|
|
34
|
+
readonly mode: Mode$1;
|
|
35
|
+
}
|
|
36
|
+
interface IFilterNumber {
|
|
37
|
+
readonly type: 'NUMBER';
|
|
38
|
+
readonly mode?: Mode$1;
|
|
39
|
+
readonly toParam?: (value: IFilterNumberValue) => string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type Mode = 'PHRASE' | 'ALL' | 'EACH';
|
|
43
|
+
interface IFilterSearchValue {
|
|
44
|
+
readonly query: string;
|
|
45
|
+
readonly mode: Mode;
|
|
46
|
+
}
|
|
47
|
+
interface IFilterSearch {
|
|
48
|
+
readonly type: 'SEARCH';
|
|
49
|
+
readonly mode?: Mode;
|
|
50
|
+
readonly english?: boolean;
|
|
51
|
+
readonly toParam?: (value: IFilterSearchValue) => string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface IFilterSelect {
|
|
55
|
+
readonly type: 'SELECT';
|
|
56
|
+
readonly options: {
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly title: string;
|
|
59
|
+
}[];
|
|
60
|
+
readonly english?: boolean;
|
|
61
|
+
readonly maxItem?: number;
|
|
62
|
+
readonly toParam?: (value: string) => string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface IColumnOrder {
|
|
66
|
+
readonly type?: 'ORDER' | 'ASC' | 'DESC';
|
|
67
|
+
readonly initial?: 'ASC' | 'DESC';
|
|
68
|
+
readonly isDefault?: boolean;
|
|
69
|
+
}
|
|
70
|
+
interface IColumn<T> {
|
|
71
|
+
readonly title: string;
|
|
72
|
+
readonly value: keyof T | ((data: T) => any);
|
|
73
|
+
readonly subValue?: keyof T | ((data: T) => string | {
|
|
74
|
+
value: string;
|
|
75
|
+
english: true;
|
|
76
|
+
} | undefined);
|
|
77
|
+
readonly english?: ((data: T) => boolean) | boolean;
|
|
78
|
+
readonly color?: string | ((data: T) => string | null | undefined);
|
|
79
|
+
readonly textAlign?: 'RIGHT' | 'CENTER' | 'LEFT';
|
|
80
|
+
readonly mode?: 'TITLE' | 'SUBTITLE';
|
|
81
|
+
readonly onClick?: (data: T) => string[] | (() => void);
|
|
82
|
+
readonly onCopy?: (data: T) => string;
|
|
83
|
+
readonly tools?: {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
readonly order: IColumnOrder;
|
|
86
|
+
} | {
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly filter: Filter;
|
|
89
|
+
} | {
|
|
90
|
+
readonly id: string;
|
|
91
|
+
readonly order: IColumnOrder;
|
|
92
|
+
readonly filter: Filter;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
interface IColumnDate<T> extends Omit<IColumn<T>, 'title' | 'english'> {
|
|
97
|
+
readonly type: 'DATE';
|
|
98
|
+
readonly title?: string;
|
|
99
|
+
readonly format?: string | 'FULL' | 'SHORT' | 'DATE' | 'TIME' | 'WEEK' | 'MONTH' | 'YEAR';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface IColumnDuration<T> extends IColumn<T> {
|
|
103
|
+
readonly type: 'DURATION';
|
|
104
|
+
readonly format?: 'FULL' | 'DAY' | 'HOUR' | 'MINUTE' | 'SECOND';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface IColumnFileSize<T> extends Omit<IColumn<T>, 'title'> {
|
|
108
|
+
readonly type: 'FILE-SIZE';
|
|
109
|
+
readonly title?: string;
|
|
110
|
+
readonly format?: 'FULL' | 'DAY' | 'HOUR' | 'MINUTE' | 'SECOND';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
interface IColumnMobile<T> extends Omit<IColumn<T>, 'title'> {
|
|
114
|
+
readonly type: 'MOBILE';
|
|
115
|
+
readonly title?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface IColumnNumber<T> extends IColumn<T> {
|
|
119
|
+
readonly type: 'NUMBER';
|
|
120
|
+
readonly fractionDigits?: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface IColumnPeriod<T> extends Omit<IColumn<T>, 'english'> {
|
|
124
|
+
readonly type: 'PERIOD';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface IColumnText<T> extends IColumn<T> {
|
|
128
|
+
readonly type: 'TEXT';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface IColumnWeight<T> extends Omit<IColumn<T>, 'title'> {
|
|
132
|
+
readonly type: 'WEIGHT';
|
|
133
|
+
readonly title?: string;
|
|
134
|
+
readonly short?: boolean;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
interface IAction<T> {
|
|
138
|
+
readonly type: 'ACTION';
|
|
139
|
+
readonly title: string;
|
|
140
|
+
readonly icon: string;
|
|
141
|
+
readonly action: (data: T) => string[] | void;
|
|
142
|
+
readonly color?: string;
|
|
143
|
+
readonly standalone?: boolean;
|
|
144
|
+
disableOn?: (data: T) => boolean;
|
|
145
|
+
hideOn?: (data: T) => boolean;
|
|
146
|
+
}
|
|
147
|
+
interface IActionUpdate<T> extends Omit<IAction<T>, 'type' | 'title' | 'icon' | 'color'> {
|
|
148
|
+
readonly type: 'UPDATE';
|
|
149
|
+
}
|
|
150
|
+
interface IActionDelete<T> extends Omit<IAction<T>, 'type' | 'title' | 'icon' | 'color'> {
|
|
151
|
+
readonly type: 'DELETE';
|
|
152
|
+
}
|
|
153
|
+
interface IActionStatus<T> extends Omit<IAction<T>, 'type' | 'title' | 'icon' | 'action' | 'color'> {
|
|
154
|
+
readonly type: 'STATUS';
|
|
155
|
+
readonly action: (data: T, active: boolean) => string[] | void;
|
|
156
|
+
readonly isDeactive: (data: T) => boolean;
|
|
157
|
+
}
|
|
158
|
+
interface IActionLog<T> extends Omit<IAction<T>, 'type' | 'title' | 'icon' | 'color'> {
|
|
159
|
+
readonly type: 'LOG';
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
type NgxTableColumn<T> = IColumnDate<T> | IColumnDuration<T> | IColumnFileSize<T> | IColumnMobile<T> | IColumnNumber<T> | IColumnPeriod<T> | IColumnText<T> | IColumnWeight<T>;
|
|
163
|
+
type NgxTableAction<T> = 'DIVIDER' | IAction<T> | IActionUpdate<T> | IActionDelete<T> | IActionStatus<T> | IActionLog<T>;
|
|
164
|
+
interface INgxTable<T> {
|
|
165
|
+
readonly route?: string[];
|
|
166
|
+
readonly type: string;
|
|
167
|
+
readonly columns: NgxTableColumn<T>[];
|
|
168
|
+
readonly rows?: {
|
|
169
|
+
readonly icon?: (data: T) => string | {
|
|
170
|
+
icon: string;
|
|
171
|
+
color: string | null | undefined;
|
|
172
|
+
};
|
|
173
|
+
readonly color?: (data: T) => string | null | undefined;
|
|
174
|
+
readonly description?: (data: T) => string | null | undefined;
|
|
175
|
+
readonly isDeactive?: (data: T) => boolean;
|
|
176
|
+
};
|
|
177
|
+
readonly actions?: NgxTableAction<T>[];
|
|
178
|
+
readonly mobileView?: boolean;
|
|
179
|
+
}
|
|
180
|
+
interface INgxTableFilter {
|
|
181
|
+
readonly page: number;
|
|
182
|
+
readonly order?: {
|
|
183
|
+
readonly id: string;
|
|
184
|
+
readonly type: 'ASC' | 'DESC';
|
|
185
|
+
readonly param: string;
|
|
186
|
+
};
|
|
187
|
+
readonly filter: {
|
|
188
|
+
[id: string]: {
|
|
189
|
+
readonly value: any;
|
|
190
|
+
readonly param: string;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
interface INgxTablePagination {
|
|
195
|
+
readonly item: {
|
|
196
|
+
readonly perPage: number;
|
|
197
|
+
readonly total: number;
|
|
198
|
+
};
|
|
199
|
+
readonly page: {
|
|
200
|
+
readonly current: number;
|
|
201
|
+
readonly total: number;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
type Filters = {
|
|
206
|
+
[key: string]: IFilter;
|
|
207
|
+
};
|
|
208
|
+
declare class FilterService {
|
|
209
|
+
private readonly activatedRoute;
|
|
210
|
+
private readonly ngxHelperContainerService;
|
|
211
|
+
constructor(activatedRoute: ActivatedRoute, ngxHelperContainerService: NgxHelperContainerService);
|
|
212
|
+
getFilters<T>(ngxTable: INgxTable<T>): Filters;
|
|
213
|
+
updateFilter(filter: IFilter, viewConfig: IViewConfig): Promise<IFilter | undefined>;
|
|
214
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FilterService, never>;
|
|
215
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FilterService>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
type OrderType = 'ASC' | 'DESC';
|
|
219
|
+
interface IOrder {
|
|
220
|
+
readonly title: string;
|
|
221
|
+
readonly type: 'ORDER' | OrderType;
|
|
222
|
+
readonly initial: OrderType;
|
|
223
|
+
readonly current?: OrderType;
|
|
224
|
+
}
|
|
225
|
+
type Orders = {
|
|
226
|
+
[key: string]: IOrder;
|
|
227
|
+
};
|
|
228
|
+
declare class ViewService {
|
|
229
|
+
private readonly activatedRoute;
|
|
230
|
+
constructor(activatedRoute: ActivatedRoute);
|
|
231
|
+
getTitleIndex<T>(ngxTable: INgxTable<T>): number;
|
|
232
|
+
getSubTitleIndex<T>(ngxTable: INgxTable<T>): number | undefined;
|
|
233
|
+
getIcons<T>(ngxTable: INgxTable<T>, data: T[]): {
|
|
234
|
+
icon: string;
|
|
235
|
+
color?: string;
|
|
236
|
+
}[];
|
|
237
|
+
getColors<T>(ngxTable: INgxTable<T>, data: T[]): string[];
|
|
238
|
+
getDescriptions<T>(ngxTable: INgxTable<T>, data: T[]): (string | undefined)[];
|
|
239
|
+
getDeactives<T>(ngxTable: INgxTable<T>, data: T[]): number[];
|
|
240
|
+
getOrders<T>(ngxTable: INgxTable<T>): Orders;
|
|
241
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ViewService, never>;
|
|
242
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ViewService>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
interface IViewConfig {
|
|
246
|
+
readonly alternateRows: boolean;
|
|
247
|
+
readonly iconSize: string;
|
|
248
|
+
readonly actionMenuTitle: string;
|
|
249
|
+
readonly stickyView?: {
|
|
250
|
+
readonly top?: {
|
|
251
|
+
readonly desktopView: string;
|
|
252
|
+
readonly mobileView: string;
|
|
253
|
+
};
|
|
254
|
+
readonly bottom?: {
|
|
255
|
+
readonly desktopView: string;
|
|
256
|
+
readonly mobileView: string;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
interface IViewOrder {
|
|
261
|
+
readonly id: string;
|
|
262
|
+
readonly type: 'ASC' | 'DESC';
|
|
263
|
+
}
|
|
264
|
+
interface IViewFilter {
|
|
265
|
+
readonly id: string;
|
|
266
|
+
readonly value: any;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
interface INgxTableConfig {
|
|
270
|
+
readonly mobileWidth: number;
|
|
271
|
+
readonly alternateRows: boolean;
|
|
272
|
+
readonly iconSize: number;
|
|
273
|
+
readonly actionMenuTitle?: string;
|
|
274
|
+
readonly stickyView: {
|
|
275
|
+
readonly top?: string | {
|
|
276
|
+
readonly desktopView: string;
|
|
277
|
+
readonly mobileView: string;
|
|
278
|
+
};
|
|
279
|
+
readonly bottom?: string | {
|
|
280
|
+
readonly desktopView: string;
|
|
281
|
+
readonly mobileView: string;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
declare const NGX_TABLE_CONFIG: InjectionToken<Partial<INgxTableConfig>>;
|
|
286
|
+
declare const provideNgxTableConfig: (config: Partial<INgxTableConfig>) => EnvironmentProviders;
|
|
287
|
+
|
|
288
|
+
declare class NgxTableComponent<T> implements OnInit, OnChanges {
|
|
289
|
+
private readonly activatedRoute;
|
|
290
|
+
private readonly router;
|
|
291
|
+
private readonly filterService;
|
|
292
|
+
private readonly viewService;
|
|
293
|
+
private readonly config?;
|
|
294
|
+
loading: boolean;
|
|
295
|
+
ngxTable: INgxTable<T>;
|
|
296
|
+
data: T[];
|
|
297
|
+
pagination?: INgxTablePagination | null;
|
|
298
|
+
filterChanged: EventEmitter<INgxTableFilter>;
|
|
299
|
+
isMobile: boolean;
|
|
300
|
+
viewConfig: IViewConfig;
|
|
301
|
+
private filter;
|
|
302
|
+
hasFilter: boolean;
|
|
303
|
+
constructor(activatedRoute: ActivatedRoute, router: Router, filterService: FilterService, viewService: ViewService, config?: Partial<INgxTableConfig> | undefined);
|
|
304
|
+
ngOnInit(): void;
|
|
305
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
306
|
+
onResize(): void;
|
|
307
|
+
setQueryParams(): void;
|
|
308
|
+
pageChanged(page: number): void;
|
|
309
|
+
orderChanged(order: IViewOrder): void;
|
|
310
|
+
filterItemChanged(filter: IViewFilter): void;
|
|
311
|
+
filterCleared(): void;
|
|
312
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxTableComponent<any>, [null, null, null, null, { optional: true; }]>;
|
|
313
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxTableComponent<any>, "ngx-table", never, { "loading": { "alias": "loading"; "required": true; }; "ngxTable": { "alias": "ngxTable"; "required": true; }; "data": { "alias": "data"; "required": true; }; "pagination": { "alias": "pagination"; "required": false; }; }, { "filterChanged": "filterChanged"; }, never, never, true, never>;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export { NGX_TABLE_CONFIG, NgxTableComponent, provideNgxTableConfig };
|
|
317
|
+
export type { INgxTable, INgxTableConfig, INgxTableFilter, INgxTablePagination, NgxTableAction, NgxTableColumn };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webilix/ngx-table-m3",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"author": "Ali Amirnezhad",
|
|
5
5
|
"description": "Responsive table view component for Angular and Material 3",
|
|
6
6
|
"repository": {
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/webilix/ngx-table-m3#readme",
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@angular/common": ">=
|
|
25
|
-
"@angular/core": ">=
|
|
26
|
-
"@angular/material": ">=
|
|
27
|
-
"@webilix/helper-library": ">=6.
|
|
28
|
-
"@webilix/jalali-date-time": ">=2.0.
|
|
29
|
-
"@webilix/ngx-calendar-m3": ">=0.0.
|
|
30
|
-
"@webilix/ngx-helper-m3": ">=0.0.
|
|
31
|
-
"ngx-mask": ">=19.0.
|
|
24
|
+
"@angular/common": ">=20.0.0",
|
|
25
|
+
"@angular/core": ">=20.0.0",
|
|
26
|
+
"@angular/material": ">=20.0.1",
|
|
27
|
+
"@webilix/helper-library": ">=6.1.3",
|
|
28
|
+
"@webilix/jalali-date-time": ">=2.0.7",
|
|
29
|
+
"@webilix/ngx-calendar-m3": ">=0.0.15",
|
|
30
|
+
"@webilix/ngx-helper-m3": ">=0.0.29",
|
|
31
|
+
"ngx-mask": ">=19.0.7"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"tslib": "^2.3.0"
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface IAction<T> {
|
|
2
|
-
readonly type: 'ACTION';
|
|
3
|
-
readonly title: string;
|
|
4
|
-
readonly icon: string;
|
|
5
|
-
readonly action: (data: T) => string[] | void;
|
|
6
|
-
readonly color?: string;
|
|
7
|
-
readonly standalone?: boolean;
|
|
8
|
-
disableOn?: (data: T) => boolean;
|
|
9
|
-
hideOn?: (data: T) => boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface IActionUpdate<T> extends Omit<IAction<T>, 'type' | 'title' | 'icon' | 'color'> {
|
|
12
|
-
readonly type: 'UPDATE';
|
|
13
|
-
}
|
|
14
|
-
export interface IActionDelete<T> extends Omit<IAction<T>, 'type' | 'title' | 'icon' | 'color'> {
|
|
15
|
-
readonly type: 'DELETE';
|
|
16
|
-
}
|
|
17
|
-
export interface IActionStatus<T> extends Omit<IAction<T>, 'type' | 'title' | 'icon' | 'action' | 'color'> {
|
|
18
|
-
readonly type: 'STATUS';
|
|
19
|
-
readonly action: (data: T, active: boolean) => string[] | void;
|
|
20
|
-
readonly isDeactive: (data: T) => boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface IActionLog<T> extends Omit<IAction<T>, 'type' | 'title' | 'icon' | 'color'> {
|
|
23
|
-
readonly type: 'LOG';
|
|
24
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ComponentType } from '@angular/cdk/portal';
|
|
2
|
-
import { NgxTableColumn } from '../ngx-table.interface';
|
|
3
|
-
import { ColumnMethods } from '.';
|
|
4
|
-
export declare const ColumnInfo: {
|
|
5
|
-
[key in NgxTableColumn<any>['type']]: {
|
|
6
|
-
readonly methods: ColumnMethods<any, any>;
|
|
7
|
-
readonly component: ComponentType<any>;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { Filter } from '../filters';
|
|
3
|
-
interface IColumnOrder {
|
|
4
|
-
readonly type?: 'ORDER' | 'ASC' | 'DESC';
|
|
5
|
-
readonly initial?: 'ASC' | 'DESC';
|
|
6
|
-
readonly isDefault?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface IColumn<T> {
|
|
9
|
-
readonly title: string;
|
|
10
|
-
readonly value: keyof T | ((data: T) => any);
|
|
11
|
-
readonly subValue?: keyof T | ((data: T) => string | {
|
|
12
|
-
value: string;
|
|
13
|
-
english: true;
|
|
14
|
-
} | undefined);
|
|
15
|
-
readonly english?: ((data: T) => boolean) | boolean;
|
|
16
|
-
readonly color?: string | ((data: T) => string | null | undefined);
|
|
17
|
-
readonly textAlign?: 'RIGHT' | 'CENTER' | 'LEFT';
|
|
18
|
-
readonly mode?: 'TITLE' | 'SUBTITLE';
|
|
19
|
-
readonly onClick?: (data: T) => string[] | (() => void);
|
|
20
|
-
readonly onCopy?: (data: T) => string;
|
|
21
|
-
readonly tools?: {
|
|
22
|
-
readonly id: string;
|
|
23
|
-
readonly order: IColumnOrder;
|
|
24
|
-
} | {
|
|
25
|
-
readonly id: string;
|
|
26
|
-
readonly filter: Filter;
|
|
27
|
-
} | {
|
|
28
|
-
readonly id: string;
|
|
29
|
-
readonly order: IColumnOrder;
|
|
30
|
-
readonly filter: Filter;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export declare abstract class ColumnMethods<C /** COLUMN **/, V /** VALUE **/> {
|
|
34
|
-
abstract column(column: C): C;
|
|
35
|
-
abstract value(value: any, column?: C): V | undefined;
|
|
36
|
-
}
|
|
37
|
-
export interface IColumnConfig {
|
|
38
|
-
readonly isEN: boolean;
|
|
39
|
-
readonly isDeactive: boolean;
|
|
40
|
-
}
|
|
41
|
-
export declare const COLUMN_TYPE: InjectionToken<any>;
|
|
42
|
-
export declare const COLUMN_CONFIG: InjectionToken<IColumnConfig>;
|
|
43
|
-
export declare const COLUMN_VALUE: InjectionToken<any>;
|
|
44
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IColumnConfig } from '../column.interface';
|
|
2
|
-
import { IColumnDate } from './column-date.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ColumnDateComponent<T> {
|
|
5
|
-
column: IColumnDate<T>;
|
|
6
|
-
value: Date;
|
|
7
|
-
config: IColumnConfig;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnDateComponent<any>, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnDateComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ColumnMethods, IColumn } from '../column.interface';
|
|
2
|
-
export interface IColumnDate<T> extends Omit<IColumn<T>, 'title' | 'english'> {
|
|
3
|
-
readonly type: 'DATE';
|
|
4
|
-
readonly title?: string;
|
|
5
|
-
readonly format?: string | 'FULL' | 'SHORT' | 'DATE' | 'TIME' | 'WEEK' | 'MONTH' | 'YEAR';
|
|
6
|
-
}
|
|
7
|
-
export declare class ColumnDateMethods<T> extends ColumnMethods<IColumnDate<T>, Date> {
|
|
8
|
-
column(column: IColumnDate<T>): IColumnDate<T>;
|
|
9
|
-
value(value: any, column?: IColumnDate<T> | undefined): Date | undefined;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IColumnConfig } from '../column.interface';
|
|
2
|
-
import { IColumnDuration } from './column-duration.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ColumnDurationComponent<T> {
|
|
5
|
-
column: IColumnDuration<T>;
|
|
6
|
-
value: number;
|
|
7
|
-
config: IColumnConfig;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnDurationComponent<any>, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnDurationComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ColumnMethods, IColumn } from '../column.interface';
|
|
2
|
-
export interface IColumnDuration<T> extends IColumn<T> {
|
|
3
|
-
readonly type: 'DURATION';
|
|
4
|
-
readonly format?: 'FULL' | 'DAY' | 'HOUR' | 'MINUTE' | 'SECOND';
|
|
5
|
-
}
|
|
6
|
-
export declare class ColumnDurationMethods<T> extends ColumnMethods<IColumnDuration<T>, number> {
|
|
7
|
-
column(column: IColumnDuration<T>): IColumnDuration<T>;
|
|
8
|
-
value(value: any, column?: IColumnDuration<T> | undefined): number | undefined;
|
|
9
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IColumnConfig } from '../column.interface';
|
|
2
|
-
import { IColumnFileSize } from './column-file-size.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ColumnFileSizeComponent<T> {
|
|
5
|
-
column: IColumnFileSize<T>;
|
|
6
|
-
value: number;
|
|
7
|
-
config: IColumnConfig;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnFileSizeComponent<any>, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnFileSizeComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ColumnMethods, IColumn } from '../column.interface';
|
|
2
|
-
export interface IColumnFileSize<T> extends Omit<IColumn<T>, 'title'> {
|
|
3
|
-
readonly type: 'FILE-SIZE';
|
|
4
|
-
readonly title?: string;
|
|
5
|
-
readonly format?: 'FULL' | 'DAY' | 'HOUR' | 'MINUTE' | 'SECOND';
|
|
6
|
-
}
|
|
7
|
-
export declare class ColumnFileSizeMethods<T> extends ColumnMethods<IColumnFileSize<T>, number> {
|
|
8
|
-
column(column: IColumnFileSize<T>): IColumnFileSize<T>;
|
|
9
|
-
value(value: any, column?: IColumnFileSize<T> | undefined): number | undefined;
|
|
10
|
-
}
|
package/lib/columns/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from './date/column-date.component';
|
|
2
|
-
export * from './date/column-date.interface';
|
|
3
|
-
export * from './duration/column-duration.component';
|
|
4
|
-
export * from './duration/column-duration.interface';
|
|
5
|
-
export * from './file-size/column-file-size.component';
|
|
6
|
-
export * from './file-size/column-file-size.interface';
|
|
7
|
-
export * from './mobile/column-mobile.component';
|
|
8
|
-
export * from './mobile/column-mobile.interface';
|
|
9
|
-
export * from './number/column-number.component';
|
|
10
|
-
export * from './number/column-number.interface';
|
|
11
|
-
export * from './period/column-period.component';
|
|
12
|
-
export * from './period/column-period.interface';
|
|
13
|
-
export * from './text/column-text.component';
|
|
14
|
-
export * from './text/column-text.interface';
|
|
15
|
-
export * from './weight/column-weight.component';
|
|
16
|
-
export * from './weight/column-weight.interface';
|
|
17
|
-
export * from './column.action';
|
|
18
|
-
export * from './column.info';
|
|
19
|
-
export * from './column.interface';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IColumnConfig } from '../column.interface';
|
|
2
|
-
import { IColumnMobile } from './column-mobile.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ColumnMobileComponent<T> {
|
|
5
|
-
column: IColumnMobile<T>;
|
|
6
|
-
value: string;
|
|
7
|
-
config: IColumnConfig;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnMobileComponent<any>, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnMobileComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ColumnMethods, IColumn } from '../column.interface';
|
|
2
|
-
export interface IColumnMobile<T> extends Omit<IColumn<T>, 'title'> {
|
|
3
|
-
readonly type: 'MOBILE';
|
|
4
|
-
readonly title?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class ColumnMobileMethods<T> extends ColumnMethods<IColumnMobile<T>, string> {
|
|
7
|
-
column(column: IColumnMobile<T>): IColumnMobile<T>;
|
|
8
|
-
value(value: any, column?: IColumnMobile<T> | undefined): string | undefined;
|
|
9
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IColumnConfig } from '../column.interface';
|
|
2
|
-
import { IColumnNumber } from './column-number.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ColumnNumberComponent<T> {
|
|
5
|
-
column: IColumnNumber<T>;
|
|
6
|
-
value: number;
|
|
7
|
-
config: IColumnConfig;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnNumberComponent<any>, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnNumberComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ColumnMethods, IColumn } from '../column.interface';
|
|
2
|
-
export interface IColumnNumber<T> extends IColumn<T> {
|
|
3
|
-
readonly type: 'NUMBER';
|
|
4
|
-
readonly fractionDigits?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare class ColumnNumberMethods<T> extends ColumnMethods<IColumnNumber<T>, number> {
|
|
7
|
-
column(column: IColumnNumber<T>): IColumnNumber<T>;
|
|
8
|
-
value(value: any, column?: IColumnNumber<T> | undefined): number | undefined;
|
|
9
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IColumnConfig } from '../column.interface';
|
|
2
|
-
import { IColumnPeriod } from './column-period.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ColumnPeriodComponent<T> {
|
|
5
|
-
column: IColumnPeriod<T>;
|
|
6
|
-
value: {
|
|
7
|
-
from: Date;
|
|
8
|
-
to: Date;
|
|
9
|
-
};
|
|
10
|
-
config: IColumnConfig;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnPeriodComponent<any>, never>;
|
|
12
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnPeriodComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ColumnMethods, IColumn } from '../column.interface';
|
|
2
|
-
export interface IColumnPeriod<T> extends Omit<IColumn<T>, 'english'> {
|
|
3
|
-
readonly type: 'PERIOD';
|
|
4
|
-
}
|
|
5
|
-
export declare class ColumnPeriodMethods<T> extends ColumnMethods<IColumnPeriod<T>, {
|
|
6
|
-
from?: Date;
|
|
7
|
-
to?: Date;
|
|
8
|
-
}> {
|
|
9
|
-
column(column: IColumnPeriod<T>): IColumnPeriod<T>;
|
|
10
|
-
value(value: any, column?: IColumnPeriod<T> | undefined): {
|
|
11
|
-
from?: Date;
|
|
12
|
-
to?: Date;
|
|
13
|
-
} | undefined;
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IColumnConfig } from '../column.interface';
|
|
2
|
-
import { IColumnText } from './column-text.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ColumnTextComponent<T> {
|
|
5
|
-
column: IColumnText<T>;
|
|
6
|
-
value: string;
|
|
7
|
-
config: IColumnConfig;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnTextComponent<any>, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnTextComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ColumnMethods, IColumn } from '../column.interface';
|
|
2
|
-
export interface IColumnText<T> extends IColumn<T> {
|
|
3
|
-
readonly type: 'TEXT';
|
|
4
|
-
}
|
|
5
|
-
export declare class ColumnTextMethods<T> extends ColumnMethods<IColumnText<T>, string> {
|
|
6
|
-
column(column: IColumnText<T>): IColumnText<T>;
|
|
7
|
-
value(value: any, column?: IColumnText<T> | undefined): string | undefined;
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IColumnConfig } from '../column.interface';
|
|
2
|
-
import { IColumnWeight } from './column-weight.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ColumnWeightComponent<T> {
|
|
5
|
-
column: IColumnWeight<T>;
|
|
6
|
-
value: number;
|
|
7
|
-
config: IColumnConfig;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnWeightComponent<any>, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnWeightComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ColumnMethods, IColumn } from '../column.interface';
|
|
2
|
-
export interface IColumnWeight<T> extends Omit<IColumn<T>, 'title'> {
|
|
3
|
-
readonly type: 'WEIGHT';
|
|
4
|
-
readonly title?: string;
|
|
5
|
-
readonly short?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare class ColumnWeightMethods<T> extends ColumnMethods<IColumnWeight<T>, number> {
|
|
8
|
-
column(column: IColumnWeight<T>): IColumnWeight<T>;
|
|
9
|
-
value(value: any, column?: IColumnWeight<T> | undefined): number | undefined;
|
|
10
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IViewConfig } from '../../views';
|
|
2
|
-
import { IFilterDate } from './filter-date.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class FilterDateComponent {
|
|
5
|
-
data: {
|
|
6
|
-
filter: IFilterDate;
|
|
7
|
-
viewConfig: IViewConfig;
|
|
8
|
-
};
|
|
9
|
-
value?: Date;
|
|
10
|
-
onChange: (value?: Date) => void;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FilterDateComponent, never>;
|
|
12
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FilterDateComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
13
|
-
}
|