@dataclouder/ngx-core 0.1.22 → 0.1.23
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/dataclouder-ngx-core.mjs +1111 -50
- package/fesm2022/dataclouder-ngx-core.mjs.map +1 -1
- package/lib/components/base-list/entity-base-list.component.d.ts +29 -0
- package/lib/components/forms/dc-auditable-viewer.component.d.ts +7 -0
- package/lib/components/forms/dc-extensions-viewer.component.d.ts +7 -0
- package/lib/components/forms/dc-learnable-viewer.component.d.ts +7 -0
- package/lib/components/forms/dc-manageable-viewer.component.d.ts +7 -0
- package/lib/components/forms/dc-reactions-viewer.component.d.ts +7 -0
- package/lib/components/quick-table/quick-table.d.ts +3 -2
- package/lib/models/extension.model.d.ts +29 -0
- package/lib/models/languages.model.d.ts +10 -0
- package/lib/models/pagination.abstract.d.ts +2 -2
- package/lib/services/entity-cominication.service.d.ts +17 -0
- package/package.json +1 -1
- package/public-api.d.ts +9 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OnInit, WritableSignal } from '@angular/core';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import { MenuItem } from 'primeng/api';
|
|
4
|
+
import { OnActionEvent, PaginationBase } from '../../models/pagination.abstract';
|
|
5
|
+
import { ListFilterBarOptions } from '../../models/filter.models';
|
|
6
|
+
import { EntityCommunicationService } from '../../services/entity-cominication.service';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare abstract class EntityBaseListComponent<T> extends PaginationBase implements OnInit {
|
|
9
|
+
protected router: Router;
|
|
10
|
+
protected route: ActivatedRoute;
|
|
11
|
+
protected abstract entityCommunicationService: EntityCommunicationService<T>;
|
|
12
|
+
abstract getCustomButtons(item: T): MenuItem[];
|
|
13
|
+
readonly initialViewType: import("@angular/core").InputSignal<"table" | "card">;
|
|
14
|
+
readonly onlyView: import("@angular/core").InputSignal<boolean>;
|
|
15
|
+
readonly onSelect: import("@angular/core").OutputEmitterRef<T>;
|
|
16
|
+
items: WritableSignal<T[]>;
|
|
17
|
+
viewType: WritableSignal<'table' | 'card'>;
|
|
18
|
+
totalRecordsSignal: WritableSignal<number>;
|
|
19
|
+
filterBarOptions: ListFilterBarOptions;
|
|
20
|
+
columns: any[];
|
|
21
|
+
constructor();
|
|
22
|
+
ngOnInit(): Promise<void>;
|
|
23
|
+
protected loadData(): Promise<void>;
|
|
24
|
+
onNew(): void;
|
|
25
|
+
toggleView(): void;
|
|
26
|
+
doAction(actionEvent: OnActionEvent): Promise<void>;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntityBaseListComponent<any>, never>;
|
|
28
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<EntityBaseListComponent<any>, never, never, { "initialViewType": { "alias": "initialViewType"; "required": false; "isSignal": true; }; "onlyView": { "alias": "onlyView"; "required": false; "isSignal": true; }; }, { "onSelect": "onSelect"; }, never, never, true, never>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IAuditable } from '../../models/extension.model';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DcAuditableViewerComponent {
|
|
4
|
+
data: import("@angular/core").InputSignal<IAuditable>;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DcAuditableViewerComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DcAuditableViewerComponent, "dc-auditable-viewer", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IExtensionable } from '../../models/extension.model';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DcExtensionsViewerComponent {
|
|
4
|
+
data: import("@angular/core").InputSignal<IExtensionable>;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DcExtensionsViewerComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DcExtensionsViewerComponent, "dc-extensions-viewer", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ILearnable } from '../../models/extension.model';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DcLearnableViewerComponent {
|
|
4
|
+
data: import("@angular/core").InputSignal<ILearnable>;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DcLearnableViewerComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DcLearnableViewerComponent, "dc-learnable-viewer", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IManageable } from '../../models/extension.model';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DcManageableViewerComponent {
|
|
4
|
+
data: import("@angular/core").InputSignal<IManageable>;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DcManageableViewerComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DcManageableViewerComponent, "dc-manageable-viewer", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IReactable } from '../../models/extension.model';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DcReactionsViewerComponent {
|
|
4
|
+
data: import("@angular/core").InputSignal<IReactable>;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DcReactionsViewerComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DcReactionsViewerComponent, "dc-reactions-viewer", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
7
|
+
}
|
|
@@ -11,10 +11,11 @@ export interface PColumn {
|
|
|
11
11
|
export declare class QuickTableComponent {
|
|
12
12
|
readonly columns: import("@angular/core").InputSignal<PColumn[]>;
|
|
13
13
|
readonly tableData: import("@angular/core").InputSignal<any[]>;
|
|
14
|
-
actions: MenuItem[]
|
|
14
|
+
readonly actions: import("@angular/core").InputSignal<MenuItem[]>;
|
|
15
15
|
readonly onAction: import("@angular/core").OutputEmitterRef<OnActionEvent>;
|
|
16
16
|
_columns: import("@angular/core").WritableSignal<PColumn[]>;
|
|
17
17
|
_tableData: import("@angular/core").WritableSignal<any[]>;
|
|
18
|
+
_actions: import("@angular/core").WritableSignal<MenuItem[]>;
|
|
18
19
|
filters: import("@angular/core").WritableSignal<{
|
|
19
20
|
[s: string]: FilterMetadata | FilterMetadata[];
|
|
20
21
|
}>;
|
|
@@ -30,5 +31,5 @@ export declare class QuickTableComponent {
|
|
|
30
31
|
onFilterLocal(event: any): void;
|
|
31
32
|
filterOutsideTable(type: 'tags' | 'text', column: string, value: string[]): void;
|
|
32
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<QuickTableComponent, never>;
|
|
33
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<QuickTableComponent, "app-quick-table", never, { "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "tableData": { "alias": "tableData"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; }; }, { "onAction": "onAction"; }, never, never, true, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QuickTableComponent, "app-quick-table", never, { "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "tableData": { "alias": "tableData"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; }, { "onAction": "onAction"; }, never, never, true, never>;
|
|
34
35
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type IExtensionable = Record<string, any>;
|
|
2
|
+
export interface IAuditable {
|
|
3
|
+
createdBy: string;
|
|
4
|
+
updatedBy: string;
|
|
5
|
+
authorEmail: string;
|
|
6
|
+
generatedByIA: boolean;
|
|
7
|
+
prompt?: string;
|
|
8
|
+
createdAt?: Date;
|
|
9
|
+
updatedAt?: Date;
|
|
10
|
+
}
|
|
11
|
+
export interface ILearnable {
|
|
12
|
+
level: number;
|
|
13
|
+
takenCount: number;
|
|
14
|
+
tags: string[];
|
|
15
|
+
avgRating?: number;
|
|
16
|
+
ratingsCount?: number;
|
|
17
|
+
estimatedDuration?: number;
|
|
18
|
+
successRate?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface IManageable {
|
|
21
|
+
isPublic: boolean;
|
|
22
|
+
isPublished: boolean;
|
|
23
|
+
status?: 'draft' | 'review' | 'approved' | 'published' | 'archived';
|
|
24
|
+
}
|
|
25
|
+
export interface IReactable {
|
|
26
|
+
reactionsCount?: {
|
|
27
|
+
[reactionType: string]: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -25,9 +25,9 @@ export declare abstract class PaginationBase {
|
|
|
25
25
|
*/
|
|
26
26
|
readonly onAction: import("@angular/core").OutputEmitterRef<OnActionEvent>;
|
|
27
27
|
/** Current first record index for the paginator */
|
|
28
|
-
|
|
28
|
+
first: number;
|
|
29
29
|
/** Number of rows to display per page */
|
|
30
|
-
|
|
30
|
+
rows: number;
|
|
31
31
|
/** Total number of records available */
|
|
32
32
|
totalRecords: number;
|
|
33
33
|
/** Current view mode, either cards or table */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HttpCoreService } from './http-core.service';
|
|
2
|
+
import { FiltersConfig, IFilterQueryResponse } from '../models/filter.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare abstract class EntityCommunicationService<T> {
|
|
5
|
+
private serviceName;
|
|
6
|
+
protected httpService: HttpCoreService;
|
|
7
|
+
constructor(serviceName: string);
|
|
8
|
+
findAll(): Promise<T[]>;
|
|
9
|
+
findOne(id: string): Promise<T>;
|
|
10
|
+
createOrUpdate(entity: Partial<T>): Promise<T>;
|
|
11
|
+
query(filterConfig: FiltersConfig): Promise<IFilterQueryResponse<T>>;
|
|
12
|
+
partialUpdate(id: string, partialUpdates: Partial<T>): Promise<T>;
|
|
13
|
+
remove(id: string): Promise<void>;
|
|
14
|
+
clone(id: string, overrides?: Partial<T>): Promise<T>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntityCommunicationService<any>, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EntityCommunicationService<any>>;
|
|
17
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -5,12 +5,21 @@ export * from './lib/components/progress-toast/progress-toast';
|
|
|
5
5
|
export * from './lib/components/loading-bar/loading-bar';
|
|
6
6
|
export * from './lib/components/loading-bar/loading-bar.service';
|
|
7
7
|
export * from './lib/components/quick-table/quick-table';
|
|
8
|
+
export * from './lib/components/forms/dc-auditable-viewer.component';
|
|
9
|
+
export * from './lib/components/forms/dc-extensions-viewer.component';
|
|
10
|
+
export * from './lib/components/forms/dc-learnable-viewer.component';
|
|
11
|
+
export * from './lib/components/forms/dc-manageable-viewer.component';
|
|
12
|
+
export * from './lib/components/forms/dc-reactions-viewer.component';
|
|
13
|
+
export * from './lib/components/base-list/entity-base-list.component';
|
|
8
14
|
export * from './lib/models/classes';
|
|
9
15
|
export * from './lib/models/pagination.abstract';
|
|
10
16
|
export * from './lib/models/filter.models';
|
|
11
17
|
export * from './lib/models/common-enums';
|
|
12
18
|
export * from './lib/utils/utils';
|
|
13
19
|
export * from './lib/pipes/loadash-get.pipe';
|
|
20
|
+
export * from './lib/models/extension.model';
|
|
14
21
|
export * from './lib/services/confirm.service';
|
|
15
22
|
export * from './lib/services/prompt.service';
|
|
16
23
|
export * from './lib/services/http-core.service';
|
|
24
|
+
export * from './lib/services/entity-cominication.service';
|
|
25
|
+
export * from './lib/models/languages.model';
|