kitsng-table-factory 0.3.18
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/README.md +24 -0
- package/esm2022/kitsng-table-factory.mjs +5 -0
- package/esm2022/lib/kitsng-filter/kitsng-filter/kitsng-filter.component.mjs +206 -0
- package/esm2022/lib/kitsng-filter/kitsng-filter.module.mjs +65 -0
- package/esm2022/lib/kitsng-filter/lookup-list.service.mjs +132 -0
- package/esm2022/lib/kitsng-filter/lookup-select/lookup-select.component.mjs +349 -0
- package/esm2022/lib/kitsng-filter/lookup-select/lookup-select.module.mjs +43 -0
- package/esm2022/lib/kitsng-filter/overlay.service.mjs +30 -0
- package/esm2022/lib/kitsng-search/kitsng-search.component.mjs +39 -0
- package/esm2022/lib/kitsng-table-factory/components/kitsng-fetch-table-factory/kitsng-fetch-table-factory.component.mjs +578 -0
- package/esm2022/lib/kitsng-table-factory/components/kitsng-table-factory/kitsng-table-factory.component.mjs +359 -0
- package/esm2022/lib/kitsng-table-factory/components/kitsng-tree-table-factory/kitsng-tree-table-factory.component.mjs +587 -0
- package/esm2022/lib/kitsng-table-factory/core/models/kitsng-table.model.mjs +2 -0
- package/esm2022/lib/kitsng-table-factory/core/models/pipe-config.model.mjs +2 -0
- package/esm2022/lib/kitsng-table-factory/core/pipes/dynamic.pipe.mjs +40 -0
- package/esm2022/lib/kitsng-table-factory/core/services/api.service.mjs +108 -0
- package/esm2022/lib/kitsng-table-factory/kitsng-table-factory.module.mjs +54 -0
- package/esm2022/public-api.mjs +14 -0
- package/fesm2022/kitsng-table-factory.mjs +2516 -0
- package/fesm2022/kitsng-table-factory.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/kitsng-filter/kitsng-filter/kitsng-filter.component.d.ts +46 -0
- package/lib/kitsng-filter/kitsng-filter.module.d.ts +19 -0
- package/lib/kitsng-filter/lookup-list.service.d.ts +23 -0
- package/lib/kitsng-filter/lookup-select/lookup-select.component.d.ts +72 -0
- package/lib/kitsng-filter/lookup-select/lookup-select.module.d.ts +13 -0
- package/lib/kitsng-filter/overlay.service.d.ts +7 -0
- package/lib/kitsng-search/kitsng-search.component.d.ts +13 -0
- package/lib/kitsng-table-factory/components/kitsng-fetch-table-factory/kitsng-fetch-table-factory.component.d.ts +23 -0
- package/lib/kitsng-table-factory/components/kitsng-table-factory/kitsng-table-factory.component.d.ts +10 -0
- package/lib/kitsng-table-factory/components/kitsng-tree-table-factory/kitsng-tree-table-factory.component.d.ts +30 -0
- package/lib/kitsng-table-factory/core/models/kitsng-table.model.d.ts +120 -0
- package/lib/kitsng-table-factory/core/models/pipe-config.model.d.ts +5 -0
- package/lib/kitsng-table-factory/core/pipes/dynamic.pipe.d.ts +11 -0
- package/lib/kitsng-table-factory/core/services/api.service.d.ts +63 -0
- package/lib/kitsng-table-factory/kitsng-table-factory.module.d.ts +17 -0
- package/package.json +29 -0
- package/public-api.d.ts +9 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { KitsngTableConfig } from "../../core/models/kitsng-table.model";
|
|
3
|
+
import { Observable, Subject } from "rxjs";
|
|
4
|
+
import { ApiService } from "../../core/services/api.service";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class KitsngFetchTableFactoryComponent implements OnInit, OnDestroy {
|
|
7
|
+
private apiService;
|
|
8
|
+
tableConfig: KitsngTableConfig;
|
|
9
|
+
_getData: Subject<void>;
|
|
10
|
+
getData$: Observable<void>;
|
|
11
|
+
destroy$: Subject<boolean>;
|
|
12
|
+
constructor(apiService: ApiService);
|
|
13
|
+
ngOnInit(): void;
|
|
14
|
+
getNestedValue(data: any, field: string): any;
|
|
15
|
+
resolveActionProperty(property: any, item: any): any;
|
|
16
|
+
onSelectChange(event: any): void;
|
|
17
|
+
subscribeToData(): void;
|
|
18
|
+
customSort(sort: any): void;
|
|
19
|
+
pageChanged(event: any): void;
|
|
20
|
+
ngOnDestroy(): void;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KitsngFetchTableFactoryComponent, never>;
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KitsngFetchTableFactoryComponent, "kitsng-fetch-table-factory", never, { "tableConfig": { "alias": "tableConfig"; "required": true; }; }, {}, never, never, false, never>;
|
|
23
|
+
}
|
package/lib/kitsng-table-factory/components/kitsng-table-factory/kitsng-table-factory.component.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { KitsngTableConfig } from '../../core/models/kitsng-table.model';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class KitsngTableFactoryComponent {
|
|
4
|
+
tableConfig: KitsngTableConfig;
|
|
5
|
+
getNestedValue(data: any, field: string): any;
|
|
6
|
+
resolveActionProperty(property: any, item: any): any;
|
|
7
|
+
onSelectChange(event: any): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KitsngTableFactoryComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KitsngTableFactoryComponent, "kitsng-table-factory", never, { "tableConfig": { "alias": "tableConfig"; "required": true; }; }, {}, never, never, false, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChangeDetectorRef, OnInit } from "@angular/core";
|
|
2
|
+
import { KitsngTableConfig } from "../../core/models/kitsng-table.model";
|
|
3
|
+
import { Observable, Subject } from "rxjs";
|
|
4
|
+
import { TreeNode } from "primeng/api";
|
|
5
|
+
import { ApiService } from "../../core/services/api.service";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class KitsngTreeTableFactoryComponent implements OnInit {
|
|
8
|
+
private apiService;
|
|
9
|
+
private cd;
|
|
10
|
+
tableConfig: KitsngTableConfig;
|
|
11
|
+
_getData: Subject<void>;
|
|
12
|
+
getData$: Observable<void>;
|
|
13
|
+
treeData: TreeNode[];
|
|
14
|
+
loading: boolean;
|
|
15
|
+
destroy$: Subject<boolean>;
|
|
16
|
+
constructor(apiService: ApiService, cd: ChangeDetectorRef);
|
|
17
|
+
ngOnInit(): void;
|
|
18
|
+
getNestedValue(data: any, field: string): any;
|
|
19
|
+
resolveActionProperty(property: any, item: any): any;
|
|
20
|
+
onSelectChange(event: any): void;
|
|
21
|
+
subscribeToData(): void;
|
|
22
|
+
convertToTreeData(data: any[]): TreeNode[];
|
|
23
|
+
convertToTreeDataWithChildren(item: any): TreeNode;
|
|
24
|
+
loadNodeChildren(node: TreeNode): void;
|
|
25
|
+
customSort(sort: any): void;
|
|
26
|
+
pageChanged(event: any): void;
|
|
27
|
+
ngOnDestroy(): void;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KitsngTreeTableFactoryComponent, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KitsngTreeTableFactoryComponent, "kitsng-tree-table-factory", never, { "tableConfig": { "alias": "tableConfig"; "required": true; }; }, {}, never, never, false, never>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { TemplateRef } from "@angular/core";
|
|
2
|
+
import { KitsngPipeConfig } from "./pipe-config.model";
|
|
3
|
+
import { Subject } from "rxjs";
|
|
4
|
+
export interface KitsngColumnOption {
|
|
5
|
+
field: string;
|
|
6
|
+
header: string;
|
|
7
|
+
sortable?: boolean;
|
|
8
|
+
type?: "text" | "image" | "severity" | "rating";
|
|
9
|
+
template?: TemplateRef<any>;
|
|
10
|
+
pipes?: KitsngPipeConfig[];
|
|
11
|
+
headerCellClass?: string;
|
|
12
|
+
headerCellStyle?: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
bodyCellClass?: string;
|
|
16
|
+
bodyCellStyle?: {
|
|
17
|
+
[key: string]: string;
|
|
18
|
+
};
|
|
19
|
+
additionalData?: any;
|
|
20
|
+
isFrozen?: boolean;
|
|
21
|
+
alignFrozen?: "right" | "left";
|
|
22
|
+
}
|
|
23
|
+
export interface KitsngTableConfig {
|
|
24
|
+
columns: KitsngColumnOption[];
|
|
25
|
+
data: any[];
|
|
26
|
+
selectedItems?: any[];
|
|
27
|
+
onSelectedItems?(event: any): void;
|
|
28
|
+
rowHover?: boolean;
|
|
29
|
+
first?: number;
|
|
30
|
+
totalRecords?: number;
|
|
31
|
+
pageSize?: number;
|
|
32
|
+
pageIndex?: number;
|
|
33
|
+
rowsPerPageOptions?: any;
|
|
34
|
+
tableStyle?: {
|
|
35
|
+
[key: string]: string;
|
|
36
|
+
};
|
|
37
|
+
currentPageReportTemplate?: string;
|
|
38
|
+
onPageChanged?(event: any): void;
|
|
39
|
+
onSorting?(event: any): void;
|
|
40
|
+
actionButtons?: KitsngTabelAction[];
|
|
41
|
+
actionTemplate?: TemplateRef<any>;
|
|
42
|
+
actionCellHeaderStyle?: {
|
|
43
|
+
[key: string]: string;
|
|
44
|
+
};
|
|
45
|
+
actionCellBodyStyle?: {
|
|
46
|
+
[key: string]: string;
|
|
47
|
+
};
|
|
48
|
+
actionIsFrozen?: boolean;
|
|
49
|
+
actionAlignFrozen?: "right" | "left";
|
|
50
|
+
showSelectionCheckbox?: boolean;
|
|
51
|
+
emptymessage?: string;
|
|
52
|
+
paginatorClass?: string;
|
|
53
|
+
containerClass?: string;
|
|
54
|
+
class?: string;
|
|
55
|
+
showPaginator?: boolean;
|
|
56
|
+
showClientPaginator?: boolean;
|
|
57
|
+
emptymessageTemplate?: TemplateRef<any>;
|
|
58
|
+
fetchApiInfo?: KitsngFetchApiInfo;
|
|
59
|
+
resizableColumns?: boolean;
|
|
60
|
+
scrollable?: boolean;
|
|
61
|
+
headerTemplate?: TemplateRef<any>;
|
|
62
|
+
bodyTemplate?: TemplateRef<any>;
|
|
63
|
+
summaryTemplate?: TemplateRef<any>;
|
|
64
|
+
footerTemplate?: TemplateRef<any>;
|
|
65
|
+
captionTemplate?: TemplateRef<any>;
|
|
66
|
+
tableTemplate?: TemplateRef<any>;
|
|
67
|
+
treeNodeChildrenFilterKey?: string;
|
|
68
|
+
treeNodeChildrenFilterValue?: string;
|
|
69
|
+
treeNodeChildrenFilters?: any;
|
|
70
|
+
treeShowLoader?: boolean;
|
|
71
|
+
treeLazyLoad?: boolean;
|
|
72
|
+
treeChildrenKeyName?: string;
|
|
73
|
+
treeStyle?: {
|
|
74
|
+
[key: string]: string;
|
|
75
|
+
};
|
|
76
|
+
treeClass?: string;
|
|
77
|
+
stripedRows?: boolean;
|
|
78
|
+
showGridlines?: boolean;
|
|
79
|
+
dataKey?: string;
|
|
80
|
+
tableLayout?: "auto" | "fixed";
|
|
81
|
+
}
|
|
82
|
+
export interface KitsngTabelAction {
|
|
83
|
+
id?: string | ((item: any) => string);
|
|
84
|
+
icon?: string | ((item: any) => string);
|
|
85
|
+
iconPos?: 'left' | 'right' | 'top' | 'bottom' | ((item: any) => string);
|
|
86
|
+
label?: string | ((item: any) => string);
|
|
87
|
+
onClick?(event: any): void;
|
|
88
|
+
buttonClass?: string | ((item: any) => string);
|
|
89
|
+
colorClass?: string | ((item: any) => string);
|
|
90
|
+
tooltip?: string | ((item: any) => string);
|
|
91
|
+
tooltipPosition?: 'top' | 'bottom' | 'left' | 'right';
|
|
92
|
+
type?: "Edit" | "Delete" | "View";
|
|
93
|
+
template?: TemplateRef<any>;
|
|
94
|
+
disabled?: boolean | ((item: any) => boolean);
|
|
95
|
+
isVisible?: boolean | ((item: any) => boolean);
|
|
96
|
+
hidden?: boolean | ((item: any) => boolean);
|
|
97
|
+
severity?: "success" | "info" | "warning" | "danger" | "help" | "primary" | "secondary" | "contrast" | ((item: any) => string);
|
|
98
|
+
rounded?: boolean | ((item: any) => boolean);
|
|
99
|
+
outlined?: boolean | ((item: any) => boolean);
|
|
100
|
+
text?: boolean | ((item: any) => boolean);
|
|
101
|
+
raised?: boolean | ((item: any) => boolean);
|
|
102
|
+
plain?: boolean | ((item: any) => boolean);
|
|
103
|
+
size?: "small" | "large" | ((item: any) => string);
|
|
104
|
+
badge?: string | ((item: any) => string);
|
|
105
|
+
badgeClass?: string | ((item: any) => string);
|
|
106
|
+
}
|
|
107
|
+
export interface KitsngFetchApiInfo {
|
|
108
|
+
module: string;
|
|
109
|
+
entity: string;
|
|
110
|
+
baseUri?: string;
|
|
111
|
+
version?: string;
|
|
112
|
+
path?: string;
|
|
113
|
+
filters?: any;
|
|
114
|
+
orders?: any;
|
|
115
|
+
searchWord?: any;
|
|
116
|
+
_getData?: Subject<void>;
|
|
117
|
+
onDataLoaded?(data: any, pageInfo: any): void;
|
|
118
|
+
onFetchDataError?(error: any): void;
|
|
119
|
+
queryMapper?(query: any): any;
|
|
120
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Injector, PipeTransform } from "@angular/core";
|
|
2
|
+
import { KitsngPipeConfig } from "../models/pipe-config.model";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class DynamicPipe implements PipeTransform {
|
|
5
|
+
private injector;
|
|
6
|
+
constructor(injector: Injector);
|
|
7
|
+
transform(value: any, pipes: KitsngPipeConfig[]): any;
|
|
8
|
+
private applyPipe;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicPipe, never>;
|
|
10
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<DynamicPipe, "dynamicPipe", false>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { HttpClient } from "@angular/common/http";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
interface PageInfo {
|
|
5
|
+
totalPages: number;
|
|
6
|
+
totalItems: number;
|
|
7
|
+
pageIndex: number;
|
|
8
|
+
pageSize: number;
|
|
9
|
+
}
|
|
10
|
+
interface ApiListDto<Type> {
|
|
11
|
+
items: Type[];
|
|
12
|
+
pageInfo: PageInfo;
|
|
13
|
+
page?: PageInfo;
|
|
14
|
+
}
|
|
15
|
+
declare enum SanedFilterConditionValue {
|
|
16
|
+
Equal = 0,
|
|
17
|
+
GreaterThan = 1,
|
|
18
|
+
GreaterThanOrEqual = 2,
|
|
19
|
+
IN = 3,
|
|
20
|
+
LessThen = 4,
|
|
21
|
+
LessThenorEqual = 5,
|
|
22
|
+
NotEqual = 6,
|
|
23
|
+
NotIN = 7,
|
|
24
|
+
REGEX = 8
|
|
25
|
+
}
|
|
26
|
+
interface FilterValue {
|
|
27
|
+
value: any;
|
|
28
|
+
level?: number;
|
|
29
|
+
conOp?: SanedFilterConditionValue;
|
|
30
|
+
logOp?: number;
|
|
31
|
+
}
|
|
32
|
+
interface ApiQueryDto {
|
|
33
|
+
pageSize?: number;
|
|
34
|
+
pageIndex?: number;
|
|
35
|
+
search?: string;
|
|
36
|
+
filters?: {
|
|
37
|
+
[key: string]: FilterValue;
|
|
38
|
+
};
|
|
39
|
+
orders?: OrderQuery;
|
|
40
|
+
}
|
|
41
|
+
interface OrderQuery {
|
|
42
|
+
[key: string]: 0 | 1;
|
|
43
|
+
}
|
|
44
|
+
export declare class ApiService<T = any> {
|
|
45
|
+
private _httpClient;
|
|
46
|
+
private baseUrl;
|
|
47
|
+
private baseUri;
|
|
48
|
+
private module;
|
|
49
|
+
private entity;
|
|
50
|
+
private path;
|
|
51
|
+
private version;
|
|
52
|
+
/**
|
|
53
|
+
* Constructor
|
|
54
|
+
*/
|
|
55
|
+
constructor(_httpClient: HttpClient);
|
|
56
|
+
_initService(module: string, entity: string, version?: string, baseUri?: string, path?: string): void;
|
|
57
|
+
_initBaseUrl(): void;
|
|
58
|
+
getPaged(query: ApiQueryDto): Observable<ApiListDto<T>>;
|
|
59
|
+
private checkResponseStatus;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApiService<any>, never>;
|
|
61
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ApiService<any>>;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./components/kitsng-table-factory/kitsng-table-factory.component";
|
|
3
|
+
import * as i2 from "./core/pipes/dynamic.pipe";
|
|
4
|
+
import * as i3 from "./components/kitsng-fetch-table-factory/kitsng-fetch-table-factory.component";
|
|
5
|
+
import * as i4 from "./components/kitsng-tree-table-factory/kitsng-tree-table-factory.component";
|
|
6
|
+
import * as i5 from "@angular/common";
|
|
7
|
+
import * as i6 from "primeng/table";
|
|
8
|
+
import * as i7 from "primeng/paginator";
|
|
9
|
+
import * as i8 from "primeng/button";
|
|
10
|
+
import * as i9 from "primeng/tooltip";
|
|
11
|
+
import * as i10 from "primeng/treetable";
|
|
12
|
+
import * as i11 from "@ngx-translate/core";
|
|
13
|
+
export declare class KitsngTableFactoryModule {
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KitsngTableFactoryModule, never>;
|
|
15
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<KitsngTableFactoryModule, [typeof i1.KitsngTableFactoryComponent, typeof i2.DynamicPipe, typeof i3.KitsngFetchTableFactoryComponent, typeof i4.KitsngTreeTableFactoryComponent], [typeof i5.CommonModule, typeof i6.TableModule, typeof i7.PaginatorModule, typeof i8.ButtonModule, typeof i9.TooltipModule, typeof i10.TreeTableModule, typeof i11.TranslatePipe], [typeof i1.KitsngTableFactoryComponent, typeof i3.KitsngFetchTableFactoryComponent, typeof i4.KitsngTreeTableFactoryComponent]>;
|
|
16
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<KitsngTableFactoryModule>;
|
|
17
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kitsng-table-factory",
|
|
3
|
+
"version": "0.3.18",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^18.2.6",
|
|
6
|
+
"@angular/core": "^18.2.6",
|
|
7
|
+
"@ngx-translate/core": "^17.0.0",
|
|
8
|
+
"primeicons": "^7.0.0",
|
|
9
|
+
"primeng": "^17.18.11",
|
|
10
|
+
"lodash": "^4.17.21"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"tslib": "^2.3.0"
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"module": "fesm2022/kitsng-table-factory.mjs",
|
|
17
|
+
"typings": "index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
"./package.json": {
|
|
20
|
+
"default": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./index.d.ts",
|
|
24
|
+
"esm2022": "./esm2022/kitsng-table-factory.mjs",
|
|
25
|
+
"esm": "./esm2022/kitsng-table-factory.mjs",
|
|
26
|
+
"default": "./fesm2022/kitsng-table-factory.mjs"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './lib/kitsng-table-factory/core/models/kitsng-table.model';
|
|
2
|
+
export * from './lib/kitsng-table-factory/core/models/pipe-config.model';
|
|
3
|
+
export * from './lib/kitsng-table-factory/components/kitsng-table-factory/kitsng-table-factory.component';
|
|
4
|
+
export * from './lib/kitsng-table-factory/components/kitsng-fetch-table-factory/kitsng-fetch-table-factory.component';
|
|
5
|
+
export * from './lib/kitsng-table-factory/components/kitsng-tree-table-factory/kitsng-tree-table-factory.component';
|
|
6
|
+
export * from './lib/kitsng-table-factory/kitsng-table-factory.module';
|
|
7
|
+
export * from './lib/kitsng-search/kitsng-search.component';
|
|
8
|
+
export * from './lib/kitsng-filter/kitsng-filter/kitsng-filter.component';
|
|
9
|
+
export * from './lib/kitsng-filter/kitsng-filter.module';
|