lib-portal-angular 0.0.35 → 0.0.37
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/esm2022/lib/components/tables/data-paginate.service.mjs +37 -0
- package/esm2022/lib/components/tables/data-table.component.mjs +43 -26
- package/esm2022/lib/lib-portal-angular.module.mjs +6 -3
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/lib-portal-angular.mjs +82 -29
- package/fesm2022/lib-portal-angular.mjs.map +1 -1
- package/lib/components/tables/data-paginate.service.d.ts +21 -0
- package/lib/components/tables/data-table.component.d.ts +10 -8
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
2
|
+
import { Observable } from 'rxjs';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export interface IDataIndexPaginate {
|
5
|
+
descricao?: string;
|
6
|
+
pageNumber: number;
|
7
|
+
pageSize: number;
|
8
|
+
sortColumn: string;
|
9
|
+
sortDirection: 'asc' | 'desc';
|
10
|
+
}
|
11
|
+
export interface IPaginateResult<T> {
|
12
|
+
items: T[];
|
13
|
+
totalItems: number;
|
14
|
+
}
|
15
|
+
export declare class DataPaginateService {
|
16
|
+
private http;
|
17
|
+
constructor(http: HttpClient);
|
18
|
+
fetchData<T>(url: string, params: IDataIndexPaginate): Observable<IPaginateResult<T>>;
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataPaginateService, never>;
|
20
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DataPaginateService>;
|
21
|
+
}
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import { ChangeDetectorRef, EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
2
|
+
import { Observable } from 'rxjs';
|
3
|
+
import { IDataIndexPaginate, IPaginateResult } from './data-paginate.service';
|
2
4
|
import * as i0 from "@angular/core";
|
3
5
|
export declare class DataTableComponent implements OnInit, OnChanges {
|
4
6
|
private cdr;
|
5
7
|
columns: any[];
|
6
|
-
|
8
|
+
hiddenColumns: string[];
|
7
9
|
itemsPerPageOptions: number[];
|
8
10
|
defaultItemsPerPage: number;
|
9
11
|
itemsPerPageLabel: string;
|
@@ -16,10 +18,7 @@ export declare class DataTableComponent implements OnInit, OnChanges {
|
|
16
18
|
totalItems: number;
|
17
19
|
tableFontColor: string;
|
18
20
|
tableFontSize: string;
|
19
|
-
fetchDataFunction: (
|
20
|
-
items: any[];
|
21
|
-
totalItems: number;
|
22
|
-
}>;
|
21
|
+
fetchDataFunction: (params: IDataIndexPaginate) => Observable<IPaginateResult<any>>;
|
23
22
|
editPermissions: string[];
|
24
23
|
deletePermissions: string[];
|
25
24
|
viewPermissions: string[];
|
@@ -34,6 +33,8 @@ export declare class DataTableComponent implements OnInit, OnChanges {
|
|
34
33
|
onDeleteTable: EventEmitter<any>;
|
35
34
|
onViewTable: EventEmitter<any>;
|
36
35
|
currentPage: number;
|
36
|
+
sortColumn: string;
|
37
|
+
sortDirection: 'asc' | 'desc';
|
37
38
|
pagedData: any[];
|
38
39
|
isLoading: boolean;
|
39
40
|
labelStyle: {
|
@@ -45,12 +46,13 @@ export declare class DataTableComponent implements OnInit, OnChanges {
|
|
45
46
|
ngOnInit(): void;
|
46
47
|
ngOnChanges(changes: SimpleChanges): void;
|
47
48
|
setDefaultPermissions(): void;
|
48
|
-
fetchData():
|
49
|
+
fetchData(): void;
|
49
50
|
onSort(column: string): void;
|
50
51
|
onPageChange(page: number): void;
|
51
|
-
onItemsPerPageChange(
|
52
|
+
onItemsPerPageChange(): void;
|
52
53
|
handleAction(action: string, item: any, index: number): void;
|
53
54
|
hasPermission(requiredPermissions: string[]): boolean;
|
55
|
+
isColumnHidden(columnProp: string): boolean;
|
54
56
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataTableComponent, never>;
|
55
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DataTableComponent, "sim-data-table", never, { "columns": { "alias": "columns"; "required": false; }; "
|
57
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DataTableComponent, "sim-data-table", never, { "columns": { "alias": "columns"; "required": false; }; "hiddenColumns": { "alias": "hiddenColumns"; "required": false; }; "itemsPerPageOptions": { "alias": "itemsPerPageOptions"; "required": false; }; "defaultItemsPerPage": { "alias": "defaultItemsPerPage"; "required": false; }; "itemsPerPageLabel": { "alias": "itemsPerPageLabel"; "required": false; }; "marginTop": { "alias": "marginTop"; "required": false; }; "marginBottom": { "alias": "marginBottom"; "required": false; }; "marginLeft": { "alias": "marginLeft"; "required": false; }; "marginRight": { "alias": "marginRight"; "required": false; }; "showActionColumn": { "alias": "showActionColumn"; "required": false; }; "actionColumnLabel": { "alias": "actionColumnLabel"; "required": false; }; "totalItems": { "alias": "totalItems"; "required": false; }; "tableFontColor": { "alias": "tableFontColor"; "required": false; }; "tableFontSize": { "alias": "tableFontSize"; "required": false; }; "fetchDataFunction": { "alias": "fetchDataFunction"; "required": false; }; "editPermissions": { "alias": "editPermissions"; "required": false; }; "deletePermissions": { "alias": "deletePermissions"; "required": false; }; "viewPermissions": { "alias": "viewPermissions"; "required": false; }; "userPermissions": { "alias": "userPermissions"; "required": false; }; "showPageInfo": { "alias": "showPageInfo"; "required": false; }; "pageText": { "alias": "pageText"; "required": false; }; "ofText": { "alias": "ofText"; "required": false; }; }, { "sortChange": "sortChange"; "pageChange": "pageChange"; "itemsPerPageChange": "itemsPerPageChange"; "onEditTable": "onEditTable"; "onDeleteTable": "onDeleteTable"; "onViewTable": "onViewTable"; }, never, never, false, never>;
|
56
58
|
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
@@ -19,3 +19,4 @@ export * from './lib/components/components.module';
|
|
19
19
|
export * from './lib/lib-portal-angular.module';
|
20
20
|
export * from './lib/components/alert/notification.service';
|
21
21
|
export * from './lib/components/confirmation/confirmation.service';
|
22
|
+
export * from './lib/components/tables/data-paginate.service';
|