@rosoftlab/core 1.0.4-alpha-14 → 1.0.5-alpha-2
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/rosoftlab-core.mjs +334 -29
- package/fesm2022/rosoftlab-core.mjs.map +1 -1
- package/lib/base-components/base-crud-implementation.d.ts +44 -0
- package/lib/base-components/base-table-implementation.d.ts +56 -0
- package/lib/core.d.ts +5 -0
- package/lib/interfaces/dialog.interface.d.ts +9 -0
- package/lib/models/role.d.ts +1 -0
- package/lib/services/right.service.d.ts +8 -0
- package/lib/services/role.service.d.ts +3 -1
- package/lib/tokens/table-tokens.d.ts +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Location } from '@angular/common';
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
4
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare abstract class BaseCrudImplementation<T = any> {
|
|
8
|
+
protected router: Router;
|
|
9
|
+
protected route: ActivatedRoute;
|
|
10
|
+
protected translate: TranslateService;
|
|
11
|
+
protected location: Location;
|
|
12
|
+
protected modelService: import("@rosoftlab/core").BaseService<import("@rosoftlab/core").BaseModel>;
|
|
13
|
+
protected modelToken: import("@angular/core").Type<import("@rosoftlab/core").BaseModel>;
|
|
14
|
+
protected dialogService: import("../interfaces/dialog.interface").IDialogService;
|
|
15
|
+
model: T | null;
|
|
16
|
+
modelName: string | null;
|
|
17
|
+
dictPath: string | null;
|
|
18
|
+
fileLayout: string;
|
|
19
|
+
idProperty: string;
|
|
20
|
+
customInclude: string;
|
|
21
|
+
changeUrlRoute: boolean;
|
|
22
|
+
hostClass: string;
|
|
23
|
+
basePath: string;
|
|
24
|
+
title: string;
|
|
25
|
+
protected baseForm: FormGroup<{}>;
|
|
26
|
+
protected modelId: string;
|
|
27
|
+
protected isEdit: boolean;
|
|
28
|
+
protected isLoading: boolean;
|
|
29
|
+
protected cancelRoute: string;
|
|
30
|
+
protected editRoute: string;
|
|
31
|
+
ngOnInit(): void;
|
|
32
|
+
get hostClasses(): string;
|
|
33
|
+
afterSave(model: T): Observable<T>;
|
|
34
|
+
beforeSave(model: T): Observable<T>;
|
|
35
|
+
protected getFromGroup(formGroup?: FormGroup | string): FormGroup;
|
|
36
|
+
validateAllFormFields(formGroup?: FormGroup | string): void;
|
|
37
|
+
canDeactivate(): Observable<boolean> | boolean;
|
|
38
|
+
getFiledName(filedTranslationKey: string): {
|
|
39
|
+
field: any;
|
|
40
|
+
};
|
|
41
|
+
serverErrors(err: any): void;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseCrudImplementation<any>, never>;
|
|
43
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseCrudImplementation<any>, never, never, { "model": { "alias": "model"; "required": false; }; "modelName": { "alias": "modelName"; "required": false; }; "dictPath": { "alias": "dictPath"; "required": false; }; "fileLayout": { "alias": "fileLayout"; "required": false; }; "idProperty": { "alias": "idProperty"; "required": false; }; "customInclude": { "alias": "customInclude"; "required": false; }; "changeUrlRoute": { "alias": "changeUrlRoute"; "required": false; }; "hostClass": { "alias": "hostClass"; "required": false; }; }, {}, never, never, true, never>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
4
|
+
import { Rule } from '../models/rule';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare abstract class BaseTableImplementation<T = any, TEditArgs = any, TRemoveArgs = any> implements OnInit {
|
|
7
|
+
protected router: Router;
|
|
8
|
+
protected translate: TranslateService;
|
|
9
|
+
protected dataService: import("@rosoftlab/core").BaseService<import("@rosoftlab/core").BaseModel>;
|
|
10
|
+
protected modelToken: import("@angular/core").Type<import("@rosoftlab/core").BaseModel>;
|
|
11
|
+
protected dialogService: import("../interfaces/dialog.interface").IDialogService;
|
|
12
|
+
basePath: string;
|
|
13
|
+
title: string;
|
|
14
|
+
model: T | null;
|
|
15
|
+
dictPath: string | null;
|
|
16
|
+
fileLayout: string;
|
|
17
|
+
idProperty: string;
|
|
18
|
+
showHeader: boolean;
|
|
19
|
+
showSearch: boolean;
|
|
20
|
+
searchFields: string[] | null;
|
|
21
|
+
pageable: boolean;
|
|
22
|
+
pageSizes: number[];
|
|
23
|
+
defaultSort: string | null;
|
|
24
|
+
defaultSortDirection: 'asc' | 'desc' | null;
|
|
25
|
+
defaultFilter: any;
|
|
26
|
+
customInclude: string;
|
|
27
|
+
hasAdd: boolean;
|
|
28
|
+
canDelete: boolean;
|
|
29
|
+
canEdit: boolean;
|
|
30
|
+
deletePropertyName: string;
|
|
31
|
+
deleteDisableRule: Rule[];
|
|
32
|
+
editOnClick: boolean;
|
|
33
|
+
editOnDblClick: boolean;
|
|
34
|
+
editColumn: string | null;
|
|
35
|
+
useView: boolean;
|
|
36
|
+
hostClass: string;
|
|
37
|
+
ngOnInit(): void;
|
|
38
|
+
get hostClasses(): string;
|
|
39
|
+
abstract loadData(): void;
|
|
40
|
+
protected addHandler(): void;
|
|
41
|
+
abstract editHandler(args: TEditArgs): void;
|
|
42
|
+
protected edit(dataItem: any, column?: any): void;
|
|
43
|
+
/**
|
|
44
|
+
* Abstract contract for removing items.
|
|
45
|
+
* TRemoveArgs allows Kendo to use RemoveEvent, while others might use a simple ID.
|
|
46
|
+
*/
|
|
47
|
+
abstract removeHandler(args: TRemoveArgs): void;
|
|
48
|
+
/**
|
|
49
|
+
* Shared delete logic that can be called by any implementation
|
|
50
|
+
*/
|
|
51
|
+
protected delete(dataItem: any): void;
|
|
52
|
+
abstract performDelete(id: any): void;
|
|
53
|
+
abstract getCellValue(item: any, column: any): any;
|
|
54
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseTableImplementation<any, any, any>, never>;
|
|
55
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseTableImplementation<any, any, any>, never, never, { "model": { "alias": "model"; "required": false; }; "dictPath": { "alias": "dictPath"; "required": false; }; "fileLayout": { "alias": "fileLayout"; "required": false; }; "idProperty": { "alias": "idProperty"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "showSearch": { "alias": "showSearch"; "required": false; }; "searchFields": { "alias": "searchFields"; "required": false; }; "pageable": { "alias": "pageable"; "required": false; }; "pageSizes": { "alias": "pageSizes"; "required": false; }; "defaultSort": { "alias": "defaultSort"; "required": false; }; "defaultSortDirection": { "alias": "defaultSortDirection"; "required": false; }; "defaultFilter": { "alias": "defaultFilter"; "required": false; }; "customInclude": { "alias": "customInclude"; "required": false; }; "hasAdd": { "alias": "hasAdd"; "required": false; }; "canDelete": { "alias": "canDelete"; "required": false; }; "canEdit": { "alias": "canEdit"; "required": false; }; "deletePropertyName": { "alias": "deletePropertyName"; "required": false; }; "deleteDisableRule": { "alias": "deleteDisableRule"; "required": false; }; "editOnClick": { "alias": "editOnClick"; "required": false; }; "editOnDblClick": { "alias": "editOnDblClick"; "required": false; }; "editColumn": { "alias": "editColumn"; "required": false; }; "useView": { "alias": "useView"; "required": false; }; "hostClass": { "alias": "hostClass"; "required": false; }; }, {}, never, never, true, never>;
|
|
56
|
+
}
|
package/lib/core.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export * from './auth';
|
|
2
2
|
export { FieldErrorDisplayComponent, PageNotFoundComponent, UnderConstructionComponent } from './base-components';
|
|
3
|
+
export * from './base-components/base-crud-implementation';
|
|
3
4
|
export { BaseFormEditComponent } from './base-components/base-form-edit.component';
|
|
5
|
+
export * from './base-components/base-table-implementation';
|
|
4
6
|
export * from './configurations';
|
|
5
7
|
export * from './grid-layout-format.enum';
|
|
6
8
|
export * from './index';
|
|
9
|
+
export { DIALOG_SERVICE_TOKEN, IDialogService } from './interfaces/dialog.interface';
|
|
7
10
|
export * from './models';
|
|
8
11
|
export * from './models/metadata-storage';
|
|
9
12
|
export * from './providers';
|
|
10
13
|
export * from './rsl-base-module';
|
|
14
|
+
export { RightService } from './services/right.service';
|
|
15
|
+
export * from './tokens/table-tokens';
|
|
11
16
|
export * from './utils';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
export interface IDialogService {
|
|
4
|
+
confirmDelete(): Observable<boolean>;
|
|
5
|
+
confirm(content?: string, title?: string, confirmButtonText?: string, cancelButtonText?: string): Observable<boolean>;
|
|
6
|
+
showError(content?: string, title?: string, confirmButtonText?: string, cancelButtonText?: string): Observable<boolean>;
|
|
7
|
+
showSaveMessage(message?: string): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const DIALOG_SERVICE_TOKEN: InjectionToken<IDialogService>;
|
package/lib/models/role.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DatastoreCore, Right } from '../core';
|
|
2
|
+
import { BaseService } from './base.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class RightService extends BaseService<Right> {
|
|
5
|
+
constructor(datastore: DatastoreCore);
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RightService, never>;
|
|
7
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RightService>;
|
|
8
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { DatastoreCore, Right } from '../core';
|
|
2
3
|
import { Role } from '../models/role';
|
|
3
4
|
import { BaseService } from './base.service';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class RoleService extends BaseService<Role> {
|
|
6
7
|
constructor(datastore: DatastoreCore);
|
|
8
|
+
getRoleRights(roleId: string): Observable<Right[]>;
|
|
7
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<RoleService, never>;
|
|
8
10
|
static ɵprov: i0.ɵɵInjectableDeclaration<RoleService>;
|
|
9
11
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectionToken, Type } from '@angular/core';
|
|
2
|
+
import { BaseModel } from '../models/base.model';
|
|
3
|
+
import { BaseService } from '../services/base.service';
|
|
4
|
+
export declare const MODEL_SERVICE: InjectionToken<BaseService<BaseModel>>;
|
|
5
|
+
export declare const MODEL_TOKEN: InjectionToken<Type<BaseModel>>;
|
|
6
|
+
export declare const TABLE_IMPLEMENTATIONS_TOKEN: InjectionToken<Record<string, Type<any>>>;
|
|
7
|
+
export declare const CRUD_IMPLEMENTATIONS_TOKEN: InjectionToken<Record<string, Type<any>>>;
|