@smallpearl/ngx-helper 0.33.24 → 0.33.28
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/smallpearl-ngx-helper-mat-entity-crud.mjs +394 -72
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -1
- package/mat-entity-crud/src/context-param-to-http-context.d.ts +11 -0
- package/mat-entity-crud/src/form-view-host.component.d.ts +5 -0
- package/mat-entity-crud/src/mat-entity-crud-form-base.d.ts +152 -26
- package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +23 -0
- package/mat-entity-crud/src/mat-entity-crud-types.d.ts +29 -4
- package/mat-entity-crud/src/mat-entity-crud.component.d.ts +4 -0
- package/mat-entity-list/src/mat-entity-list.component.d.ts +1 -1
- package/package.json +9 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpContextToken } from "@angular/common/http";
|
|
1
|
+
import { HttpContextToken, HttpParams } from "@angular/common/http";
|
|
2
2
|
import { SPContextMenuItem } from "@smallpearl/ngx-helper/mat-context-menu";
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
4
|
/**
|
|
@@ -26,15 +26,31 @@ export interface SPMatEntityCrudConfig {
|
|
|
26
26
|
* This is the interface through which the client provided CRUD form component
|
|
27
27
|
* interacts with the 'host' SPMatEntityCrudComponent. When the form wants to
|
|
28
28
|
* submit an entity to the server (for create or update), it should call the
|
|
29
|
-
* one of the create or update methods. The interface also other
|
|
30
|
-
* the form component to interact with SPMatEntityCrudComponent
|
|
31
|
-
* refresh its entities list, close the form pane, etc.
|
|
29
|
+
* one of the create or update methods. The interface also provides other
|
|
30
|
+
* methods for the form component to interact with SPMatEntityCrudComponent
|
|
31
|
+
* such as refresh its entities list, close the form pane, etc.
|
|
32
32
|
*
|
|
33
33
|
* The interface name has a 'Bridge' as the interface acts as a bridge between
|
|
34
34
|
* the client provided form handler component and the host
|
|
35
35
|
* SPMatEntityCrudComponent.
|
|
36
36
|
*/
|
|
37
37
|
export interface SPMatEntityCrudCreateEditBridge {
|
|
38
|
+
/**
|
|
39
|
+
* Returns the entity name as provided to the host SPMatEntityCrudComponent.
|
|
40
|
+
* @returns The entity name string.
|
|
41
|
+
*/
|
|
42
|
+
getEntityName(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the entity id key as provided to the host SPMatEntityCrudComponent.
|
|
45
|
+
* @returns The entity id key string.
|
|
46
|
+
*/
|
|
47
|
+
getIdKey(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Get Entity url
|
|
50
|
+
* @param cancel
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
getEntityUrl(entityId: any): string;
|
|
38
54
|
/**
|
|
39
55
|
* Close the edit/update form pane. This WON'T call the 'cancelEditCallback'
|
|
40
56
|
* even if one is registered.
|
|
@@ -67,6 +83,15 @@ export interface SPMatEntityCrudCreateEditBridge {
|
|
|
67
83
|
* view while the async function to update the object remains active.
|
|
68
84
|
*/
|
|
69
85
|
update: (id: any, entityValue: any) => Observable<any>;
|
|
86
|
+
/**
|
|
87
|
+
* Load the entity with the given id from server.
|
|
88
|
+
* @param id The id of the entity to load.
|
|
89
|
+
* @param params Additional parameters for loading the entity. This will
|
|
90
|
+
* be passed to the underlying data service's 'get' method. This can be a
|
|
91
|
+
* query parameters string or HttpParams object.
|
|
92
|
+
* @returns Observable of the loaded entity.
|
|
93
|
+
*/
|
|
94
|
+
loadEntity: (id: any, params: string | HttpParams) => Observable<any>;
|
|
70
95
|
}
|
|
71
96
|
/**
|
|
72
97
|
* Prototype of the function that will be used instead of HttpClient for
|
|
@@ -283,6 +283,9 @@ export declare class SPMatEntityCrudComponent<TEntity extends {
|
|
|
283
283
|
*/
|
|
284
284
|
canDeactivate(): boolean;
|
|
285
285
|
refresh(force?: boolean): void;
|
|
286
|
+
getEntityName(): string;
|
|
287
|
+
getEntityNamePlural(): string;
|
|
288
|
+
getIdKey(): string;
|
|
286
289
|
closeCreateEdit(cancelled: boolean): void;
|
|
287
290
|
canCancelEdit(): boolean;
|
|
288
291
|
registerCanCancelEditCallback(callback: () => boolean): void;
|
|
@@ -290,6 +293,7 @@ export declare class SPMatEntityCrudComponent<TEntity extends {
|
|
|
290
293
|
triggerEntityDelete(entity: TEntity): void;
|
|
291
294
|
create(entityValue: any): Observable<any>;
|
|
292
295
|
update(id: TEntity[IdKey], entityValue: any): Observable<any>;
|
|
296
|
+
loadEntity(id: TEntity[IdKey], params: string | HttpParams): Observable<TEntity>;
|
|
293
297
|
/**
|
|
294
298
|
* Thunk these methods to the internal <sp-mat-entity-list> component.
|
|
295
299
|
*/
|
|
@@ -129,7 +129,7 @@ export declare class SPMatEntityListComponent<TEntity extends {
|
|
|
129
129
|
* initialize it appropriately.
|
|
130
130
|
*/
|
|
131
131
|
httpReqContext: import("@angular/core").InputSignal<[HttpContextToken<any>, any] | [[HttpContextToken<any>, any]] | HttpContext | undefined>;
|
|
132
|
-
_entityNamePlural: import("@angular/core").Signal<string
|
|
132
|
+
_entityNamePlural: import("@angular/core").Signal<string>;
|
|
133
133
|
_httpReqContext: import("@angular/core").Signal<HttpContext>;
|
|
134
134
|
deferViewInit: import("@angular/core").InputSignal<boolean>;
|
|
135
135
|
firstLoadDone: boolean;
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"path": "src/assets/i18n/"
|
|
7
7
|
}
|
|
8
8
|
],
|
|
9
|
-
"version": "0.33.
|
|
9
|
+
"version": "0.33.28",
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"@angular/common": "^19.1.0",
|
|
12
12
|
"@angular/core": "^19.1.0",
|
|
@@ -52,14 +52,6 @@
|
|
|
52
52
|
"types": "./entity-field/index.d.ts",
|
|
53
53
|
"default": "./fesm2022/smallpearl-ngx-helper-entity-field.mjs"
|
|
54
54
|
},
|
|
55
|
-
"./hover-dropdown": {
|
|
56
|
-
"types": "./hover-dropdown/index.d.ts",
|
|
57
|
-
"default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
|
|
58
|
-
},
|
|
59
|
-
"./forms": {
|
|
60
|
-
"types": "./forms/index.d.ts",
|
|
61
|
-
"default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
|
|
62
|
-
},
|
|
63
55
|
"./mat-busy-wheel": {
|
|
64
56
|
"types": "./mat-busy-wheel/index.d.ts",
|
|
65
57
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs"
|
|
@@ -68,6 +60,14 @@
|
|
|
68
60
|
"types": "./locale/index.d.ts",
|
|
69
61
|
"default": "./fesm2022/smallpearl-ngx-helper-locale.mjs"
|
|
70
62
|
},
|
|
63
|
+
"./hover-dropdown": {
|
|
64
|
+
"types": "./hover-dropdown/index.d.ts",
|
|
65
|
+
"default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
|
|
66
|
+
},
|
|
67
|
+
"./forms": {
|
|
68
|
+
"types": "./forms/index.d.ts",
|
|
69
|
+
"default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
|
|
70
|
+
},
|
|
71
71
|
"./mat-context-menu": {
|
|
72
72
|
"types": "./mat-context-menu/index.d.ts",
|
|
73
73
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs"
|